blob: 855f7bbbd8f95ab9a3449260140f9e93fe66a6f2 [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:
Marissa Wall273b1df2016-12-15 12:28:47 -080030 Hwc2TestLayer(Hwc2TestCoverage coverage, uint32_t zOrder = 0);
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080031
32 std::string dump() const;
33
34 void reset();
35
Marissa Wallb72b5c92016-12-15 12:26:39 -080036 hwc2_blend_mode_t getBlendMode() const;
37 hwc2_composition_t getComposition() const;
38 android_dataspace_t getDataspace() const;
Marissa Wall2b1f5302016-12-15 12:27:20 -080039 float getPlaneAlpha() const;
Marissa Wallac108192016-12-15 12:27:48 -080040 hwc_transform_t getTransform() const;
Marissa Wall273b1df2016-12-15 12:28:47 -080041 uint32_t getZOrder() const;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080042
Marissa Wallffc67da2016-12-15 12:26:09 -080043 bool advanceBlendMode();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080044 bool advanceComposition();
Marissa Wallb72b5c92016-12-15 12:26:39 -080045 bool advanceDataspace();
Marissa Wall2b1f5302016-12-15 12:27:20 -080046 bool advancePlaneAlpha();
Marissa Wallac108192016-12-15 12:27:48 -080047 bool advanceTransform();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080048
49private:
Marissa Wallac108192016-12-15 12:27:48 -080050 std::array<Hwc2TestContainer*, 5> mProperties = {{
51 &mBlendMode, &mComposition, &mDataspace, &mPlaneAlpha, &mTransform
Marissa Wallffc67da2016-12-15 12:26:09 -080052 }};
53
54 Hwc2TestBlendMode mBlendMode;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080055 Hwc2TestComposition mComposition;
Marissa Wallb72b5c92016-12-15 12:26:39 -080056 Hwc2TestDataspace mDataspace;
Marissa Wall2b1f5302016-12-15 12:27:20 -080057 Hwc2TestPlaneAlpha mPlaneAlpha;
Marissa Wallac108192016-12-15 12:27:48 -080058 Hwc2TestTransform mTransform;
Marissa Wall273b1df2016-12-15 12:28:47 -080059
60 uint32_t mZOrder;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080061};
62
63#endif /* ifndef _HWC2_TEST_LAYER_H */