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> |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 return true; | 194 return true; |
195 } | 195 } |
196 if (value.equals("false")) { | 196 if (value.equals("false")) { |
197 *outBool = false; | 197 *outBool = false; |
198 return true; | 198 return true; |
199 } | 199 } |
200 return false; | 200 return false; |
201 } | 201 } |
202 static bool parse_option_gpu_api(const SkString& value, | 202 static bool parse_option_gpu_api(const SkString& value, |
203 SkCommandLineConfigGpu::ContextType* outContext
Type) { | 203 SkCommandLineConfigGpu::ContextType* outContext
Type) { |
204 if (value.equals("native")) { | |
205 *outContextType = GrContextFactory::kNative_GLContextType; | |
206 return true; | |
207 } | |
208 if (value.equals("gl")) { | 204 if (value.equals("gl")) { |
209 *outContextType = GrContextFactory::kGL_GLContextType; | 205 *outContextType = GrContextFactory::kGL_ContextType; |
210 return true; | 206 return true; |
211 } | 207 } |
212 if (value.equals("gles")) { | 208 if (value.equals("gles")) { |
213 *outContextType = GrContextFactory::kGLES_GLContextType; | 209 *outContextType = GrContextFactory::kGLES_ContextType; |
214 return true; | 210 return true; |
215 } | 211 } |
216 if (value.equals("debug")) { | 212 if (value.equals("debug")) { |
217 *outContextType = GrContextFactory::kDebug_GLContextType; | 213 *outContextType = GrContextFactory::kDebugGL_ContextType; |
218 return true; | 214 return true; |
219 } | 215 } |
220 if (value.equals("null")) { | 216 if (value.equals("null")) { |
221 *outContextType = GrContextFactory::kNull_GLContextType; | 217 *outContextType = GrContextFactory::kNullGL_ContextType; |
222 return true; | 218 return true; |
223 } | 219 } |
224 #if SK_ANGLE | 220 #if SK_ANGLE |
225 #ifdef SK_BUILD_FOR_WIN | 221 #ifdef SK_BUILD_FOR_WIN |
226 if (value.equals("angle")) { | 222 if (value.equals("angle")) { |
227 *outContextType = GrContextFactory::kANGLE_GLContextType; | 223 *outContextType = GrContextFactory::kANGLE_ContextType; |
228 return true; | 224 return true; |
229 } | 225 } |
230 #endif | 226 #endif |
231 if (value.equals("angle-gl")) { | 227 if (value.equals("angle-gl")) { |
232 *outContextType = GrContextFactory::kANGLE_GL_GLContextType; | 228 *outContextType = GrContextFactory::kANGLE_GL_ContextType; |
233 return true; | 229 return true; |
234 } | 230 } |
235 #endif | 231 #endif |
236 #if SK_COMMAND_BUFFER | 232 #if SK_COMMAND_BUFFER |
237 if (value.equals("commandbuffer")) { | 233 if (value.equals("commandbuffer")) { |
238 *outContextType = GrContextFactory::kCommandBuffer_GLContextType; | 234 *outContextType = GrContextFactory::kCommandBuffer_ContextType; |
239 return true; | 235 return true; |
240 } | 236 } |
241 #endif | 237 #endif |
242 #if SK_MESA | 238 #if SK_MESA |
243 if (value.equals("mesa")) { | 239 if (value.equals("mesa")) { |
244 *outContextType = GrContextFactory::kMESA_GLContextType; | 240 *outContextType = GrContextFactory::kMESA_ContextType; |
245 return true; | 241 return true; |
246 } | 242 } |
247 #endif | 243 #endif |
248 return false; | 244 return false; |
249 } | 245 } |
250 static bool parse_option_gpu_color(const SkString& value, | 246 static bool parse_option_gpu_color(const SkString& value, |
251 SkColorType* outColorType, | 247 SkColorType* outColorType, |
252 SkColorProfileType* outProfileType) { | 248 SkColorProfileType* outProfileType) { |
253 if (value.equals("8888")) { | 249 if (value.equals("8888")) { |
254 *outColorType = kN32_SkColorType; | 250 *outColorType = kN32_SkColorType; |
(...skipping 11 matching lines...) Expand all Loading... |
266 return true; | 262 return true; |
267 } | 263 } |
268 return false; | 264 return false; |
269 } | 265 } |
270 | 266 |
271 SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, | 267 SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, |
272 const SkTArray<SkString>&
vias, | 268 const SkTArray<SkString>&
vias, |
273 const SkString& options) { | 269 const SkString& options) { |
274 // Defaults for GPU backend. | 270 // Defaults for GPU backend. |
275 bool seenAPI = false; | 271 bool seenAPI = false; |
276 SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNative_
GLContextType; | 272 SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeG
L_ContextType; |
277 bool seenUseNVPR = false; | 273 bool seenUseNVPR = false; |
278 bool useNVPR = false; | 274 bool useNVPR = false; |
279 bool seenUseDIText =false; | 275 bool seenUseDIText =false; |
280 bool useDIText = false; | 276 bool useDIText = false; |
281 bool seenSamples = false; | 277 bool seenSamples = false; |
282 int samples = 0; | 278 int samples = 0; |
283 bool seenColor = false; | 279 bool seenColor = false; |
284 SkColorType colorType = kN32_SkColorType; | 280 SkColorType colorType = kN32_SkColorType; |
285 SkColorProfileType profileType = kLinear_SkColorProfileType; | 281 SkColorProfileType profileType = kLinear_SkColorProfileType; |
286 | 282 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 if (extendedBackend.equals("gpu")) { | 371 if (extendedBackend.equals("gpu")) { |
376 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); | 372 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); |
377 } | 373 } |
378 #endif | 374 #endif |
379 if (!parsedConfig) { | 375 if (!parsedConfig) { |
380 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); | 376 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); |
381 } | 377 } |
382 outResult->emplace_back(parsedConfig); | 378 outResult->emplace_back(parsedConfig); |
383 } | 379 } |
384 } | 380 } |
OLD | NEW |