| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { | 74 DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { |
| 75 // Parses all default configs and returns correct "tag". | 75 // Parses all default configs and returns correct "tag". |
| 76 | 76 |
| 77 SkCommandLineFlags::StringArray config1 = make_string_array({ | 77 SkCommandLineFlags::StringArray config1 = make_string_array({ |
| 78 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16"
, "msaa4", | 78 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16"
, "msaa4", |
| 79 "nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvpr
dit4", "pdf", "skp", | 79 "nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvpr
dit4", "pdf", "skp", |
| 80 "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui", "gpu
f16", "gpusrgb", | 80 "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui", "gpu
f16", "gpusrgb", |
| 81 "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk", "glinst", "gli
nst4", "glinstdit4", | 81 "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk", "glinst", "gli
nst4", "glinstdit4", |
| 82 "glinst16", "glinstdit16", "esinst", "esinst4", "esinstdit4" | 82 "glinst16", "glinstdit16", "esinst", "esinst4", "esinstdit4", "glwide" |
| 83 }); | 83 }); |
| 84 | 84 |
| 85 SkCommandLineConfigArray configs; | 85 SkCommandLineConfigArray configs; |
| 86 ParseConfigs(config1, &configs); | 86 ParseConfigs(config1, &configs); |
| 87 | 87 |
| 88 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 88 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
| 89 | 89 |
| 90 REPORTER_ASSERT(reporter, configs.count() == config1.count()); | 90 REPORTER_ASSERT(reporter, configs.count() == config1.count()); |
| 91 for (int i = 0; i < config1.count(); ++i) { | 91 for (int i = 0; i < config1.count(); ++i) { |
| 92 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); | 92 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 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() == kN32
_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); |
| 133 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()); |
| 134 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->gamma
IsLinear()); |
| 135 REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->toXYZ
D50() != |
| 136 srgbColorSpace->toXYZD50()); |
| 132 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() == | 137 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() == |
| 133 GrContextFactory::kGL_ContextType); | 138 GrContextFactory::kGL_ContextType); |
| 134 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getUseInstanced()); | 139 REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getUseInstanced()); |
| 135 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getContextType() == | 140 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getContextType() == |
| 136 GrContextFactory::kGL_ContextType); | 141 GrContextFactory::kGL_ContextType); |
| 137 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getUseInstanced()); | 142 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getUseInstanced()); |
| 138 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getSamples() == 4); | 143 REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getSamples() == 4); |
| 139 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getContextType() == | 144 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getContextType() == |
| 140 GrContextFactory::kGL_ContextType); | 145 GrContextFactory::kGL_ContextType); |
| 141 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getUseInstanced()); | 146 REPORTER_ASSERT(reporter, configs[35]->asConfigGpu()->getUseInstanced()); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 REPORTER_ASSERT(reporter, | 404 REPORTER_ASSERT(reporter, |
| 400 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); | 405 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); |
| 401 } | 406 } |
| 402 } | 407 } |
| 403 #if SK_SUPPORT_GPU | 408 #if SK_SUPPORT_GPU |
| 404 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 409 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
| 405 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); | 410 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); |
| 406 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); | 411 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); |
| 407 #endif | 412 #endif |
| 408 } | 413 } |
| OLD | NEW |