blob: f548ea6f7cd6dec21dcd5e6f272abe978cbc3ebb [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 Wall600a73b2016-12-15 12:30:39 -080030 Hwc2TestLayer(Hwc2TestCoverage coverage, const Area& displayArea,
31 uint32_t zOrder = 0);
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080032
33 std::string dump() const;
34
35 void reset();
36
Marissa Wallb72b5c92016-12-15 12:26:39 -080037 hwc2_blend_mode_t getBlendMode() const;
Marissa Wallee242782016-12-15 12:30:12 -080038 hwc_color_t getColor() const;
Marissa Wallb72b5c92016-12-15 12:26:39 -080039 hwc2_composition_t getComposition() const;
40 android_dataspace_t getDataspace() const;
Marissa Wall600a73b2016-12-15 12:30:39 -080041 hwc_rect_t getDisplayFrame() const;
Marissa Wall2b1f5302016-12-15 12:27:20 -080042 float getPlaneAlpha() const;
Marissa Wallc57468f2016-12-15 12:31:12 -080043 hwc_frect_t getSourceCrop() const;
Marissa Wallac108192016-12-15 12:27:48 -080044 hwc_transform_t getTransform() const;
Marissa Wall273b1df2016-12-15 12:28:47 -080045 uint32_t getZOrder() const;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080046
Marissa Wallffc67da2016-12-15 12:26:09 -080047 bool advanceBlendMode();
Marissa Wallc57468f2016-12-15 12:31:12 -080048 bool advanceBufferArea();
Marissa Wallee242782016-12-15 12:30:12 -080049 bool advanceColor();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080050 bool advanceComposition();
Marissa Wallb72b5c92016-12-15 12:26:39 -080051 bool advanceDataspace();
Marissa Wall600a73b2016-12-15 12:30:39 -080052 bool advanceDisplayFrame();
Marissa Wall2b1f5302016-12-15 12:27:20 -080053 bool advancePlaneAlpha();
Marissa Wallc57468f2016-12-15 12:31:12 -080054 bool advanceSourceCrop();
Marissa Wallac108192016-12-15 12:27:48 -080055 bool advanceTransform();
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080056
57private:
Marissa Wallee242782016-12-15 12:30:12 -080058 std::array<Hwc2TestContainer*, 8> mProperties = {{
59 &mBlendMode, &mColor, &mComposition, &mDataspace, &mDisplayFrame,
60 &mPlaneAlpha, &mSourceCrop, &mTransform
Marissa Wallffc67da2016-12-15 12:26:09 -080061 }};
62
63 Hwc2TestBlendMode mBlendMode;
Marissa Wallc57468f2016-12-15 12:31:12 -080064 Hwc2TestBufferArea mBufferArea;
Marissa Wallee242782016-12-15 12:30:12 -080065 Hwc2TestColor mColor;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080066 Hwc2TestComposition mComposition;
Marissa Wallb72b5c92016-12-15 12:26:39 -080067 Hwc2TestDataspace mDataspace;
Marissa Wall600a73b2016-12-15 12:30:39 -080068 Hwc2TestDisplayFrame mDisplayFrame;
Marissa Wall2b1f5302016-12-15 12:27:20 -080069 Hwc2TestPlaneAlpha mPlaneAlpha;
Marissa Wallc57468f2016-12-15 12:31:12 -080070 Hwc2TestSourceCrop mSourceCrop;
Marissa Wallac108192016-12-15 12:27:48 -080071 Hwc2TestTransform mTransform;
Marissa Wall273b1df2016-12-15 12:28:47 -080072
73 uint32_t mZOrder;
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080074};
75
76#endif /* ifndef _HWC2_TEST_LAYER_H */