blob: a4d6d1d24e81993832871aef987a908a8374301f [file] [log] [blame]
Marissa Wall6bd8bfd2016-12-15 12:25:31 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _HWC2_TEST_LAYER_H
18#define _HWC2_TEST_LAYER_H
19
20#include "Hwc2TestProperties.h"
21
22#define HWC2_INCLUDE_STRINGIFICATION
23#define HWC2_USE_CPP11
24#include <hardware/hwcomposer2.h>
25#undef HWC2_INCLUDE_STRINGIFICATION
26#undef HWC2_USE_CPP11
27
28class Hwc2TestLayer {
29public:
30 Hwc2TestLayer(Hwc2TestCoverage coverage);
31
32 std::string dump() const;
33
34 void reset();
35
Marissa Wallffc67da2016-12-15 12:26:09 -080036 hwc2_blend_mode_t getBlendMode() const;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080037 hwc2_composition_t getComposition() const;
38
Marissa Wallffc67da2016-12-15 12:26:09 -080039 bool advanceBlendMode();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080040 bool advanceComposition();
41
42private:
Marissa Wallffc67da2016-12-15 12:26:09 -080043 std::array<Hwc2TestContainer*, 2> mProperties = {{
44 &mBlendMode, &mComposition
45 }};
46
47 Hwc2TestBlendMode mBlendMode;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080048 Hwc2TestComposition mComposition;
49};
50
51#endif /* ifndef _HWC2_TEST_LAYER_H */