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 ROSEN_RENDER_SERVICE_BASE_RS_FRAME_REPORT_H 17 #define ROSEN_RENDER_SERVICE_BASE_RS_FRAME_REPORT_H 18 19 #include <string> 20 21 #include "common/rs_macros.h" 22 23 namespace OHOS { 24 namespace Rosen { 25 using FrameGetEnableFunc = int (*)(); 26 using ProcessCommandsStartFunc = void(*)(); 27 using AnimateStartFunc = void(*)(); 28 using RenderStartFunc = void(*)(); 29 using SendCommandsStartFunc = void(*)(); 30 31 class RSB_EXPORT RsFrameReport final { 32 public: 33 static RSB_EXPORT RsFrameReport& GetInstance(); 34 void Init(); 35 int GetEnable(); 36 37 void ProcessCommandsStart(); 38 void AnimateStart(); 39 void RenderStart(); 40 void SendCommandsStart(); 41 42 private: 43 RsFrameReport(); 44 ~RsFrameReport(); 45 bool LoadLibrary(); 46 void CloseLibrary(); 47 void *LoadSymbol(const char *symName); 48 void *frameSchedHandle_ = nullptr; 49 bool frameSchedSoLoaded_ = false; 50 51 FrameGetEnableFunc frameGetEnableFunc_ = nullptr; 52 ProcessCommandsStartFunc processCommandsStartFun_ = nullptr; 53 AnimateStartFunc animateStartFunc_ = nullptr; 54 RenderStartFunc renderStartFunc_ = nullptr; 55 SendCommandsStartFunc sendCommandsStartFunc_ = nullptr; 56 }; 57 } // namespace Rosen 58 } // namespace OHOS 59 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_FRAME_REPORT_H 60