blob: 8477949f993706e287bf122c2355967a1afc430f [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#include <sstream>
18
19#include "Hwc2TestProperties.h"
20
Marissa Wallffc67da2016-12-15 12:26:09 -080021Hwc2TestBlendMode::Hwc2TestBlendMode(Hwc2TestCoverage coverage)
22 : Hwc2TestProperty(coverage, mCompleteBlendModes, mBasicBlendModes,
23 mDefaultBlendModes) { }
24
25std::string Hwc2TestBlendMode::dump() const
26{
27 std::stringstream dmp;
28 dmp << "\tblend mode: " << getBlendModeName(get()) << "\n";
29 return dmp.str();
30}
31
32const std::vector<hwc2_blend_mode_t> Hwc2TestBlendMode::mDefaultBlendModes = {
33 HWC2_BLEND_MODE_NONE,
34};
35
36const std::vector<hwc2_blend_mode_t> Hwc2TestBlendMode::mBasicBlendModes = {
37 HWC2_BLEND_MODE_NONE,
38 HWC2_BLEND_MODE_PREMULTIPLIED,
39};
40
41const std::vector<hwc2_blend_mode_t> Hwc2TestBlendMode::mCompleteBlendModes = {
42 HWC2_BLEND_MODE_NONE,
43 HWC2_BLEND_MODE_PREMULTIPLIED,
44 HWC2_BLEND_MODE_COVERAGE,
45};
46
47
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080048Hwc2TestComposition::Hwc2TestComposition(Hwc2TestCoverage coverage)
Marissa Wallffc67da2016-12-15 12:26:09 -080049 : Hwc2TestProperty(coverage, mCompleteCompositions, mBasicCompositions,
Marissa Wall6bd8bfd2016-12-15 12:25:31 -080050 mDefaultCompositions) { }
51
52std::string Hwc2TestComposition::dump() const
53{
54 std::stringstream dmp;
55 dmp << "\tcomposition: " << getCompositionName(get()) << "\n";
56 return dmp.str();
57}
58
59const std::vector<hwc2_composition_t> Hwc2TestComposition::mDefaultCompositions = {
60 HWC2_COMPOSITION_DEVICE,
61};
62
63const std::vector<hwc2_composition_t> Hwc2TestComposition::mBasicCompositions = {
64 HWC2_COMPOSITION_CLIENT,
65 HWC2_COMPOSITION_DEVICE,
66};
67
68const std::vector<hwc2_composition_t> Hwc2TestComposition::mCompleteCompositions = {
69 HWC2_COMPOSITION_CLIENT,
70 HWC2_COMPOSITION_DEVICE,
71 HWC2_COMPOSITION_SOLID_COLOR,
72 HWC2_COMPOSITION_CURSOR,
73 HWC2_COMPOSITION_SIDEBAND,
74};
Marissa Wallb72b5c92016-12-15 12:26:39 -080075
76
77Hwc2TestDataspace::Hwc2TestDataspace(Hwc2TestCoverage coverage)
78 : Hwc2TestProperty(coverage, completeDataspaces, basicDataspaces,
79 defaultDataspaces) { }
80
81std::string Hwc2TestDataspace::dump() const
82{
83 std::stringstream dmp;
84 dmp << "\tdataspace: " << get() << "\n";
85 return dmp.str();
86}
87
88const std::vector<android_dataspace_t> Hwc2TestDataspace::defaultDataspaces = {
89 HAL_DATASPACE_UNKNOWN,
90};
91
92const std::vector<android_dataspace_t> Hwc2TestDataspace::basicDataspaces = {
93 HAL_DATASPACE_UNKNOWN,
94 HAL_DATASPACE_V0_SRGB,
95};
96
97const std::vector<android_dataspace_t> Hwc2TestDataspace::completeDataspaces = {
98 HAL_DATASPACE_UNKNOWN,
99 HAL_DATASPACE_ARBITRARY,
100 HAL_DATASPACE_STANDARD_SHIFT,
101 HAL_DATASPACE_STANDARD_MASK,
102 HAL_DATASPACE_STANDARD_UNSPECIFIED,
103 HAL_DATASPACE_STANDARD_BT709,
104 HAL_DATASPACE_STANDARD_BT601_625,
105 HAL_DATASPACE_STANDARD_BT601_625_UNADJUSTED,
106 HAL_DATASPACE_STANDARD_BT601_525,
107 HAL_DATASPACE_STANDARD_BT601_525_UNADJUSTED,
108 HAL_DATASPACE_STANDARD_BT2020,
109 HAL_DATASPACE_STANDARD_BT2020_CONSTANT_LUMINANCE,
110 HAL_DATASPACE_STANDARD_BT470M,
111 HAL_DATASPACE_STANDARD_FILM,
112 HAL_DATASPACE_TRANSFER_SHIFT,
113 HAL_DATASPACE_TRANSFER_MASK,
114 HAL_DATASPACE_TRANSFER_UNSPECIFIED,
115 HAL_DATASPACE_TRANSFER_LINEAR,
116 HAL_DATASPACE_TRANSFER_SRGB,
117 HAL_DATASPACE_TRANSFER_SMPTE_170M,
118 HAL_DATASPACE_TRANSFER_GAMMA2_2,
119 HAL_DATASPACE_TRANSFER_GAMMA2_8,
120 HAL_DATASPACE_TRANSFER_ST2084,
121 HAL_DATASPACE_TRANSFER_HLG,
122 HAL_DATASPACE_RANGE_SHIFT,
123 HAL_DATASPACE_RANGE_MASK,
124 HAL_DATASPACE_RANGE_UNSPECIFIED,
125 HAL_DATASPACE_RANGE_FULL,
126 HAL_DATASPACE_RANGE_LIMITED,
127 HAL_DATASPACE_SRGB_LINEAR,
128 HAL_DATASPACE_V0_SRGB_LINEAR,
129 HAL_DATASPACE_SRGB,
130 HAL_DATASPACE_V0_SRGB,
131 HAL_DATASPACE_JFIF,
132 HAL_DATASPACE_V0_JFIF,
133 HAL_DATASPACE_BT601_625,
134 HAL_DATASPACE_V0_BT601_625,
135 HAL_DATASPACE_BT601_525,
136 HAL_DATASPACE_V0_BT601_525,
137 HAL_DATASPACE_BT709,
138 HAL_DATASPACE_V0_BT709,
139 HAL_DATASPACE_DEPTH,
140};
Marissa Wall2b1f5302016-12-15 12:27:20 -0800141
142
143Hwc2TestPlaneAlpha::Hwc2TestPlaneAlpha(Hwc2TestCoverage coverage)
144 : Hwc2TestProperty(coverage, mCompletePlaneAlphas, mBasicPlaneAlphas,
145 mDefaultPlaneAlphas) { }
146
147std::string Hwc2TestPlaneAlpha::dump() const
148{
149 std::stringstream dmp;
150 dmp << "\tplane alpha: " << get() << "\n";
151 return dmp.str();
152}
153
154const std::vector<float> Hwc2TestPlaneAlpha::mDefaultPlaneAlphas = {
155 1.0f,
156};
157
158const std::vector<float> Hwc2TestPlaneAlpha::mBasicPlaneAlphas = {
159 1.0f, 0.0f,
160};
161
162const std::vector<float> Hwc2TestPlaneAlpha::mCompletePlaneAlphas = {
163 1.0f, 0.75f, 0.5f, 0.25f, 0.0f,
164};