blob: 4d5ebf6390d660efab49bdea0957c316888d2b17 [file] [log] [blame]
kkinnunen3e980c32015-12-23 01:33:00 -08001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "SkCommonFlagsConfig.h"
brianosmanb6095ae2016-06-16 13:32:51 -07009#include "SkColorSpace.h"
kkinnunen3e980c32015-12-23 01:33:00 -080010#include "Test.h"
11#include <initializer_list>
12
bsalomon3724e572016-03-30 18:56:19 -070013using sk_gpu_test::GrContextFactory;
14
kkinnunen3e980c32015-12-23 01:33:00 -080015namespace {
16// The code
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.
19// For example, the call above is equivalent of
20// DEFINE_string(config1, "a b", "");
21// in cases where the default command line flag value ("a b") is used.
22// make_string_array can be used to construct StringArray strings that have spaces in
23// them.
24SkCommandLineFlags::StringArray make_string_array(std::initializer_list<const char*> strings) {
25 SkTArray<SkString> array;
26 for (auto& s : strings) {
27 array.push_back(SkString(s));
28 }
29 return SkCommandLineFlags::StringArray(array);
30}
31}
32DEF_TEST(ParseConfigs_Gpu, reporter) {
33 // Parses a normal config and returns correct "tag".
34 // Gpu config defaults work.
35 SkCommandLineFlags::StringArray config1 = make_string_array({"gpu"});
36 SkCommandLineConfigArray configs;
37 ParseConfigs(config1, &configs);
38
39 REPORTER_ASSERT(reporter, configs.count() == 1);
40 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu"));
41 REPORTER_ASSERT(reporter, configs[0]->getViaParts().count() == 0);
42#if SK_SUPPORT_GPU
43 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
44 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType()
bsalomon85b4b532016-04-05 11:06:27 -070045 == GrContextFactory::kNativeGL_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -080046 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR() == false);
47 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText() == false);
48 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0);
brianosmand93c1202016-03-10 07:49:08 -080049 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorType() == kN32_SkColorType);
brianosmanb109b8c2016-06-16 13:03:24 -070050 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorSpace() == nullptr);
kkinnunen3e980c32015-12-23 01:33:00 -080051#endif
52}
53
54DEF_TEST(ParseConfigs_OutParam, reporter) {
55 // Clears the out parameter.
56 SkCommandLineFlags::StringArray config1 = make_string_array({"gpu"});
57 SkCommandLineConfigArray configs;
58 ParseConfigs(config1, &configs);
59 REPORTER_ASSERT(reporter, configs.count() == 1);
60 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gpu"));
bsalomonb8797bb2016-04-05 08:49:38 -070061
kkinnunen3e980c32015-12-23 01:33:00 -080062 SkCommandLineFlags::StringArray config2 = make_string_array({"8888"});
63 ParseConfigs(config2, &configs);
64 REPORTER_ASSERT(reporter, configs.count() == 1);
65 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("8888"));
bsalomonb8797bb2016-04-05 08:49:38 -070066
67 SkCommandLineFlags::StringArray config3 = make_string_array({"gl"});
68 ParseConfigs(config3, &configs);
69 REPORTER_ASSERT(reporter, configs.count() == 1);
70 REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gl"));
kkinnunen3e980c32015-12-23 01:33:00 -080071}
72
73DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
74 // Parses all default configs and returns correct "tag".
75
76 SkCommandLineFlags::StringArray config1 = make_string_array({
77 "565", "8888", "debug", "gpu", "gpudebug", "gpudft", "gpunull", "msaa16", "msaa4",
cdaltonc28afdb2016-03-29 20:05:07 -070078 "nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvprdit4", "pdf",
halcanary94b87bd2016-04-04 06:12:15 -070079 "skp", "svg", "xps", "angle", "angle-gl", "commandbuffer", "mesa", "hwui",
bsalomondc0fcd42016-04-11 14:21:33 -070080 "gpuf16", "gpusrgb", "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk"
kkinnunen3e980c32015-12-23 01:33:00 -080081 });
82
83 SkCommandLineConfigArray configs;
84 ParseConfigs(config1, &configs);
85
brianosmanb109b8c2016-06-16 13:03:24 -070086 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
87
kkinnunen3e980c32015-12-23 01:33:00 -080088 REPORTER_ASSERT(reporter, configs.count() == config1.count());
89 for (int i = 0; i < config1.count(); ++i) {
90 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
91 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == 0);
92 }
93#if SK_SUPPORT_GPU
94 REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu());
95 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
96 REPORTER_ASSERT(reporter, configs[2]->asConfigGpu());
97 REPORTER_ASSERT(reporter, configs[3]->asConfigGpu());
98 REPORTER_ASSERT(reporter, configs[4]->asConfigGpu());
99 REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getUseDIText());
100 REPORTER_ASSERT(reporter, configs[6]->asConfigGpu());
101 REPORTER_ASSERT(reporter, configs[7]->asConfigGpu()->getSamples() == 16);
102 REPORTER_ASSERT(reporter, configs[8]->asConfigGpu()->getSamples() == 4);
103 REPORTER_ASSERT(reporter, !configs[9]->asConfigGpu());
104 REPORTER_ASSERT(reporter, !configs[10]->asConfigGpu());
105 REPORTER_ASSERT(reporter, configs[11]->asConfigGpu());
106 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getSamples() == 16);
107 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getUseNVPR());
cdaltonc28afdb2016-03-29 20:05:07 -0700108 REPORTER_ASSERT(reporter, !configs[12]->asConfigGpu()->getUseDIText());
kkinnunen3e980c32015-12-23 01:33:00 -0800109 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getSamples() == 4);
110 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getUseNVPR());
cdaltonc28afdb2016-03-29 20:05:07 -0700111 REPORTER_ASSERT(reporter, !configs[13]->asConfigGpu()->getUseDIText());
112 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getSamples() == 16);
113 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getUseNVPR());
114 REPORTER_ASSERT(reporter, configs[14]->asConfigGpu()->getUseDIText());
115 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getSamples() == 4);
116 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseNVPR());
117 REPORTER_ASSERT(reporter, configs[15]->asConfigGpu()->getUseDIText());
kkinnunen3e980c32015-12-23 01:33:00 -0800118 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu());
119 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu());
120 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu());
cdaltonc28afdb2016-03-29 20:05:07 -0700121 REPORTER_ASSERT(reporter, !configs[19]->asConfigGpu());
halcanary3c4521a2016-04-04 12:14:46 -0700122 REPORTER_ASSERT(reporter, !configs[24]->asConfigGpu());
brianosmanb109b8c2016-06-16 13:03:24 -0700123 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() == kRGBA_F16_SkColorType);
124 REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace() == nullptr);
125 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() == kN32_SkColorType);
126 REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorSpace() == srgbColorSpace.get());
127
kkinnunen3e980c32015-12-23 01:33:00 -0800128#if SK_ANGLE
129#ifdef SK_BUILD_FOR_WIN
halcanary3c4521a2016-04-04 12:14:46 -0700130 REPORTER_ASSERT(reporter, configs[20]->asConfigGpu());
131#else
132 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu());
133#endif
kkinnunen3e980c32015-12-23 01:33:00 -0800134 REPORTER_ASSERT(reporter, configs[21]->asConfigGpu());
135#else
halcanary3c4521a2016-04-04 12:14:46 -0700136 REPORTER_ASSERT(reporter, !configs[20]->asConfigGpu());
kkinnunen3e980c32015-12-23 01:33:00 -0800137 REPORTER_ASSERT(reporter, !configs[21]->asConfigGpu());
138#endif
cdaltonc28afdb2016-03-29 20:05:07 -0700139#if SK_COMMAND_BUFFER
halcanary3c4521a2016-04-04 12:14:46 -0700140 REPORTER_ASSERT(reporter, configs[22]->asConfigGpu());
141#else
142 REPORTER_ASSERT(reporter, !configs[22]->asConfigGpu());
143#endif
144#if SK_MESA
cdaltonc28afdb2016-03-29 20:05:07 -0700145 REPORTER_ASSERT(reporter, configs[23]->asConfigGpu());
146#else
147 REPORTER_ASSERT(reporter, !configs[23]->asConfigGpu());
148#endif
bsalomonb8797bb2016-04-05 08:49:38 -0700149 REPORTER_ASSERT(reporter, configs[27]->asConfigGpu());
150 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu());
151 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getSamples() == 4);
152 REPORTER_ASSERT(reporter, configs[28]->asConfigGpu()->getUseNVPR());
153 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu());
154 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getSamples() == 4);
155 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseNVPR());
156 REPORTER_ASSERT(reporter, configs[29]->asConfigGpu()->getUseDIText());
157 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu());
158 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorType() == kN32_SkColorType);
brianosmanb109b8c2016-06-16 13:03:24 -0700159 REPORTER_ASSERT(reporter, configs[30]->asConfigGpu()->getColorSpace() == srgbColorSpace.get());
bsalomonb8797bb2016-04-05 08:49:38 -0700160 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu());
161 REPORTER_ASSERT(reporter, configs[31]->asConfigGpu()->getSamples() == 4);
bsalomondc0fcd42016-04-11 14:21:33 -0700162#ifdef SK_VULKAN
163 REPORTER_ASSERT(reporter, configs[32]->asConfigGpu());
164#endif
kkinnunen3e980c32015-12-23 01:33:00 -0800165#endif
166}
167
168DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) {
169 SkCommandLineFlags::StringArray config1 = make_string_array({
kkinnunene3c2f802015-12-29 08:57:32 -0800170 "gpu(nvpr=true,dit=false)",
kkinnunen3e980c32015-12-23 01:33:00 -0800171 "gpu(api=angle)",
172 "gpu(api=angle-gl)",
173 "gpu(api=mesa,samples=77)",
174 "gpu(dit=true,api=commandbuffer)",
175 "gpu()",
bsalomonb8797bb2016-04-05 08:49:38 -0700176 "gpu(api=gles)",
bsalomondc0fcd42016-04-11 14:21:33 -0700177 "gpu(api=gl)",
178 "gpu(api=vulkan)",
kkinnunen3e980c32015-12-23 01:33:00 -0800179 });
180
181 SkCommandLineConfigArray configs;
182 ParseConfigs(config1, &configs);
183 REPORTER_ASSERT(reporter, configs.count() == config1.count());
184 for (int i = 0; i < config1.count(); ++i) {
185 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
186 }
187#if SK_SUPPORT_GPU
188 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700189 GrContextFactory::kNativeGL_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800190 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR());
kkinnunene3c2f802015-12-29 08:57:32 -0800191 REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu()->getUseDIText());
kkinnunen3e980c32015-12-23 01:33:00 -0800192 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0);
193#if SK_ANGLE
194#ifdef SK_BUILD_FOR_WIN
195 REPORTER_ASSERT(reporter, configs[1]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700196 GrContextFactory::kANGLE_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800197#else
198 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
199#endif
200 REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700201 GrContextFactory::kANGLE_GL_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800202#else
203 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
204 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
205#endif
206#if SK_MESA
207 REPORTER_ASSERT(reporter, configs[3]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700208 GrContextFactory::kMESA_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800209#else
210 REPORTER_ASSERT(reporter, !configs[3]->asConfigGpu());
211#endif
212#if SK_COMMAND_BUFFER
213 REPORTER_ASSERT(reporter, configs[4]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700214 GrContextFactory::kCommandBuffer_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800215
216#else
217 REPORTER_ASSERT(reporter, !configs[4]->asConfigGpu());
218#endif
219 REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700220 GrContextFactory::kNativeGL_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800221 REPORTER_ASSERT(reporter, !configs[5]->asConfigGpu()->getUseNVPR());
222 REPORTER_ASSERT(reporter, !configs[5]->asConfigGpu()->getUseDIText());
223 REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getSamples() == 0);
224 REPORTER_ASSERT(reporter, configs[6]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700225 GrContextFactory::kGLES_ContextType);
kkinnunen3e980c32015-12-23 01:33:00 -0800226 REPORTER_ASSERT(reporter, !configs[6]->asConfigGpu()->getUseNVPR());
227 REPORTER_ASSERT(reporter, !configs[6]->asConfigGpu()->getUseDIText());
228 REPORTER_ASSERT(reporter, configs[6]->asConfigGpu()->getSamples() == 0);
bsalomonb8797bb2016-04-05 08:49:38 -0700229 REPORTER_ASSERT(reporter, configs[7]->asConfigGpu()->getContextType() ==
bsalomon85b4b532016-04-05 11:06:27 -0700230 GrContextFactory::kGL_ContextType);
bsalomonb8797bb2016-04-05 08:49:38 -0700231 REPORTER_ASSERT(reporter, !configs[7]->asConfigGpu()->getUseNVPR());
232 REPORTER_ASSERT(reporter, !configs[7]->asConfigGpu()->getUseDIText());
233 REPORTER_ASSERT(reporter, configs[7]->asConfigGpu()->getSamples() == 0);
bsalomondc0fcd42016-04-11 14:21:33 -0700234#ifdef SK_VULKAN
235 REPORTER_ASSERT(reporter, configs[8]->asConfigGpu()->getContextType() ==
236 GrContextFactory::kVulkan_ContextType);
237 REPORTER_ASSERT(reporter, !configs[7]->asConfigGpu()->getUseNVPR());
238 REPORTER_ASSERT(reporter, !configs[7]->asConfigGpu()->getUseDIText());
239 REPORTER_ASSERT(reporter, configs[7]->asConfigGpu()->getSamples() == 0);
240#endif
kkinnunen3e980c32015-12-23 01:33:00 -0800241#endif
242}
243
244DEF_TEST(ParseConfigs_ExtendedGpuConfigsIncorrect, reporter) {
245 SkCommandLineFlags::StringArray config1 = make_string_array({
246 "gpu(nvpr=1)", // Number as bool.
247 "gpu(api=gl,)", // Trailing in comma.
248 "gpu(api=angle-glu)", // Unknown api.
249 "gpu(api=,samples=0)", // Empty api.
250 "gpu(samples=true)", // Value true as a number.
251 "gpu(samples=0,samples=0)", // Duplicate option key.
252 "gpu(,samples=0)", // Leading comma.
253 "gpu(samples=54", // Missing closing parenthesis.
254 ",,",
255 "gpu(", // Missing parenthesis.
256 "samples=54" // No backend.
257 "gpu(nvpr=true )", // Space.
258 });
259
260 SkCommandLineConfigArray configs;
261 ParseConfigs(config1, &configs);
262 REPORTER_ASSERT(reporter, configs.count() == config1.count());
263 for (int i = 0; i < config1.count(); ++i) {
264 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
265 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(config1[i]));
266#if SK_SUPPORT_GPU
267 REPORTER_ASSERT(reporter, !configs[i]->asConfigGpu());
268#endif
269 }
270}
271
kkinnunen3e980c32015-12-23 01:33:00 -0800272DEF_TEST(ParseConfigs_ExtendedGpuConfigsSurprises, reporter) {
273 // These just list explicitly some properties of the system.
274 SkCommandLineFlags::StringArray config1 = make_string_array({
275 // Options are not canonized -> two same configs have a different tag.
276 "gpu(nvpr=true,dit=true)", "gpu(dit=true,nvpr=true)",
bsalomon85b4b532016-04-05 11:06:27 -0700277 "gpu(api=debug)", "gpu(api=gl)", "gpu(api=gles)", ""
278 "gpu", "gpu()", "gpu(samples=0)", "gpu(api=gles,samples=0)"
kkinnunen3e980c32015-12-23 01:33:00 -0800279 });
280 SkCommandLineConfigArray configs;
281 ParseConfigs(config1, &configs);
282 REPORTER_ASSERT(reporter, configs.count() == config1.count());
283 for (int i = 0; i < config1.count(); ++i) {
284 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
285#if SK_SUPPORT_GPU
286 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals("gpu"));
287 REPORTER_ASSERT(reporter, configs[i]->asConfigGpu());
288#else
289 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(config1[i]));
290#endif
291 }
292}
293DEF_TEST(ParseConfigs_ViaParsing, reporter) {
294 SkCommandLineFlags::StringArray config1 = make_string_array({
295 "a-b-c-8888",
296 "zz-qq-gpu",
297 "a-angle-gl"
298 });
299
300 SkCommandLineConfigArray configs;
301 ParseConfigs(config1, &configs);
302 const struct {
303 const char* backend;
304 const char* vias[3];
305 } expectedConfigs[] = {
306 {"8888", {"a", "b", "c"}},
307 {"gpu", {"zz", "qq", nullptr}},
308 {"angle-gl", {"a", nullptr, nullptr}} // The angle-gl tag is only tag that contains
309 // hyphen.
310 };
311 for (int i = 0; i < config1.count(); ++i) {
312 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
313 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(expectedConfigs[i].backend));
314 for (int j = 0; j < static_cast<int>(SK_ARRAY_COUNT(expectedConfigs[i].vias)); ++j) {
315 if (!expectedConfigs[i].vias[j]) {
316 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == j);
317 break;
318 }
319 REPORTER_ASSERT(reporter,
320 configs[i]->getViaParts()[j].equals(expectedConfigs[i].vias[j]));
321 }
322 }
323}
324
325DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) {
326 SkCommandLineFlags::StringArray config1 = make_string_array({
327 "zz-qq-gpu(api=gles)",
328 "a-gpu(samples=1",
329 "abc-def-angle-gl(samples=1)",
330 });
331
332 SkCommandLineConfigArray configs;
333 ParseConfigs(config1, &configs);
334 const struct {
335 const char* backend;
336 const char* vias[3];
337 } expectedConfigs[] = {
338#if SK_SUPPORT_GPU
339 {"gpu", {"zz", "qq", nullptr}},
340#else
341 {"gpu(api=gles)", {"zz", "qq", nullptr}},
342#endif
343 {"gpu(samples=1", {"a", nullptr, nullptr}}, // This is not extended form, but via still
344 // works as expected.
345 {"gl(samples=1)", {"abc", "def", "angle"}} // This is not extended form. Also
346 // angle-gl is not a "backend" in this case.
347 };
348 for (int i = 0; i < config1.count(); ++i) {
349 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
350 REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(expectedConfigs[i].backend));
351 for (int j = 0; j < static_cast<int>(SK_ARRAY_COUNT(expectedConfigs[i].vias)); ++j) {
352 if (!expectedConfigs[i].vias[j]) {
353 REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() ==
354 static_cast<int>(j));
355 break;
356 }
357 REPORTER_ASSERT(reporter,
358 configs[i]->getViaParts()[j].equals(expectedConfigs[i].vias[j]));
359 }
360 }
361#if SK_SUPPORT_GPU
362 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
363 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
364 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
365#endif
366}