1 /* 2 * Copyright (c) 2022 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 FRAME_MSG_MGR_H 17 #define FRAME_MSG_MGR_H 18 19 #include <hilog/log.h> 20 #include <map> 21 22 #include "rme_log_domain.h" 23 #include "frame_info_const.h" 24 #include "rme_scene_sched.h" 25 26 namespace OHOS { 27 namespace RME { 28 class FrameMsgMgr { 29 DECLARE_SINGLE_INSTANCE_BASE(FrameMsgMgr); 30 public: 31 FrameMsgMgr(); 32 ~FrameMsgMgr(); 33 bool Init(); 34 void EventUpdate(FrameEvent eventType); 35 private: 36 bool HandleFrameMsgKey(FrameEvent event); 37 void FrameMapKeyToFunc(); 38 void UpdateScene(SceneEvent scene); 39 void SetSchedParam(); 40 41 void HandleBeginFrame(); 42 void BeginFlushAnimation(); 43 void EndFlushAnimation(); 44 void BeginFlushBuild(); 45 void EndFlushBuild(); 46 void BeginFlushLayout(); 47 void EndFlushLayout(); 48 void BeginFlushRender(); 49 void EndFlushRender(); 50 void BeginFlushRenderFinish(); 51 void EndFlushRenderFinish(); 52 53 void BeginProcessPostFlush(); 54 void ProcessCommandsStart(); 55 void AnimateStart(); 56 void RenderStart(); 57 void SendCommandsStart(); 58 void HandleEndFrame(); 59 60 FrameSceneSched *GetSceneHandler() const; 61 typedef void (FrameMsgMgr:: *PHandle)(void); 62 std::map<FrameEvent, PHandle> m_frameMsgKeyToFunc; 63 64 SceneEvent sceneType; 65 RmeSceneSched *rmeScene; 66 }; 67 } // namespace RME 68 } // namespace OHOS 69 #endif 70