• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 SUBTREE_PARAM_H
17 #define SUBTREE_PARAM_H
18 
19 #include "feature_param.h"
20 
21 namespace OHOS::Rosen {
22 class SubtreeParallelParam : public FeatureParam {
23 public:
24     SubtreeParallelParam() = default;
25     ~SubtreeParallelParam() = default;
26 
27     static bool GetSubtreeEnable();
28     static bool GetRBPolicyEnabled();
29     static bool GetMultiWinPolicyEnabled();
30     static int GetMultiWinSurfaceNum();
31     static int GetRBChildrenWeight();
32     static int GetRBSubtreeWeight();
33     static std::unordered_map<std::string, std::string> GetSubtreeScene();
34 
35 protected:
36     static void SetSubtreeEnable(bool isSubtreeEnable);
37     static void SetMultiWinPolicyEnabled(bool isMultiWinPolicyEnable);
38     static void SetRBPolicyEnabled(bool isRBPolicyEnable);
39     static void SetMultiWinSurfaceNum(int surfaceNum);
40     static void SetRBChildrenWeight(int weight);
41     static void SetRBSubtreeWeight(int weight);
42     static void SetSubtreeScene(const std::string& appName, const std::string& val);
43 
44 private:
45     inline static bool isSubtreeEnable_ = false;
46     inline static bool isMultiWinPolicyEnable_ = false;
47     inline static bool isRBPolicyEnable_ = false;
48     inline static int multiWinSurfaceNum_ = -1;
49     inline static int rbChildrenWeight_ = -1;
50     inline static int rbSubTreeWeight_ = -1;
51     // <"pkgName", "1">
52     inline static std::unordered_map<std::string, std::string> subtreeScene_ = {};
53 
54     friend class SubtreeParallelParamParse;
55 };
56 } // namespace OHOS::Rosen
57 #endif // SUBTREE_PARAM_H