• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_UI_INTF_H
17 #define FRAME_UI_INTF_H
18 
19 #include <cstdint>
20 #include "frame_info_const.h"
21 #include <unordered_map>
22 
23 namespace OHOS {
24 namespace RME {
25 class FrameUiIntf {
26 public:
27     static FrameUiIntf& GetInstance();
28     void Init();
29     int GetSenseSchedEnable();
30     void ReportSchedEvent(FrameSchedEvent event, const std::unordered_map<std::string, std::string>& payload);
31     void BeginFlushAnimation() const;
32     void EndFlushAnimation() const;
33 
34     void BeginFlushBuild() const;
35     void EndFlushBuild() const;
36     void BeginFlushLayout() const;
37     void EndFlushLayout() const;
38 
39     void BeginFlushRender() const;
40     void EndFlushRender() const;
41 
42     void BeginFlushRenderFinish() const;
43     void EndFlushRenderFinish() const;
44 
45     void BeginProcessPostFlush() const;
46     void ProcessCommandsStart() const;
47     void AnimateStart() const;
48     void RenderStart(uint64_t timestamp) const;
49     void RenderEnd() const;
50     void SendCommandsStart() const;
51 
52     void BeginListFling() const;
53     void EndListFling() const;
54     void FlushBegin() const;
55     void FlushEnd() const;
56     void SetFrameParam(int requestId, int load, int schedFrameNum, int value) const;
57 
58     void HandleSwapBuffer() const;
59     void RequestNextVSync() const;
60     void EnableSelfRender() const;
61     void DisableSelfRender() const;
62     void ReceiveVSync() const;
63     void MonitorGpuStart(uint32_t fenceId) const;
64     void MonitorGpuEnd() const;
65     void SendFenceId(uint32_t fenceId) const;
66 private:
67     bool inited = false;
68 };
69 } // namespace RME
70 } // namespace OHOS
71 #endif
72