blob: 0e911402fb41e08da47e03af0c4d9ee327744d21 [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
raftias7c602de2016-10-13 10:45:44 -07008#include "SkColorSpace_Base.h"
kkinnunen3e980c32015-12-23 01:33:00 -08009#include "SkCommonFlagsConfig.h"
csmartdalton6270e552016-09-13 10:41:49 -070010#include "SkImageInfo.h"
kkinnunen3e980c32015-12-23 01:33:00 -080011
12#include <stdlib.h>
13
bsalomon3724e572016-03-30 18:56:19 -070014#if SK_SUPPORT_GPU
15using sk_gpu_test::GrContextFactory;
16#endif
17
kkinnunen3e980c32015-12-23 01:33:00 -080018static const char defaultConfigs[] =
mtklein896ddb72016-09-14 10:33:12 -070019 "8888 gpu nonrendering"
bsalomon11abd8d2016-10-14 08:13:48 -070020#if defined(SK_BUILD_FOR_WIN)
21 " angle_d3d11_es2"
kkinnunen3e980c32015-12-23 01:33:00 -080022#endif
23#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
24 " hwui"
25#endif
26 ;
27
brianosman37e23342016-09-20 08:06:30 -070028static const struct {
29 const char* predefinedConfig;
30 const char* backend;
31 const char* options;
32} gPredefinedConfigs[] ={
33#if SK_SUPPORT_GPU
bsalomon11abd8d2016-10-14 08:13:48 -070034 { "gpu", "gpu", "" },
35 { "gl", "gpu", "api=gl" },
36 { "msaa4", "gpu", "samples=4" },
37 { "glmsaa4", "gpu", "api=gl,samples=4" },
38 { "msaa16", "gpu", "samples=16" },
39 { "nvpr4", "gpu", "nvpr=true,samples=4" },
40 { "glnvpr4", "gpu", "api=gl,nvpr=true,samples=4" },
41 { "nvpr16", "gpu", "nvpr=true,samples=16" },
42 { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" },
43 { "glnvprdit4", "gpu", "api=gl,nvpr=true,samples=4,dit=true" },
44 { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" },
45 { "glinst", "gpu", "api=gl,inst=true" },
46 { "glinst4", "gpu", "api=gl,inst=true,samples=4" },
47 { "glinstdit4", "gpu", "api=gl,inst=true,samples=4,dit=true" },
48 { "glinst16", "gpu", "api=gl,inst=true,samples=16" },
49 { "glinstdit16", "gpu", "api=gl,inst=true,samples=16,dit=true" },
50 { "esinst", "gpu", "api=gles,inst=true" },
51 { "esinst4", "gpu", "api=gles,inst=true,samples=4" },
52 { "esinstdit4", "gpu", "api=gles,inst=true,samples=4,dit=true" },
53 { "gpuf16", "gpu", "color=f16" },
54 { "gpusrgb", "gpu", "color=srgb" },
55 { "glsrgb", "gpu", "api=gl,color=srgb" },
56 { "glwide", "gpu", "api=gl,color=f16_wide" },
57 { "gpudft", "gpu", "dit=true" },
58 { "gpudebug", "gpu", "api=debug" },
59 { "gpunull", "gpu", "api=null" },
60 { "debug", "gpu", "api=debug" },
61 { "nullgpu", "gpu", "api=null" },
62 { "angle_d3d11_es2", "gpu", "api=angle_d3d11_es2" },
63 { "angle_gl_es2", "gpu", "api=angle_gl_es2" },
64 { "commandbuffer", "gpu", "api=commandbuffer" }
kkinnunen3e980c32015-12-23 01:33:00 -080065#if SK_MESA
bsalomon11abd8d2016-10-14 08:13:48 -070066 ,{ "mesa", "gpu", "api=mesa" }
kkinnunen3e980c32015-12-23 01:33:00 -080067#endif
brianosman37e23342016-09-20 08:06:30 -070068#ifdef SK_VULKAN
bsalomon11abd8d2016-10-14 08:13:48 -070069 ,{ "vk", "gpu", "api=vulkan" }
70 ,{ "vksrgb", "gpu", "api=vulkan,color=srgb" }
71 ,{ "vkwide", "gpu", "api=vulkan,color=f16_wide" }
72 ,{ "vkmsaa4", "gpu", "api=vulkan,samples=4" }
73 ,{ "vkmsaa16", "gpu", "api=vulkan,samples=16" }
brianosman37e23342016-09-20 08:06:30 -070074#endif
75
76#else
77{ "", "", "" }
78#endif
79};
80
81static const char configHelp[] =
82 "Options: 565 8888 srgb f16 nonrendering null pdf pdfa skp pipe svg xps"
kkinnunen3e980c32015-12-23 01:33:00 -080083#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
84 " hwui"
85#endif
brianosman37e23342016-09-20 08:06:30 -070086 ;
87
88static const char* config_help_fn() {
89 static SkString helpString;
90 helpString.set(configHelp);
91 for (const auto& config : gPredefinedConfigs) {
92 helpString.appendf(" %s", config.predefinedConfig);
93 }
bsalomon808ecbb2016-09-28 12:40:22 -070094 helpString.append(" or use extended form 'backend[option=value,...]'.\n");
brianosman37e23342016-09-20 08:06:30 -070095 return helpString.c_str();
96}
kkinnunen3e980c32015-12-23 01:33:00 -080097
98static const char configExtendedHelp[] =
99 "Extended form: 'backend(option=value,...)'\n\n"
100 "Possible backends and options:\n"
101#if SK_SUPPORT_GPU
102 "\n"
bsalomon808ecbb2016-09-28 12:40:22 -0700103 "gpu[api=string,color=string,dit=bool,nvpr=bool,inst=bool,samples=int]\n"
kkinnunen3e980c32015-12-23 01:33:00 -0800104 "\tapi\ttype: string\tdefault: native.\n"
105 "\t Select graphics API to use with gpu backend.\n"
106 "\t Options:\n"
107 "\t\tnative\t\t\tUse platform default OpenGL or OpenGL ES backend.\n"
108 "\t\tgl \t\t\tUse OpenGL.\n"
109 "\t\tgles \t\t\tUse OpenGL ES.\n"
110 "\t\tdebug \t\t\tUse debug OpenGL.\n"
111 "\t\tnull \t\t\tUse null OpenGL.\n"
bsalomon11abd8d2016-10-14 08:13:48 -0700112 "\t\tangle_d3d9_es2\t\t\tUse OpenGL ES2 on the ANGLE Direct3D9 backend.\n"
113 "\t\tangle_d3d11_es2\t\t\tUse OpenGL ES2 on the ANGLE Direct3D11 backend.\n"
114 "\t\tangle_d3d11_es3\t\t\tUse OpenGL ES3 on the ANGLE Direct3D11 backend.\n"
115 "\t\tangle_gl_es2\t\t\tUse OpenGL ES2 on the ANGLE OpenGL backend.\n"
116 "\t\tangle_gl_es3\t\t\tUse OpenGL ES3 on the ANGLE OpenGL backend.\n"
kkinnunen3e980c32015-12-23 01:33:00 -0800117 "\t\tcommandbuffer\t\tUse command buffer.\n"
kkinnunen3e980c32015-12-23 01:33:00 -0800118#if SK_MESA
119 "\t\tmesa\t\t\tUse MESA.\n"
120#endif
bsalomondc0fcd42016-04-11 14:21:33 -0700121#ifdef SK_VULKAN
122 "\t\tvulkan\t\t\tUse Vulkan.\n"
123#endif
brianosmand93c1202016-03-10 07:49:08 -0800124 "\tcolor\ttype: string\tdefault: 8888.\n"
125 "\t Select framebuffer color format.\n"
126 "\t Options:\n"
127 "\t\t8888\t\t\tLinear 8888.\n"
brianosman4562f6e2016-09-19 14:42:04 -0700128 "\t\tf16{_gamut}\t\tLinear 16-bit floating point.\n"
129 "\t\tsrgb{_gamut}\t\tsRGB 8888.\n"
130 "\t gamut\ttype: string\tdefault: srgb.\n"
131 "\t Select color gamut for f16 or sRGB format buffers.\n"
132 "\t Options:\n"
133 "\t\tsrgb\t\t\tsRGB gamut.\n"
134 "\t\twide\t\t\tWide Gamut RGB.\n"
kkinnunen3e980c32015-12-23 01:33:00 -0800135 "\tdit\ttype: bool\tdefault: false.\n"
136 "\t Use device independent text.\n"
137 "\tnvpr\ttype: bool\tdefault: false.\n"
138 "\t Use NV_path_rendering OpenGL and OpenGL ES extension.\n"
139 "\tsamples\ttype: int\tdefault: 0.\n"
140 "\t Use multisampling with N samples.\n"
141 "\n"
142 "Predefined configs:\n\n"
brianosman37e23342016-09-20 08:06:30 -0700143 // Help text for pre-defined configs is auto-generated from gPredefinedConfigs
kkinnunen3e980c32015-12-23 01:33:00 -0800144#endif
145 ;
146
brianosman37e23342016-09-20 08:06:30 -0700147static const char* config_extended_help_fn() {
148 static SkString helpString;
149 helpString.set(configExtendedHelp);
150 for (const auto& config : gPredefinedConfigs) {
151 helpString.appendf("\t%-10s\t= gpu(%s)\n", config.predefinedConfig, config.options);
152 }
153 return helpString.c_str();
154}
kkinnunen3e980c32015-12-23 01:33:00 -0800155
brianosman37e23342016-09-20 08:06:30 -0700156DEFINE_extended_string(config, defaultConfigs, config_help_fn(), config_extended_help_fn());
kkinnunen3e980c32015-12-23 01:33:00 -0800157
158SkCommandLineConfig::SkCommandLineConfig(const SkString& tag, const SkString& backend,
159 const SkTArray<SkString>& viaParts)
160 : fTag(tag)
161 , fBackend(backend)
162 , fViaParts(viaParts) {
163}
164SkCommandLineConfig::~SkCommandLineConfig() {
165}
166
167#if SK_SUPPORT_GPU
168SkCommandLineConfigGpu::SkCommandLineConfigGpu(
csmartdaltone0d36292016-07-29 08:14:20 -0700169 const SkString& tag, const SkTArray<SkString>& viaParts, ContextType contextType, bool useNVPR,
170 bool useInstanced, bool useDIText, int samples, SkColorType colorType,
171 sk_sp<SkColorSpace> colorSpace)
kkinnunen3e980c32015-12-23 01:33:00 -0800172 : SkCommandLineConfig(tag, SkString("gpu"), viaParts)
173 , fContextType(contextType)
csmartdalton6270e552016-09-13 10:41:49 -0700174 , fContextOptions(ContextOptions::kNone)
kkinnunen3e980c32015-12-23 01:33:00 -0800175 , fUseDIText(useDIText)
brianosmand93c1202016-03-10 07:49:08 -0800176 , fSamples(samples)
177 , fColorType(colorType)
brianosmanb109b8c2016-06-16 13:03:24 -0700178 , fColorSpace(std::move(colorSpace)) {
csmartdalton6270e552016-09-13 10:41:49 -0700179 if (useNVPR) {
180 fContextOptions |= ContextOptions::kEnableNVPR;
181 }
182 if (useInstanced) {
183 fContextOptions |= ContextOptions::kUseInstanced;
184 }
185 if (SkColorAndColorSpaceAreGammaCorrect(colorType, colorSpace.get())) {
186 fContextOptions |= ContextOptions::kRequireSRGBSupport;
187 }
kkinnunen3e980c32015-12-23 01:33:00 -0800188}
189static bool parse_option_int(const SkString& value, int* outInt) {
190 if (value.isEmpty()) {
191 return false;
192 }
193 char* endptr = nullptr;
194 long intValue = strtol(value.c_str(), &endptr, 10);
195 if (*endptr != '\0') {
196 return false;
197 }
198 *outInt = static_cast<int>(intValue);
199 return true;
200}
201static bool parse_option_bool(const SkString& value, bool* outBool) {
202 if (value.equals("true")) {
203 *outBool = true;
204 return true;
205 }
206 if (value.equals("false")) {
207 *outBool = false;
208 return true;
209 }
210 return false;
211}
212static bool parse_option_gpu_api(const SkString& value,
213 SkCommandLineConfigGpu::ContextType* outContextType) {
kkinnunen3e980c32015-12-23 01:33:00 -0800214 if (value.equals("gl")) {
bsalomon85b4b532016-04-05 11:06:27 -0700215 *outContextType = GrContextFactory::kGL_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800216 return true;
217 }
218 if (value.equals("gles")) {
bsalomon85b4b532016-04-05 11:06:27 -0700219 *outContextType = GrContextFactory::kGLES_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800220 return true;
221 }
222 if (value.equals("debug")) {
bsalomon85b4b532016-04-05 11:06:27 -0700223 *outContextType = GrContextFactory::kDebugGL_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800224 return true;
225 }
226 if (value.equals("null")) {
bsalomon85b4b532016-04-05 11:06:27 -0700227 *outContextType = GrContextFactory::kNullGL_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800228 return true;
229 }
bsalomon11abd8d2016-10-14 08:13:48 -0700230 if (value.equals("angle_d3d9_es2")) {
231 *outContextType = GrContextFactory::kANGLE_D3D9_ES2_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800232 return true;
233 }
bsalomon11abd8d2016-10-14 08:13:48 -0700234 if (value.equals("angle_d3d11_es2")) {
235 *outContextType = GrContextFactory::kANGLE_D3D11_ES2_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800236 return true;
237 }
bsalomon11abd8d2016-10-14 08:13:48 -0700238 if (value.equals("angle_d3d11_es3")) {
239 *outContextType = GrContextFactory::kANGLE_D3D11_ES3_ContextType;
240 return true;
241 }
242 if (value.equals("angle_gl_es2")) {
243 *outContextType = GrContextFactory::kANGLE_GL_ES2_ContextType;
244 return true;
245 }
246 if (value.equals("angle_gl_es3")) {
247 *outContextType = GrContextFactory::kANGLE_GL_ES3_ContextType;
248 return true;
249 }
kkinnunen3e980c32015-12-23 01:33:00 -0800250 if (value.equals("commandbuffer")) {
bsalomon85b4b532016-04-05 11:06:27 -0700251 *outContextType = GrContextFactory::kCommandBuffer_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800252 return true;
253 }
kkinnunen3e980c32015-12-23 01:33:00 -0800254#if SK_MESA
255 if (value.equals("mesa")) {
bsalomon85b4b532016-04-05 11:06:27 -0700256 *outContextType = GrContextFactory::kMESA_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800257 return true;
258 }
259#endif
bsalomondc0fcd42016-04-11 14:21:33 -0700260#ifdef SK_VULKAN
261 if (value.equals("vulkan")) {
262 *outContextType = GrContextFactory::kVulkan_ContextType;
263 return true;
264 }
265#endif
kkinnunen3e980c32015-12-23 01:33:00 -0800266 return false;
267}
brianosmand93c1202016-03-10 07:49:08 -0800268static bool parse_option_gpu_color(const SkString& value,
269 SkColorType* outColorType,
brianosmanb109b8c2016-06-16 13:03:24 -0700270 sk_sp<SkColorSpace>* outColorSpace) {
brianosmand93c1202016-03-10 07:49:08 -0800271 if (value.equals("8888")) {
bsalomon33069252016-09-28 08:49:53 -0700272 *outColorType = kRGBA_8888_SkColorType;
brianosmanb109b8c2016-06-16 13:03:24 -0700273 *outColorSpace = nullptr;
brianosmand93c1202016-03-10 07:49:08 -0800274 return true;
275 }
brianosman4562f6e2016-09-19 14:42:04 -0700276
277 SkTArray<SkString> commands;
278 SkStrSplit(value.c_str(), "_", &commands);
279 if (commands.count() < 1 || commands.count() > 2) {
280 return false;
281 }
282
283 // First, figure out color gamut that we'll work in (default to sRGB)
284 sk_sp<SkColorSpace> colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
285 if (commands.count() == 2) {
286 if (commands[1].equals("srgb")) {
287 // sRGB gamut (which is our default)
288 } else if (commands[1].equals("wide")) {
289 // WideGamut RGB
290 const float gWideGamutRGB_toXYZD50[]{
291 0.7161046f, 0.1009296f, 0.1471858f, // -> X
292 0.2581874f, 0.7249378f, 0.0168748f, // -> Y
293 0.0000000f, 0.0517813f, 0.7734287f, // -> Z
294 };
295 SkMatrix44 wideGamutRGBMatrix(SkMatrix44::kUninitialized_Constructor);
296 wideGamutRGBMatrix.set3x3RowMajorf(gWideGamutRGB_toXYZD50);
297 colorSpace = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
298 wideGamutRGBMatrix);
299 } else {
300 // Unknown color gamut
301 return false;
302 }
303 }
304
305 // Now pick a color type
306 if (commands[0].equals("f16")) {
brianosmand93c1202016-03-10 07:49:08 -0800307 *outColorType = kRGBA_F16_SkColorType;
raftias7c602de2016-10-13 10:45:44 -0700308 *outColorSpace = as_CSB(colorSpace)->makeLinearGamma();
brianosmand93c1202016-03-10 07:49:08 -0800309 return true;
310 }
brianosman4562f6e2016-09-19 14:42:04 -0700311 if (commands[0].equals("srgb")) {
bsalomon33069252016-09-28 08:49:53 -0700312 *outColorType = kRGBA_8888_SkColorType;
brianosman4562f6e2016-09-19 14:42:04 -0700313 *outColorSpace = colorSpace;
brianosmand93c1202016-03-10 07:49:08 -0800314 return true;
315 }
316 return false;
317}
kkinnunen3e980c32015-12-23 01:33:00 -0800318
319SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
320 const SkTArray<SkString>& vias,
321 const SkString& options) {
322 // Defaults for GPU backend.
323 bool seenAPI = false;
bsalomon85b4b532016-04-05 11:06:27 -0700324 SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeGL_ContextType;
kkinnunen3e980c32015-12-23 01:33:00 -0800325 bool seenUseNVPR = false;
326 bool useNVPR = false;
csmartdaltone0d36292016-07-29 08:14:20 -0700327 bool seenUseInstanced = false;
328 bool useInstanced = false;
kkinnunen3e980c32015-12-23 01:33:00 -0800329 bool seenUseDIText =false;
330 bool useDIText = false;
331 bool seenSamples = false;
332 int samples = 0;
brianosmand93c1202016-03-10 07:49:08 -0800333 bool seenColor = false;
bsalomon33069252016-09-28 08:49:53 -0700334 SkColorType colorType = kRGBA_8888_SkColorType;
brianosmanb109b8c2016-06-16 13:03:24 -0700335 sk_sp<SkColorSpace> colorSpace = nullptr;
kkinnunen3e980c32015-12-23 01:33:00 -0800336
337 SkTArray<SkString> optionParts;
338 SkStrSplit(options.c_str(), ",", kStrict_SkStrSplitMode, &optionParts);
339 for (int i = 0; i < optionParts.count(); ++i) {
340 SkTArray<SkString> keyValueParts;
341 SkStrSplit(optionParts[i].c_str(), "=", kStrict_SkStrSplitMode, &keyValueParts);
342 if (keyValueParts.count() != 2) {
343 return nullptr;
344 }
345 const SkString& key = keyValueParts[0];
346 const SkString& value = keyValueParts[1];
347 bool valueOk = false;
348 if (key.equals("api") && !seenAPI) {
349 valueOk = parse_option_gpu_api(value, &contextType);
350 seenAPI = true;
351 } else if (key.equals("nvpr") && !seenUseNVPR) {
352 valueOk = parse_option_bool(value, &useNVPR);
353 seenUseNVPR = true;
csmartdaltone0d36292016-07-29 08:14:20 -0700354 } else if (key.equals("inst") && !seenUseInstanced) {
355 valueOk = parse_option_bool(value, &useInstanced);
356 seenUseInstanced = true;
kkinnunen3e980c32015-12-23 01:33:00 -0800357 } else if (key.equals("dit") && !seenUseDIText) {
358 valueOk = parse_option_bool(value, &useDIText);
359 seenUseDIText = true;
360 } else if (key.equals("samples") && !seenSamples) {
361 valueOk = parse_option_int(value, &samples);
362 seenSamples = true;
brianosmand93c1202016-03-10 07:49:08 -0800363 } else if (key.equals("color") && !seenColor) {
brianosmanb109b8c2016-06-16 13:03:24 -0700364 valueOk = parse_option_gpu_color(value, &colorType, &colorSpace);
brianosmand93c1202016-03-10 07:49:08 -0800365 seenColor = true;
kkinnunen3e980c32015-12-23 01:33:00 -0800366 }
367 if (!valueOk) {
368 return nullptr;
369 }
370 }
csmartdaltone0d36292016-07-29 08:14:20 -0700371 return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useInstanced, useDIText,
372 samples, colorType, colorSpace);
kkinnunen3e980c32015-12-23 01:33:00 -0800373}
374#endif
375
376void ParseConfigs(const SkCommandLineFlags::StringArray& configs,
377 SkCommandLineConfigArray* outResult) {
378 outResult->reset();
379 for (int i = 0; i < configs.count(); ++i) {
380 SkString extendedBackend;
381 SkString extendedOptions;
382 SkString simpleBackend;
383 SkTArray<SkString> vias;
384
385 SkString tag(configs[i]);
386 SkTArray<SkString> parts;
bsalomon808ecbb2016-09-28 12:40:22 -0700387 SkStrSplit(tag.c_str(), "[", kStrict_SkStrSplitMode, &parts);
kkinnunen3e980c32015-12-23 01:33:00 -0800388 if (parts.count() == 2) {
389 SkTArray<SkString> parts2;
bsalomon808ecbb2016-09-28 12:40:22 -0700390 SkStrSplit(parts[1].c_str(), "]", kStrict_SkStrSplitMode, &parts2);
kkinnunen3e980c32015-12-23 01:33:00 -0800391 if (parts2.count() == 2 && parts2[1].isEmpty()) {
392 SkStrSplit(parts[0].c_str(), "-", kStrict_SkStrSplitMode, &vias);
393 if (vias.count()) {
394 extendedBackend = vias[vias.count() - 1];
395 vias.pop_back();
396 } else {
397 extendedBackend = parts[0];
398 }
399 extendedOptions = parts2[0];
bsalomon808ecbb2016-09-28 12:40:22 -0700400 simpleBackend.printf("%s[%s]", extendedBackend.c_str(), extendedOptions.c_str());
kkinnunen3e980c32015-12-23 01:33:00 -0800401 }
402 }
403
404 if (extendedBackend.isEmpty()) {
405 simpleBackend = tag;
406 SkStrSplit(tag.c_str(), "-", kStrict_SkStrSplitMode, &vias);
407 if (vias.count()) {
408 simpleBackend = vias[vias.count() - 1];
409 vias.pop_back();
410 }
kkinnunen3e980c32015-12-23 01:33:00 -0800411 for (auto& predefinedConfig : gPredefinedConfigs) {
412 if (simpleBackend.equals(predefinedConfig.predefinedConfig)) {
413 extendedBackend = predefinedConfig.backend;
414 extendedOptions = predefinedConfig.options;
415 break;
416 }
417 }
418 }
419 SkCommandLineConfig* parsedConfig = nullptr;
420#if SK_SUPPORT_GPU
421 if (extendedBackend.equals("gpu")) {
422 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOptions);
423 }
424#endif
425 if (!parsedConfig) {
426 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias);
427 }
428 outResult->emplace_back(parsedConfig);
429 }
430}