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 29 namespace OHOS { 30 namespace Rosen { 31 class RSB_EXPORT RSPropertyTrace { 32 public: GetInstance()33 static RSPropertyTrace &GetInstance() 34 { 35 return instance_; 36 }; 37 38 void PropertiesDisplayByTrace(const NodeId& id, const std::shared_ptr<RSObjAbsGeometry>& boundsGeometry); 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::string propertyFileLastModifyTime; 60 }; 61 62 } // namespace Rosen 63 } // namespace OHOS 64 65 #endif // RENDER_SERVICE_BASE_COMMON_RS_PROPERTY_TRACE_H 66