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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return true; | 204 return true; |
205 } | 205 } |
206 if (value.equals("false")) { | 206 if (value.equals("false")) { |
207 *outBool = false; | 207 *outBool = false; |
208 return true; | 208 return true; |
209 } | 209 } |
210 return false; | 210 return false; |
211 } | 211 } |
212 static bool parse_option_gpu_api(const SkString& value, | 212 static bool parse_option_gpu_api(const SkString& value, |
213 SkCommandLineConfigGpu::ContextType* outContext
Type) { | 213 SkCommandLineConfigGpu::ContextType* outContext
Type) { |
214 if (value.equals("native")) { | |
215 *outContextType = GrContextFactory::kNative_GLContextType; | |
216 return true; | |
217 } | |
218 if (value.equals("gl")) { | 214 if (value.equals("gl")) { |
219 *outContextType = GrContextFactory::kGL_GLContextType; | 215 *outContextType = GrContextFactory::kGL_ContextType; |
220 return true; | 216 return true; |
221 } | 217 } |
222 if (value.equals("gles")) { | 218 if (value.equals("gles")) { |
223 *outContextType = GrContextFactory::kGLES_GLContextType; | 219 *outContextType = GrContextFactory::kGLES_ContextType; |
224 return true; | 220 return true; |
225 } | 221 } |
226 if (value.equals("debug")) { | 222 if (value.equals("debug")) { |
227 *outContextType = GrContextFactory::kDebug_GLContextType; | 223 *outContextType = GrContextFactory::kDebugGL_ContextType; |
228 return true; | 224 return true; |
229 } | 225 } |
230 if (value.equals("null")) { | 226 if (value.equals("null")) { |
231 *outContextType = GrContextFactory::kNull_GLContextType; | 227 *outContextType = GrContextFactory::kNullGL_ContextType; |
232 return true; | 228 return true; |
233 } | 229 } |
234 #if SK_ANGLE | 230 #if SK_ANGLE |
235 #ifdef SK_BUILD_FOR_WIN | 231 #ifdef SK_BUILD_FOR_WIN |
236 if (value.equals("angle")) { | 232 if (value.equals("angle")) { |
237 *outContextType = GrContextFactory::kANGLE_GLContextType; | 233 *outContextType = GrContextFactory::kANGLE_ContextType; |
238 return true; | 234 return true; |
239 } | 235 } |
240 #endif | 236 #endif |
241 if (value.equals("angle-gl")) { | 237 if (value.equals("angle-gl")) { |
242 *outContextType = GrContextFactory::kANGLE_GL_GLContextType; | 238 *outContextType = GrContextFactory::kANGLE_GL_ContextType; |
243 return true; | 239 return true; |
244 } | 240 } |
245 #endif | 241 #endif |
246 #if SK_COMMAND_BUFFER | 242 #if SK_COMMAND_BUFFER |
247 if (value.equals("commandbuffer")) { | 243 if (value.equals("commandbuffer")) { |
248 *outContextType = GrContextFactory::kCommandBuffer_GLContextType; | 244 *outContextType = GrContextFactory::kCommandBuffer_ContextType; |
249 return true; | 245 return true; |
250 } | 246 } |
251 #endif | 247 #endif |
252 #if SK_MESA | 248 #if SK_MESA |
253 if (value.equals("mesa")) { | 249 if (value.equals("mesa")) { |
254 *outContextType = GrContextFactory::kMESA_GLContextType; | 250 *outContextType = GrContextFactory::kMESA_ContextType; |
255 return true; | 251 return true; |
256 } | 252 } |
257 #endif | 253 #endif |
258 return false; | 254 return false; |
259 } | 255 } |
260 static bool parse_option_gpu_color(const SkString& value, | 256 static bool parse_option_gpu_color(const SkString& value, |
261 SkColorType* outColorType, | 257 SkColorType* outColorType, |
262 SkColorProfileType* outProfileType) { | 258 SkColorProfileType* outProfileType) { |
263 if (value.equals("8888")) { | 259 if (value.equals("8888")) { |
264 *outColorType = kN32_SkColorType; | 260 *outColorType = kN32_SkColorType; |
(...skipping 11 matching lines...) Expand all Loading... |
276 return true; | 272 return true; |
277 } | 273 } |
278 return false; | 274 return false; |
279 } | 275 } |
280 | 276 |
281 SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, | 277 SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, |
282 const SkTArray<SkString>&
vias, | 278 const SkTArray<SkString>&
vias, |
283 const SkString& options) { | 279 const SkString& options) { |
284 // Defaults for GPU backend. | 280 // Defaults for GPU backend. |
285 bool seenAPI = false; | 281 bool seenAPI = false; |
286 SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNative_
GLContextType; | 282 SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeG
L_ContextType; |
287 bool seenUseNVPR = false; | 283 bool seenUseNVPR = false; |
288 bool useNVPR = false; | 284 bool useNVPR = false; |
289 bool seenUseDIText =false; | 285 bool seenUseDIText =false; |
290 bool useDIText = false; | 286 bool useDIText = false; |
291 bool seenSamples = false; | 287 bool seenSamples = false; |
292 int samples = 0; | 288 int samples = 0; |
293 bool seenColor = false; | 289 bool seenColor = false; |
294 SkColorType colorType = kN32_SkColorType; | 290 SkColorType colorType = kN32_SkColorType; |
295 SkColorProfileType profileType = kLinear_SkColorProfileType; | 291 SkColorProfileType profileType = kLinear_SkColorProfileType; |
296 | 292 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (extendedBackend.equals("gpu")) { | 381 if (extendedBackend.equals("gpu")) { |
386 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); | 382 parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOpti
ons); |
387 } | 383 } |
388 #endif | 384 #endif |
389 if (!parsedConfig) { | 385 if (!parsedConfig) { |
390 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); | 386 parsedConfig = new SkCommandLineConfig(tag, simpleBackend, vias); |
391 } | 387 } |
392 outResult->emplace_back(parsedConfig); | 388 outResult->emplace_back(parsedConfig); |
393 } | 389 } |
394 } | 390 } |
OLD | NEW |