• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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_CORE_DRIVEN_RENDER_EXT_H
17 #define RENDER_SERVICE_CORE_DRIVEN_RENDER_EXT_H
18 
19 #include "rs_driven_render_manager.h"
20 
21 namespace OHOS {
22 namespace Rosen {
23 class RSDrivenRenderExt {
24 public:
25     static RSDrivenRenderExt& Instance();
26     bool OpenDrivenRenderExt();
27 
28     void DisabledRenderMode(DrivenExtInfo& mutableInfo) const;
29     void SetCurrFrameBounds(
30         DrivenExtInfo& mutableInfo, const RectF& bounds, const RectF& viewPort, const RectI& contentAbsRect) const;
31     void UpdateActivateFrameState(DrivenExtInfo& mutableInfo, const RectI& dstRect, bool backgroundDirty,
32         bool contentDirty, bool nonContentDirty) const;
33 
34     bool IsValidSurfaceName(const std::string& surfaceName) const;
35 
36 private:
37     RSDrivenRenderExt() = default;
38     ~RSDrivenRenderExt();
39     RSDrivenRenderExt(const RSDrivenRenderExt&) = delete;
40     RSDrivenRenderExt(const RSDrivenRenderExt&&) = delete;
41     RSDrivenRenderExt& operator=(const RSDrivenRenderExt&) = delete;
42     RSDrivenRenderExt& operator=(const RSDrivenRenderExt&&) = delete;
43 
44     bool DrivenRenderVersionMatched();
45     bool LoadDrivenRenderFunc();
46     void CloseDrivenRenderExt();
47 
48     bool drivenRenderExtLoaded_ = false;
49     void* drivenRenderExtHandle_ = nullptr;
50 
51     void* disabledRenderModeFunc_ = nullptr;
52     void* setCurrFrameBoundsFunc_ = nullptr;
53     void* updateActivateFrameStateFunc_ = nullptr;
54     void* isValidSurfaceNameFunc_ = nullptr;
55 };
56 } // namespace Rosen
57 } // namespace OHOS
58 #endif // RENDER_SERVICE_CORE_DRIVEN_RENDER_EXT_H
59