| 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.h" |
| 10 #include "Test.h" | 10 #include "Test.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu")); | 40 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu")); |
| 41 REPORTER_ASSERT(reporter, configs[0]->getViaParts().count() == 0); | 41 REPORTER_ASSERT(reporter, configs[0]->getViaParts().count() == 0); |
| 42 #if SK_SUPPORT_GPU | 42 #if SK_SUPPORT_GPU |
| 43 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 43 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
| 44 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() | 44 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() |
| 45 == GrContextFactory::kNativeGL_ContextType); | 45 == GrContextFactory::kNativeGL_ContextType); |
| 46 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR() == false); | 46 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR() == false); |
| 47 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseInstanced() == fa
lse); | 47 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseInstanced() == fa
lse); |
| 48 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText() == false
); | 48 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText() == false
); |
| 49 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0); | 49 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0); |
| 50 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorType() == kN32_
SkColorType); | 50 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorType() == kRGBA
_8888_SkColorType); |
| 51 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorSpace() == null
ptr); | 51 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorSpace() == null
ptr); |
| 52 #endif | 52 #endif |
| 53 } | 53 } |
| 54 | 54 |
| 55 DEF_TEST(ParseConfigs_OutParam, reporter) { | 55 DEF_TEST(ParseConfigs_OutParam, reporter) { |
| 56 // Clears the out parameter. | 56 // Clears the out parameter. |
| 57 SkCommandLineFlags::StringArray config1 = make_string_array({"gpu"}); | 57 SkCommandLineFlags::StringArray config1 = make_string_array({"gpu"}); |
| 58 SkCommandLineConfigArray configs; | 58 SkCommandLineConfigArray configs; |
| 59 ParseConfigs(config1, &configs); | 59 ParseConfigs(config1, &configs); |
| 60 REPORTER_ASSERT(reporter, configs.count() == 1); | 60 REPORTER_ASSERT(reporter, configs.count() == 1); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, configs[25]->asConfigGpu()->getColorSpace()->toXYZ
D50() == |
| 129 srgbColorSpace->toXYZD50()); | 129 srgbColorSpace->toXYZD50()); |
| 130 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() == kN32
_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, configs[41]->asConfigGpu()->getColorSpace()->toXYZ
D50() != |
| 136 srgbColorSpace->toXYZD50()); | 136 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() == |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 #endif | 187 #endif |
| 188 REPORTER_ASSERT(reporter, configs[27]->asConfigGpu()); | 188 REPORTER_ASSERT(reporter, configs[27]->asConfigGpu()); |
| 189 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()); | 189 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()); |
| 190 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getSamples() == 4); | 190 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getSamples() == 4); |
| 191 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getUseNVPR()); | 191 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getUseNVPR()); |
| 192 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()); | 192 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()); |
| 193 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getSamples() == 4); | 193 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getSamples() == 4); |
| 194 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseNVPR()); | 194 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseNVPR()); |
| 195 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseDIText()); | 195 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseDIText()); |
| 196 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()); | 196 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()); |
| 197 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorType() == kN3
2_SkColorType); | 197 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorType() == kRG
BA_8888_SkColorType); |
| 198 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorSpace() == srg
bColorSpace.get()); | 198 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorSpace() == srg
bColorSpace.get()); |
| 199 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()); | 199 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()); |
| 200 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()->getSamples() == 4); | 200 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()->getSamples() == 4); |
| 201 #ifdef SK_VULKAN | 201 #ifdef SK_VULKAN |
| 202 REPORTER_ASSERT(reporter, configs[32]->asConfigGpu()); | 202 REPORTER_ASSERT(reporter, configs[32]->asConfigGpu()); |
| 203 #endif | 203 #endif |
| 204 #endif | 204 #endif |
| 205 } | 205 } |
| 206 | 206 |
| 207 DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { | 207 DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { |
| (...skipping 188 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 |