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 InitFunc = void (*)(); 27 using ProcessCommandsStartFunc = void(*)(); 28 using AnimateStartFunc = void(*)(); 29 using RenderStartFunc = void(*)(); 30 using RenderEndFunc = void(*)(); 31 using SendCommandsStartFunc = void(*)(); 32 33 class RSB_EXPORT RsFrameReport final { 34 public: 35 static RSB_EXPORT RsFrameReport& GetInstance(); 36 void Init(); 37 int GetEnable(); 38 39 void ProcessCommandsStart(); 40 void AnimateStart(); 41 void RenderStart(); 42 void RenderEnd(); 43 void SendCommandsStart(); 44 45 private: 46 RsFrameReport(); 47 ~RsFrameReport(); 48 bool LoadLibrary(); 49 void CloseLibrary(); 50 void *LoadSymbol(const char *symName); 51 void *frameSchedHandle_ = nullptr; 52 bool frameSchedSoLoaded_ = false; 53 54 FrameGetEnableFunc frameGetEnableFunc_ = nullptr; 55 InitFunc initFunc_ = nullptr; 56 ProcessCommandsStartFunc processCommandsStartFun_ = nullptr; 57 AnimateStartFunc animateStartFunc_ = nullptr; 58 RenderStartFunc renderStartFunc_ = nullptr; 59 RenderEndFunc renderEndFunc_ = nullptr; 60 SendCommandsStartFunc sendCommandsStartFunc_ = nullptr; 61 }; 62 } // namespace Rosen 63 } // namespace OHOS 64 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_FRAME_REPORT_H 65