OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCommonFlagsConfig.h" | 8 #include "SkCommonFlagsConfig.h" |
9 #include "Test.h" | 9 #include "Test.h" |
10 #include <initializer_list> | 10 #include <initializer_list> |
(...skipping 28 matching lines...) Expand all Loading... |
39 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu")); | 39 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu")); |
40 REPORTER_ASSERT(reporter, configs[0]->getViaParts().count() == 0); | 40 REPORTER_ASSERT(reporter, configs[0]->getViaParts().count() == 0); |
41 #if SK_SUPPORT_GPU | 41 #if SK_SUPPORT_GPU |
42 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 42 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
43 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() | 43 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() |
44 == GrContextFactory::kNativeGL_ContextType); | 44 == GrContextFactory::kNativeGL_ContextType); |
45 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR() == false); | 45 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR() == false); |
46 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText() == false
); | 46 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText() == false
); |
47 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0); | 47 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0); |
48 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorType() == kN32_
SkColorType); | 48 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorType() == kN32_
SkColorType); |
49 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorSpace() == null
ptr); | 49 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getProfileType() |
| 50 == kLinear_SkColorProfileType); |
50 #endif | 51 #endif |
51 } | 52 } |
52 | 53 |
53 DEF_TEST(ParseConfigs_OutParam, reporter) { | 54 DEF_TEST(ParseConfigs_OutParam, reporter) { |
54 // Clears the out parameter. | 55 // Clears the out parameter. |
55 SkCommandLineFlags::StringArray config1 = make_string_array({"gpu"}); | 56 SkCommandLineFlags::StringArray config1 = make_string_array({"gpu"}); |
56 SkCommandLineConfigArray configs; | 57 SkCommandLineConfigArray configs; |
57 ParseConfigs(config1, &configs); | 58 ParseConfigs(config1, &configs); |
58 REPORTER_ASSERT(reporter, configs.count() == 1); | 59 REPORTER_ASSERT(reporter, configs.count() == 1); |
59 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu")); | 60 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu")); |
(...skipping 15 matching lines...) Expand all Loading... |
75 SkCommandLineFlags::StringArray config1 = make_string_array({ | 76 SkCommandLineFlags::StringArray config1 = make_string_array({ |
76 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16"
, "msaa4", | 77 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16"
, "msaa4", |
77 "nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvpr
dit4", "pdf", | 78 "nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvpr
dit4", "pdf", |
78 "skp", "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui
", | 79 "skp", "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui
", |
79 "gpuf16", "gpusrgb", "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4",
"vk" | 80 "gpuf16", "gpusrgb", "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4",
"vk" |
80 }); | 81 }); |
81 | 82 |
82 SkCommandLineConfigArray configs; | 83 SkCommandLineConfigArray configs; |
83 ParseConfigs(config1, &configs); | 84 ParseConfigs(config1, &configs); |
84 | 85 |
85 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | |
86 | |
87 REPORTER_ASSERT(reporter, configs.count() == config1.count()); | 86 REPORTER_ASSERT(reporter, configs.count() == config1.count()); |
88 for (int i = 0; i < config1.count(); ++i) { | 87 for (int i = 0; i < config1.count(); ++i) { |
89 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); | 88 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); |
90 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == 0); | 89 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == 0); |
91 } | 90 } |
92 #if SK_SUPPORT_GPU | 91 #if SK_SUPPORT_GPU |
93 REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu()); | 92 REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu()); |
94 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); | 93 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); |
95 REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()); | 94 REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()); |
96 REPORTER_ASSERT(reporter, configs[3]->asConfigGpu()); | 95 REPORTER_ASSERT(reporter, configs[3]->asConfigGpu()); |
(...skipping 15 matching lines...) Expand all Loading... |
112 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getUseNVPR()); | 111 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getUseNVPR()); |
113 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getUseDIText()); | 112 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getUseDIText()); |
114 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getSamples() == 4); | 113 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getSamples() == 4); |
115 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseNVPR()); | 114 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseNVPR()); |
116 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseDIText()); | 115 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseDIText()); |
117 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu()); | 116 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu()); |
118 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu()); | 117 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu()); |
119 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu()); | 118 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu()); |
120 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); | 119 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); |
121 REPORTER_ASSERT(reporter, !configs[24]->asConfigGpu()); | 120 REPORTER_ASSERT(reporter, !configs[24]->asConfigGpu()); |
122 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() == kRGB
A_F16_SkColorType); | 121 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() |
123 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace() == nul
lptr); | 122 == kRGBA_F16_SkColorType); |
124 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() == kN32
_SkColorType); | 123 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getProfileType() |
125 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorSpace() == srg
bColorSpace.get()); | 124 == kLinear_SkColorProfileType); |
126 | 125 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() |
| 126 == kN32_SkColorType); |
| 127 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getProfileType() |
| 128 == kSRGB_SkColorProfileType); |
127 #if SK_ANGLE | 129 #if SK_ANGLE |
128 #ifdef SK_BUILD_FOR_WIN | 130 #ifdef SK_BUILD_FOR_WIN |
129 REPORTER_ASSERT(reporter, configs[20]->asConfigGpu()); | 131 REPORTER_ASSERT(reporter, configs[20]->asConfigGpu()); |
130 #else | 132 #else |
131 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu()); | 133 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu()); |
132 #endif | 134 #endif |
133 REPORTER_ASSERT(reporter, configs[21]->asConfigGpu()); | 135 REPORTER_ASSERT(reporter, configs[21]->asConfigGpu()); |
134 #else | 136 #else |
135 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu()); | 137 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu()); |
136 REPORTER_ASSERT(reporter, !configs[21]->asConfigGpu()); | 138 REPORTER_ASSERT(reporter, !configs[21]->asConfigGpu()); |
(...skipping 11 matching lines...) Expand all Loading... |
148 REPORTER_ASSERT(reporter, configs[27]->asConfigGpu()); | 150 REPORTER_ASSERT(reporter, configs[27]->asConfigGpu()); |
149 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()); | 151 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()); |
150 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getSamples() == 4); | 152 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getSamples() == 4); |
151 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getUseNVPR()); | 153 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getUseNVPR()); |
152 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()); | 154 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()); |
153 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getSamples() == 4); | 155 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getSamples() == 4); |
154 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseNVPR()); | 156 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseNVPR()); |
155 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseDIText()); | 157 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseDIText()); |
156 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()); | 158 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()); |
157 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorType() == kN3
2_SkColorType); | 159 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorType() == kN3
2_SkColorType); |
158 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorSpace() == srg
bColorSpace.get()); | 160 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getProfileType() == |
| 161 kSRGB_SkColorProfileType); |
159 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()); | 162 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()); |
160 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()->getSamples() == 4); | 163 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()->getSamples() == 4); |
161 #ifdef SK_VULKAN | 164 #ifdef SK_VULKAN |
162 REPORTER_ASSERT(reporter, configs[32]->asConfigGpu()); | 165 REPORTER_ASSERT(reporter, configs[32]->asConfigGpu()); |
163 #endif | 166 #endif |
164 #endif | 167 #endif |
165 } | 168 } |
166 | 169 |
167 DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { | 170 DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { |
168 SkCommandLineFlags::StringArray config1 = make_string_array({ | 171 SkCommandLineFlags::StringArray config1 = make_string_array({ |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 REPORTER_ASSERT(reporter, | 359 REPORTER_ASSERT(reporter, |
357 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); | 360 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); |
358 } | 361 } |
359 } | 362 } |
360 #if SK_SUPPORT_GPU | 363 #if SK_SUPPORT_GPU |
361 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 364 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
362 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); | 365 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); |
363 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); | 366 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); |
364 #endif | 367 #endif |
365 } | 368 } |
OLD | NEW |