Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 28 | class Hwc2TestLayer { |
| 29 | public: |
Marissa Wall | 600a73b | 2016-12-15 12:30:39 -0800 | [diff] [blame] | 30 | Hwc2TestLayer(Hwc2TestCoverage coverage, const Area& displayArea, |
| 31 | uint32_t zOrder = 0); |
Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 32 | |
| 33 | std::string dump() const; |
| 34 | |
| 35 | void reset(); |
| 36 | |
Marissa Wall | b72b5c9 | 2016-12-15 12:26:39 -0800 | [diff] [blame] | 37 | hwc2_blend_mode_t getBlendMode() const; |
| 38 | hwc2_composition_t getComposition() const; |
| 39 | android_dataspace_t getDataspace() const; |
Marissa Wall | 600a73b | 2016-12-15 12:30:39 -0800 | [diff] [blame] | 40 | hwc_rect_t getDisplayFrame() const; |
Marissa Wall | 2b1f530 | 2016-12-15 12:27:20 -0800 | [diff] [blame] | 41 | float getPlaneAlpha() const; |
Marissa Wall | c57468f | 2016-12-15 12:31:12 -0800 | [diff] [blame^] | 42 | hwc_frect_t getSourceCrop() const; |
Marissa Wall | ac10819 | 2016-12-15 12:27:48 -0800 | [diff] [blame] | 43 | hwc_transform_t getTransform() const; |
Marissa Wall | 273b1df | 2016-12-15 12:28:47 -0800 | [diff] [blame] | 44 | uint32_t getZOrder() const; |
Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 45 | |
Marissa Wall | ffc67da | 2016-12-15 12:26:09 -0800 | [diff] [blame] | 46 | bool advanceBlendMode(); |
Marissa Wall | c57468f | 2016-12-15 12:31:12 -0800 | [diff] [blame^] | 47 | bool advanceBufferArea(); |
Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 48 | bool advanceComposition(); |
Marissa Wall | b72b5c9 | 2016-12-15 12:26:39 -0800 | [diff] [blame] | 49 | bool advanceDataspace(); |
Marissa Wall | 600a73b | 2016-12-15 12:30:39 -0800 | [diff] [blame] | 50 | bool advanceDisplayFrame(); |
Marissa Wall | 2b1f530 | 2016-12-15 12:27:20 -0800 | [diff] [blame] | 51 | bool advancePlaneAlpha(); |
Marissa Wall | c57468f | 2016-12-15 12:31:12 -0800 | [diff] [blame^] | 52 | bool advanceSourceCrop(); |
Marissa Wall | ac10819 | 2016-12-15 12:27:48 -0800 | [diff] [blame] | 53 | bool advanceTransform(); |
Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 54 | |
| 55 | private: |
Marissa Wall | c57468f | 2016-12-15 12:31:12 -0800 | [diff] [blame^] | 56 | std::array<Hwc2TestContainer*, 7> mProperties = {{ |
| 57 | &mBlendMode, &mComposition, &mDataspace, &mDisplayFrame, &mPlaneAlpha, |
| 58 | &mSourceCrop, &mTransform |
Marissa Wall | ffc67da | 2016-12-15 12:26:09 -0800 | [diff] [blame] | 59 | }}; |
| 60 | |
| 61 | Hwc2TestBlendMode mBlendMode; |
Marissa Wall | c57468f | 2016-12-15 12:31:12 -0800 | [diff] [blame^] | 62 | Hwc2TestBufferArea mBufferArea; |
Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 63 | Hwc2TestComposition mComposition; |
Marissa Wall | b72b5c9 | 2016-12-15 12:26:39 -0800 | [diff] [blame] | 64 | Hwc2TestDataspace mDataspace; |
Marissa Wall | 600a73b | 2016-12-15 12:30:39 -0800 | [diff] [blame] | 65 | Hwc2TestDisplayFrame mDisplayFrame; |
Marissa Wall | 2b1f530 | 2016-12-15 12:27:20 -0800 | [diff] [blame] | 66 | Hwc2TestPlaneAlpha mPlaneAlpha; |
Marissa Wall | c57468f | 2016-12-15 12:31:12 -0800 | [diff] [blame^] | 67 | Hwc2TestSourceCrop mSourceCrop; |
Marissa Wall | ac10819 | 2016-12-15 12:27:48 -0800 | [diff] [blame] | 68 | Hwc2TestTransform mTransform; |
Marissa Wall | 273b1df | 2016-12-15 12:28:47 -0800 | [diff] [blame] | 69 | |
| 70 | uint32_t mZOrder; |
Marissa Wall | 6bd8bfd | 2016-12-15 12:25:31 -0800 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | #endif /* ifndef _HWC2_TEST_LAYER_H */ |