| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 }); | 298 }); |
| 299 | 299 |
| 300 SkCommandLineConfigArray configs; | 300 SkCommandLineConfigArray configs; |
| 301 ParseConfigs(config1, &configs); | 301 ParseConfigs(config1, &configs); |
| 302 const struct { | 302 const struct { |
| 303 const char* backend; | 303 const char* backend; |
| 304 const char* vias[3]; | 304 const char* vias[3]; |
| 305 } expectedConfigs[] = { | 305 } expectedConfigs[] = { |
| 306 {"8888", {"a", "b", "c"}}, | 306 {"8888", {"a", "b", "c"}}, |
| 307 {"gpu", {"zz", "qq", nullptr}}, | 307 {"gpu", {"zz", "qq", nullptr}}, |
| 308 {"angle-gl", {"a", nullptr, nullptr}} // The angle-gl tag is only tag t
hat contains | 308 #if SK_ANGLE |
| 309 // hyphen. | 309 { "gpu",{ "a", nullptr, nullptr } } // With SK_ANGLE, angle-gl becomes
gpu(api=angle-gl) |
| 310 #else |
| 311 { "angle-gl",{ "a", nullptr, nullptr } } // The angle-gl tag is only ta
g that contains |
| 312 // hyphen. |
| 313 #endif |
| 310 }; | 314 }; |
| 311 for (int i = 0; i < config1.count(); ++i) { | 315 for (int i = 0; i < config1.count(); ++i) { |
| 312 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); | 316 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); |
| 313 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(expectedConfig
s[i].backend)); | 317 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(expectedConfig
s[i].backend)); |
| 314 for (int j = 0; j < static_cast<int>(SK_ARRAY_COUNT(expectedConfigs[i].v
ias)); ++j) { | 318 for (int j = 0; j < static_cast<int>(SK_ARRAY_COUNT(expectedConfigs[i].v
ias)); ++j) { |
| 315 if (!expectedConfigs[i].vias[j]) { | 319 if (!expectedConfigs[i].vias[j]) { |
| 316 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == j
); | 320 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == j
); |
| 317 break; | 321 break; |
| 318 } | 322 } |
| 319 REPORTER_ASSERT(reporter, | 323 REPORTER_ASSERT(reporter, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 REPORTER_ASSERT(reporter, | 361 REPORTER_ASSERT(reporter, |
| 358 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); | 362 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); |
| 359 } | 363 } |
| 360 } | 364 } |
| 361 #if SK_SUPPORT_GPU | 365 #if SK_SUPPORT_GPU |
| 362 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 366 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
| 363 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); | 367 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); |
| 364 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); | 368 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); |
| 365 #endif | 369 #endif |
| 366 } | 370 } |
| OLD | NEW |