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 gpudebug gpudft gpunull " | 29 "Options: 565 8888 debug gpu gl gpudebug gpudft gpunull " |
30 "msaa16 msaa4 gpuf16 gpusrgb nonrendering null nullgpu " | 30 "msaa16 msaa4 glmsaa4 gpuf16 gpusrgb glsrgb nonrendering null nullgpu " |
31 "nvpr16 nvpr4 nvprdit16 nvprdit4 pdf skp svg xps" | 31 "nvpr16 nvpr4 nvprdit16 nvprdit4 glnvpr4 glnvprdit4 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" |
90 "\tmsaa4 \t= gpu(samples=4)\n" | 91 "\tmsaa4 \t= gpu(samples=4)\n" |
| 92 "\tglmsaa4 \t= gpu(api=gl,samples=4)\n" |
91 "\tmsaa16 \t= gpu(samples=16)\n" | 93 "\tmsaa16 \t= gpu(samples=16)\n" |
92 "\tnvpr4 \t= gpu(nvpr=true,samples=4)\n" | 94 "\tnvpr4 \t= gpu(nvpr=true,samples=4)\n" |
| 95 "\tglnvpr4 \t= gpu(api=gl,nvpr=true,samples=4)\n" |
93 "\tnvpr16 \t= gpu(nvpr=true,samples=16)\n" | 96 "\tnvpr16 \t= gpu(nvpr=true,samples=16)\n" |
94 "\tnvprdit4 \t= gpu(nvpr=true,samples=4,dit=true)\n" | 97 "\tnvprdit4 \t= gpu(nvpr=true,samples=4,dit=true)\n" |
| 98 "\tglnvprdit4\t= gpu(api=gl,nvpr=true,samples=4,dit=true)\n" |
95 "\tnvprdit16 \t= gpu(nvpr=true,samples=16,dit=true)\n" | 99 "\tnvprdit16 \t= gpu(nvpr=true,samples=16,dit=true)\n" |
96 "\tgpuf16 \t= gpu(color=f16)\n" | 100 "\tgpuf16 \t= gpu(color=f16)\n" |
97 "\tgpusrgb \t= gpu(color=srgb)\n" | 101 "\tgpusrgb \t= gpu(color=srgb)\n" |
| 102 "\tglsrgb \t= gpu(api=gl,color=srgb)\n" |
98 "\tgpudft \t= gpu(dit=true)\n" | 103 "\tgpudft \t= gpu(dit=true)\n" |
99 "\tgpudebug \t= gpu(api=debug)\n" | 104 "\tgpudebug \t= gpu(api=debug)\n" |
100 "\tgpunull \t= gpu(api=null)\n" | 105 "\tgpunull \t= gpu(api=null)\n" |
101 "\tdebug \t= gpu(api=debug)\n" | 106 "\tdebug \t= gpu(api=debug)\n" |
102 "\tnullgpu \t= gpu(api=null)\n" | 107 "\tnullgpu \t= gpu(api=null)\n" |
103 #if SK_ANGLE | 108 #if SK_ANGLE |
104 #ifdef SK_BUILD_FOR_WIN | 109 #ifdef SK_BUILD_FOR_WIN |
105 "\tangle \t= gpu(api=angle)\n" | 110 "\tangle \t= gpu(api=angle)\n" |
106 #endif | 111 #endif |
107 "\tangle-gl \t= gpu(api=angle-gl)\n" | 112 "\tangle-gl \t= gpu(api=angle-gl)\n" |
108 #endif | 113 #endif |
109 #if SK_COMMAND_BUFFER | 114 #if SK_COMMAND_BUFFER |
110 "\tcommandbuffer\t= gpu(api=commandbuffer)\n" | 115 "\tcommandbuffer\t= gpu(api=commandbuffer)\n" |
111 #endif | 116 #endif |
112 #if SK_MESA | 117 #if SK_MESA |
113 "\tmesa \t= gpu(api=mesa)\n" | 118 "\tmesa \t= gpu(api=mesa)\n" |
114 #endif | 119 #endif |
115 #endif | 120 #endif |
116 ; | 121 ; |
117 | 122 |
118 DEFINE_extended_string(config, defaultConfigs, configHelp, configExtendedHelp); | 123 DEFINE_extended_string(config, defaultConfigs, configHelp, configExtendedHelp); |
119 | 124 |
120 static const struct { | 125 static const struct { |
121 const char* predefinedConfig; | 126 const char* predefinedConfig; |
122 const char* backend; | 127 const char* backend; |
123 const char* options; | 128 const char* options; |
124 } gPredefinedConfigs[] = { | 129 } gPredefinedConfigs[] = { |
125 #if SK_SUPPORT_GPU | 130 #if SK_SUPPORT_GPU |
126 { "gpu", "gpu", "" }, | 131 { "gpu", "gpu", "" }, |
| 132 { "gl", "gpu", "api=gl" }, |
127 { "msaa4", "gpu", "samples=4" }, | 133 { "msaa4", "gpu", "samples=4" }, |
| 134 { "glmsaa4", "gpu", "api=gl,samples=4" }, |
128 { "msaa16", "gpu", "samples=16" }, | 135 { "msaa16", "gpu", "samples=16" }, |
129 { "nvpr4", "gpu", "nvpr=true,samples=4" }, | 136 { "nvpr4", "gpu", "nvpr=true,samples=4" }, |
| 137 { "glnvpr4", "gpu", "api=gl,nvpr=true,samples=4" }, |
130 { "nvpr16", "gpu", "nvpr=true,samples=16" }, | 138 { "nvpr16", "gpu", "nvpr=true,samples=16" }, |
131 { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" }, | 139 { "nvprdit4", "gpu", "nvpr=true,samples=4,dit=true" }, |
| 140 { "glnvprdit4", "gpu", "api=gl,nvpr=true,samples=4,dit=true" }, |
132 { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" }, | 141 { "nvprdit16", "gpu", "nvpr=true,samples=16,dit=true" }, |
133 { "gpuf16", "gpu", "color=f16" }, | 142 { "gpuf16", "gpu", "color=f16" }, |
134 { "gpusrgb", "gpu", "color=srgb" }, | 143 { "gpusrgb", "gpu", "color=srgb" }, |
| 144 { "glsrgb", "gpu", "api=gl,color=srgb" }, |
135 { "gpudft", "gpu", "dit=true" }, | 145 { "gpudft", "gpu", "dit=true" }, |
136 { "gpudebug", "gpu", "api=debug" }, | 146 { "gpudebug", "gpu", "api=debug" }, |
137 { "gpunull", "gpu", "api=null" }, | 147 { "gpunull", "gpu", "api=null" }, |
138 { "debug", "gpu", "api=debug" }, | 148 { "debug", "gpu", "api=debug" }, |
139 { "nullgpu", "gpu", "api=null" } | 149 { "nullgpu", "gpu", "api=null" } |
140 #if SK_ANGLE | 150 #if SK_ANGLE |
141 #ifdef SK_BUILD_FOR_WIN | 151 #ifdef SK_BUILD_FOR_WIN |
142 , { "angle", "gpu", "api=angle" } | 152 , { "angle", "gpu", "api=angle" } |
143 #endif | 153 #endif |
144 , { "angle-gl", "gpu", "api=angle-gl" } | 154 , { "angle-gl", "gpu", "api=angle-gl" } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 if (extendedBackend.equals("gpu")) { | 385 if (extendedBackend.equals("gpu")) { |
376 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); | 386 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); |
377 } | 387 } |
378 #endif | 388 #endif |
379 if (!parsedConfig) { | 389 if (!parsedConfig) { |
380 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); | 390 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); |
381 } | 391 } |
382 outResult->emplace_back(parsedConfig); | 392 outResult->emplace_back(parsedConfig); |
383 } | 393 } |
384 } | 394 } |
OLD | NEW |