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