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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("8888")); | 62 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("8888")); |
63 } | 63 } |
64 | 64 |
65 DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { | 65 DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { |
66 // Parses all default configs and returns correct "tag". | 66 // Parses all default configs and returns correct "tag". |
67 | 67 |
68 SkCommandLineFlags::StringArray config1 = make_string_array({ | 68 SkCommandLineFlags::StringArray config1 = make_string_array({ |
69 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16"
, "msaa4", | 69 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16"
, "msaa4", |
70 "nonrendering", "null", "nullgpu", "nvprmsaa16", "nvprmsaa4", "pdf", "pd
f_poppler", | 70 "nonrendering", "null", "nullgpu", "nvprmsaa16", "nvprmsaa4", "pdf", "pd
f_poppler", |
71 "skp", "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui
", | 71 "skp", "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui
", |
72 "gpuf16", "gpusrgb", "anglesrgb" | 72 "gpuf16", "gpusrgb" |
73 }); | 73 }); |
74 | 74 |
75 SkCommandLineConfigArray configs; | 75 SkCommandLineConfigArray configs; |
76 ParseConfigs(config1, &configs); | 76 ParseConfigs(config1, &configs); |
77 | 77 |
78 REPORTER_ASSERT(reporter, configs.count() == config1.count()); | 78 REPORTER_ASSERT(reporter, configs.count() == config1.count()); |
79 for (int i = 0; i < config1.count(); ++i) { | 79 for (int i = 0; i < config1.count(); ++i) { |
80 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); | 80 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); |
81 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == 0); | 81 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == 0); |
82 } | 82 } |
(...skipping 26 matching lines...) Expand all Loading... |
109 == kRGBA_F16_SkColorType); | 109 == kRGBA_F16_SkColorType); |
110 REPORTER_ASSERT(reporter, configs[24]->asConfigGpu()->getProfileType() | 110 REPORTER_ASSERT(reporter, configs[24]->asConfigGpu()->getProfileType() |
111 == kLinear_SkColorProfileType); | 111 == kLinear_SkColorProfileType); |
112 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() | 112 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() |
113 == kN32_SkColorType); | 113 == kN32_SkColorType); |
114 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getProfileType() | 114 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getProfileType() |
115 == kSRGB_SkColorProfileType); | 115 == kSRGB_SkColorProfileType); |
116 #if SK_ANGLE | 116 #if SK_ANGLE |
117 #ifdef SK_BUILD_FOR_WIN | 117 #ifdef SK_BUILD_FOR_WIN |
118 REPORTER_ASSERT(reporter, configs[19]->asConfigGpu()); | 118 REPORTER_ASSERT(reporter, configs[19]->asConfigGpu()); |
119 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getProfileType() | |
120 == kSRGB_SkColorProfileType); | |
121 #else | 119 #else |
122 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); | 120 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); |
123 REPORTER_ASSERT(reporter, !configs[26]->asConfigGpu()); | |
124 #endif | 121 #endif |
125 REPORTER_ASSERT(reporter, configs[20]->asConfigGpu()); | 122 REPORTER_ASSERT(reporter, configs[20]->asConfigGpu()); |
126 #else | 123 #else |
127 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); | 124 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu()); |
128 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu()); | 125 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu()); |
129 #endif | 126 #endif |
130 #if SK_COMMAND_BUFFER | 127 #if SK_COMMAND_BUFFER |
131 REPORTER_ASSERT(reporter, configs[21]->asConfigGpu()); | 128 REPORTER_ASSERT(reporter, configs[21]->asConfigGpu()); |
132 #else | 129 #else |
133 REPORTER_ASSERT(reporter, !configs[21]->asConfigGpu()); | 130 REPORTER_ASSERT(reporter, !configs[21]->asConfigGpu()); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 REPORTER_ASSERT(reporter, | 319 REPORTER_ASSERT(reporter, |
323 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); | 320 configs[i]->getViaParts()[j].equals(expectedConfigs[
i].vias[j])); |
324 } | 321 } |
325 } | 322 } |
326 #if SK_SUPPORT_GPU | 323 #if SK_SUPPORT_GPU |
327 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); | 324 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); |
328 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); | 325 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); |
329 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); | 326 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); |
330 #endif | 327 #endif |
331 } | 328 } |
OLD | NEW |