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 FB_COMPOSITION_H
17 #define FB_COMPOSITION_H
18 #include <memory>
19 #include <vector>
20 #include "hdi_composer.h"
21 namespace OHOS {
22 namespace HDI {
23 namespace DISPLAY {
24 class FbComposition : public HdiComposition {
25 public:
26     explicit FbComposition(const std::vector<int> &fbs);
27     virtual ~FbComposition();
28     int32_t Init();
29     int32_t SetLayers(std::vector<HdiLayer *> &layers, HdiLayer &clientLayer);
30     int32_t Apply(bool modeSet);
31 private:
32     int32_t FbFresh(int fd, HdiLayer &clientlayer, int &fence);
33     std::vector<int> fds_;
34 };
35 } // namespace DISPLAY
36 } // namespace HDI
37 } // namespace OHOS
38 #endif // FB_COMPOSITION_H