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 "SkColorSpace.h" | 9 #include "SkColorSpace_Base.h" |
10 #include "Test.h" | 10 #include "Test.h" |
11 #include <initializer_list> | 11 #include <initializer_list> |
12 | 12 |
13 using sk_gpu_test::GrContextFactory; | 13 using sk_gpu_test::GrContextFactory; |
14 | 14 |
15 namespace { | 15 namespace { |
16 // The code | 16 // The code |
17 // SkCommandLineFlags::StringArray FLAGS_config1 = make_string_array({"a", "b"
}) | 17 // SkCommandLineFlags::StringArray FLAGS_config1 = make_string_array({"a", "b"
}) |
18 // can be used to construct string array that one gets with command line flags. | 18 // can be used to construct string array that one gets with command line flags. |
19 // For example, the call above is equivalent of | 19 // For example, the call above is equivalent of |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseNVPR()); | 118 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseNVPR()); |
119 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseDIText()); | 119 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseDIText()); |
120 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu()); | 120 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu()); |
121 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu()); | 121 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu()); |
122 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu()); | 122 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu()); |
123 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); | 123 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); |
124 REPORTER_ASSERT(reporter, !configs[24]->asConfigGpu()); | 124 REPORTER_ASSERT(reporter, !configs[24]->asConfigGpu()); |
125 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() == kRGB
A_F16_SkColorType); | 125 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() == kRGB
A_F16_SkColorType); |
126 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace()); | 126 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace()); |
127 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace()->gamma
IsLinear()); | 127 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace()->gamma
IsLinear()); |
128 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace()->toXYZ
D50() == | 128 REPORTER_ASSERT(reporter, as_CSB(configs[25]->asConfigGpu()->getColorSpace()
)->toXYZD50() == |
129 srgbColorSpace->toXYZD50()); | 129 as_CSB(srgbColorSpace)->toXYZD50()); |
130 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() == kRGB
A_8888_SkColorType); | 130 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() == kRGB
A_8888_SkColorType); |
131 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorSpace() == srg
bColorSpace.get()); | 131 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorSpace() == srg
bColorSpace.get()); |
132 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorType() == kRGB
A_F16_SkColorType); | 132 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorType() == kRGB
A_F16_SkColorType); |
133 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()); | 133 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()); |
134 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->gamma
IsLinear()); | 134 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->gamma
IsLinear()); |
135 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->toXYZ
D50() != | 135 REPORTER_ASSERT(reporter, as_CSB(configs[41]->asConfigGpu()->getColorSpace()
)->toXYZD50() != |
136 srgbColorSpace->toXYZD50()); | 136 as_CSB(srgbColorSpace)->toXYZD50()); |
137 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() == | 137 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() == |
138 GrContextFactory::kGL_ContextType); | 138 GrContextFactory::kGL_ContextType); |
139 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getUseInstanced()); | 139 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getUseInstanced()); |
140 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getContextType() == | 140 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getContextType() == |
141 GrContextFactory::kGL_ContextType); | 141 GrContextFactory::kGL_ContextType); |
142 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getUseInstanced()); | 142 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getUseInstanced()); |
143 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getSamples() == 4); | 143 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getSamples() == 4); |
144 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getContextType() == | 144 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getContextType() == |
145 GrContextFactory::kGL_ContextType); | 145 GrContextFactory::kGL_ContextType); |
146 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getUseInstanced()); | 146 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getUseInstanced()); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 REPORTER_ASSERT(reporter, | 396 REPORTER_ASSERT(reporter, |
397 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); | 397 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); |
398 } | 398 } |
399 } | 399 } |
400 #if SK_SUPPORT_GPU | 400 #if SK_SUPPORT_GPU |
401 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 401 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
402 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); | 402 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); |
403 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); | 403 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); |
404 #endif | 404 #endif |
405 } | 405 } |
OLD | NEW |