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 | 9 |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 | 11 |
12 #if SK_SUPPORT_GPU | 12 #if SK_SUPPORT_GPU |
13 using sk_gpu_test::GrContextFactory; | 13 using sk_gpu_test::GrContextFactory; |
14 #endif | 14 #endif |
15 | 15 |
16 static const char defaultConfigs[] = | 16 static const char defaultConfigs[] = |
17 "565 8888 gpu nonrendering" | 17 "565 8888 gpu nonrendering" |
18 #if SK_ANGLE | 18 #if SK_ANGLE |
19 #ifdef SK_BUILD_FOR_WIN | 19 #ifdef SK_BUILD_FOR_WIN |
20 " angle" | 20 " angle" |
21 #endif | 21 #endif |
22 #endif | 22 #endif |
23 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 23 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
24 " hwui" | 24 " hwui" |
25 #endif | 25 #endif |
26 ; | 26 ; |
27 | 27 |
28 static const char configHelp[] = | 28 static const char configHelp[] = |
29 "Options: 565 8888 debug gpu gl gpudebug gpudft gpunull " | 29 "Options: 565 8888 debug gpu gpudebug gpudft gpunull " |
30 "msaa16 msaa4 glmsaa4 gpuf16 gpusrgb glsrgb nonrendering null nullgpu " | 30 "msaa16 msaa4 gpuf16 gpusrgb nonrendering null nullgpu " |
31 "nvpr16 nvpr4 nvprdit16 nvprdit4 glnvpr4 glnvprdit4 pdf skp svg xps" | 31 "nvpr16 nvpr4 nvprdit16 nvprdit4 pdf skp svg xps" |
32 #if SK_ANGLE | 32 #if SK_ANGLE |
33 #ifdef SK_BUILD_FOR_WIN | 33 #ifdef SK_BUILD_FOR_WIN |
34 " angle" | 34 " angle" |
35 #endif | 35 #endif |
36 " angle-gl" | 36 " angle-gl" |
37 #endif | 37 #endif |
38 #if SK_COMMAND_BUFFER | 38 #if SK_COMMAND_BUFFER |
39 " commandbuffer" | 39 " commandbuffer" |
40 #endif | 40 #endif |
41 #if SK_MESA | 41 #if SK_MESA |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 "\t\tsrgb\t\t\tsRGB 8888.\n" | 80 "\t\tsrgb\t\t\tsRGB 8888.\n" |
81 "\tdit\ttype: bool\tdefault: false.\n" | 81 "\tdit\ttype: bool\tdefault: false.\n" |
82 "\t Use device independent text.\n" | 82 "\t Use device independent text.\n" |
83 "\tnvpr\ttype: bool\tdefault: false.\n" | 83 "\tnvpr\ttype: bool\tdefault: false.\n" |
84 "\t Use NV_path_rendering OpenGL and OpenGL ES extension.\n" | 84 "\t Use NV_path_rendering OpenGL and OpenGL ES extension.\n" |
85 "\tsamples\ttype: int\tdefault: 0.\n" | 85 "\tsamples\ttype: int\tdefault: 0.\n" |
86 "\t Use multisampling with N samples.\n" | 86 "\t Use multisampling with N samples.\n" |
87 "\n" | 87 "\n" |
88 "Predefined configs:\n\n" | 88 "Predefined configs:\n\n" |
89 "\tgpu \t= gpu()\n" | 89 "\tgpu \t= gpu()\n" |
90 "\tgl \t= gpu(api=gl)\n" | |
91 "\tmsaa4 \t= gpu(samples=4)\n" | 90 "\tmsaa4 \t= gpu(samples=4)\n" |
92 "\tglmsaa4 \t= gpu(api=gl,samples=4)\n" | |
93 "\tmsaa16 \t= gpu(samples=16)\n" | 91 "\tmsaa16 \t= gpu(samples=16)\n" |
94 "\tnvpr4 \t= gpu(nvpr=true,samples=4)\n" | 92 "\tnvpr4 \t= gpu(nvpr=true,samples=4)\n" |
95 "\tglnvpr4 \t= gpu(api=gl,nvpr=true,samples=4)\n" | |
96 "\tnvpr16 \t= gpu(nvpr=true,samples=16)\n" | 93 "\tnvpr16 \t= gpu(nvpr=true,samples=16)\n" |
97 "\tnvprdit4 \t= gpu(nvpr=true,samples=4,dit=true)\n" | 94 "\tnvprdit4 \t= gpu(nvpr=true,samples=4,dit=true)\n" |
98 "\tglnvprdit4\t= gpu(api=gl,nvpr=true,samples=4,dit=true)\n" | |
99 "\tnvprdit16 \t= gpu(nvpr=true,samples=16,dit=true)\n" | 95 "\tnvprdit16 \t= gpu(nvpr=true,samples=16,dit=true)\n" |
100 "\tgpuf16 \t= gpu(color=f16)\n" | 96 "\tgpuf16 \t= gpu(color=f16)\n" |
101 "\tgpusrgb \t= gpu(color=srgb)\n" | 97 "\tgpusrgb \t= gpu(color=srgb)\n" |
102 "\tglsrgb \t= gpu(api=gl,color=srgb)\n" | |
103 "\tgpudft \t= gpu(dit=true)\n" | 98 "\tgpudft \t= gpu(dit=true)\n" |
104 "\tgpudebug \t= gpu(api=debug)\n" | 99 "\tgpudebug \t= gpu(api=debug)\n" |
105 "\tgpunull \t= gpu(api=null)\n" | 100 "\tgpunull \t= gpu(api=null)\n" |
106 "\tdebug \t= gpu(api=debug)\n" | 101 "\tdebug \t= gpu(api=debug)\n" |
107 "\tnullgpu \t= gpu(api=null)\n" | 102 "\tnullgpu \t= gpu(api=null)\n" |
108 #if SK_ANGLE | 103 #if SK_ANGLE |
109 #ifdef SK_BUILD_FOR_WIN | 104 #ifdef SK_BUILD_FOR_WIN |
110 "\tangle \t= gpu(api=angle)\n" | 105 "\tangle \t= gpu(api=angle)\n" |
111 #endif | 106 #endif |
112 "\tangle-gl \t= gpu(api=angle-gl)\n" | 107 "\tangle-gl \t= gpu(api=angle-gl)\n" |
113 #endif | 108 #endif |
114 #if SK_COMMAND_BUFFER | 109 #if SK_COMMAND_BUFFER |
115 "\tcommandbuffer\t= gpu(api=commandbuffer)\n" | 110 "\tcommandbuffer\t= gpu(api=commandbuffer)\n" |
116 #endif | 111 #endif |
117 #if SK_MESA | 112 #if SK_MESA |
118 "\tmesa \t= gpu(api=mesa)\n" | 113 "\tmesa \t= gpu(api=mesa)\n" |
119 #endif | 114 #endif |
120 #endif | 115 #endif |
121 ; | 116 ; |
122 | 117 |
123 DEFINE_extended_string(config, defaultConfigs, configHelp, configExtendedHelp); | 118 DEFINE_extended_string(config, defaultConfigs, configHelp, configExtendedHelp); |
124 | 119 |
125 static const struct { | 120 static const struct { |
126 const char* predefinedConfig; | 121 const char* predefinedConfig; |
127 const char* backend; | 122 const char* backend; |
128 const char* options; | 123 const char* options; |
129 } gPredefinedConfigs[] = { | 124 } gPredefinedConfigs[] = { |
130 #if SK_SUPPORT_GPU | 125 #if SK_SUPPORT_GPU |
131 { "gpu", "gpu", "" }, | 126 { "gpu", "gpu", "" }, |
132 { "gl", "gpu", "api=gl" }, | |
133 { "msaa4", "gpu", "samples=4" }, | 127 { "msaa4", "gpu", "samples=4" }, |
134 { "glmsaa4", "gpu", "api=gl,samples=4" }, | |
135 { "msaa16", "gpu", "samples=16" }, | 128 { "msaa16", "gpu", "samples=16" }, |
136 { "nvpr4", "gpu", "nvpr=true,samples=4" }, | 129 { "nvpr4", "gpu", "nvpr=true,samples=4" }, |
137 { "glnvpr4", "gpu", "api=gl,nvpr=true,samples=4" }, | |
138 { "nvpr16", "gpu", "nvpr=true,samples=16" }, | 130 { "nvpr16", "gpu", "nvpr=true,samples=16" }, |
139 { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" }, | 131 { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" }, |
140 { "glnvprdit4", "gpu", "api=gl,nvpr=true,samples=4,dit=true" }, | |
141 { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" }, | 132 { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" }, |
142 { "gpuf16", "gpu", "color=f16" }, | 133 { "gpuf16", "gpu", "color=f16" }, |
143 { "gpusrgb", "gpu", "color=srgb" }, | 134 { "gpusrgb", "gpu", "color=srgb" }, |
144 { "glsrgb", "gpu", "api=gl,color=srgb" }, | |
145 { "gpudft", "gpu", "dit=true" }, | 135 { "gpudft", "gpu", "dit=true" }, |
146 { "gpudebug", "gpu", "api=debug" }, | 136 { "gpudebug", "gpu", "api=debug" }, |
147 { "gpunull", "gpu", "api=null" }, | 137 { "gpunull", "gpu", "api=null" }, |
148 { "debug", "gpu", "api=debug" }, | 138 { "debug", "gpu", "api=debug" }, |
149 { "nullgpu", "gpu", "api=null" } | 139 { "nullgpu", "gpu", "api=null" } |
150 #if SK_ANGLE | 140 #if SK_ANGLE |
151 #ifdef SK_BUILD_FOR_WIN | 141 #ifdef SK_BUILD_FOR_WIN |
152 , { "angle", "gpu", "api=angle" } | 142 , { "angle", "gpu", "api=angle" } |
153 #endif | 143 #endif |
154 , { "angle-gl", "gpu", "api=angle-gl" } | 144 , { "angle-gl", "gpu", "api=angle-gl" } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (extendedBackend.equals("gpu")) { | 375 if (extendedBackend.equals("gpu")) { |
386 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); | 376 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); |
387 } | 377 } |
388 #endif | 378 #endif |
389 if (!parsedConfig) { | 379 if (!parsedConfig) { |
390 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); | 380 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); |
391 } | 381 } |
392 outResult->emplace_back(parsedConfig); | 382 outResult->emplace_back(parsedConfig); |
393 } | 383 } |
394 } | 384 } |
OLD | NEW |