1 /* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef RENDER_SERVICE_BASE_COMMON_RS_PROPERTY_TRACE_H 17 #define RENDER_SERVICE_BASE_COMMON_RS_PROPERTY_TRACE_H 18 19 #include <set> 20 #include <unordered_map> 21 #include <sys/stat.h> 22 23 #include "common/rs_common_def.h" 24 #include "common/rs_macros.h" 25 #include "common/rs_obj_abs_geometry.h" 26 #include "modifier/rs_modifier_type.h" 27 #include "platform/common/rs_log.h" 28 #include "property/rs_properties.h" 29 30 namespace OHOS { 31 namespace Rosen { 32 class RSB_EXPORT RSPropertyTrace { 33 public: GetInstance()34 static RSPropertyTrace &GetInstance() 35 { 36 return instance_; 37 }; 38 void PropertiesDisplayByTrace(const NodeId& id, const RSProperties& properties); 39 void RefreshNodeTraceInfo(); 40 private: 41 RSPropertyTrace() = default; 42 ~RSPropertyTrace() = default; 43 44 void InitNodeAndPropertyInfo(); 45 46 void ClearNodeAndPropertyInfo(); 47 48 bool IsNeedPropertyTrace(const NodeId& id); 49 50 void DealConfigInputInfo(const std::string& info); 51 52 bool IsNeedRefreshConfig(); 53 54 void AddTraceFlag(const std::string& str); 55 56 bool needWriteAllNode_ {false}; 57 static RSPropertyTrace instance_; 58 std::set<NodeId> nodeIdSet_; 59 std::set<std::string> propertySet_; 60 std::string propertyFileLastModifyTime; 61 }; 62 63 } // namespace Rosen 64 } // namespace OHOS 65 66 #endif // RENDER_SERVICE_BASE_COMMON_RS_PROPERTY_TRACE_H 67