• 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 HDI_COMPOSITION_CHECK_H
17 #define HDI_COMPOSITION_CHECK_H
18 #include "v1_1/display_composer_type.h"
19 #include "display_test_utils.h"
20 
21 namespace OHOS {
22 namespace HDI {
23 namespace Display {
24 namespace TEST {
25 struct Point {
26     int32_t x = 0;
27     int32_t y = 0;
28 };
29 
30 class HdiCompositionCheck {
31 public:
GetInstance()32     static HdiCompositionCheck& GetInstance()
33     {
34         static HdiCompositionCheck instace = HdiCompositionCheck();
35         return instace;
36     }
Init(uint32_t w,uint32_t h)37     void Init(uint32_t w, uint32_t h)
38     {
39         dispW_ = w;
40         dispH_ = h;
41     }
42     enum {
43         CHECK_CENTER,
44         CHECK_VERTEX
45     };
46     int32_t Check(const std::vector<LayerSettings> &layers,
47         const BufferHandle& clientBuffer, uint32_t checkType = CHECK_VERTEX) const;
48 
49 private:
HdiCompositionCheck()50     HdiCompositionCheck() {}
~HdiCompositionCheck()51     ~HdiCompositionCheck() {}
52     uint32_t dispW_ = 0;
53     uint32_t dispH_ = 0;
54 };
55 } // OHOS
56 } // HDI
57 } // Display
58 } // TEST
59 
60 #endif // HDI_COMPOSITION_CHECK_H
61