OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "PictureRenderingFlags.h" | 8 #include "PictureRenderingFlags.h" |
9 | 9 |
10 #include "CopyTilesRenderer.h" | 10 #include "CopyTilesRenderer.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 static const char kGpuAPINameGLES[] = "gles"; | 33 static const char kGpuAPINameGLES[] = "gles"; |
34 #define GPU_CONFIG_STRING "|gpu|msaa4|msaa16|nvprmsaa4|nvprmsaa16|gpudft" | 34 #define GPU_CONFIG_STRING "|gpu|msaa4|msaa16|nvprmsaa4|nvprmsaa16|gpudft" |
35 #else | 35 #else |
36 #define GPU_CONFIG_STRING "" | 36 #define GPU_CONFIG_STRING "" |
37 #endif | 37 #endif |
38 #if SK_ANGLE | 38 #if SK_ANGLE |
39 #define ANGLE_CONFIG_STRING "|angle" | 39 #define ANGLE_CONFIG_STRING "|angle" |
40 #else | 40 #else |
41 #define ANGLE_CONFIG_STRING "" | 41 #define ANGLE_CONFIG_STRING "" |
42 #endif | 42 #endif |
| 43 #if SK_COMMAND_BUFFER |
| 44 #define COMMAND_BUFFER_CONFIG_STRING "|commandbuffer" |
| 45 #else |
| 46 #define COMMAND_BUFFER_CONFIG_STRING "" |
| 47 #endif |
43 #if SK_MESA | 48 #if SK_MESA |
44 #define MESA_CONFIG_STRING "|mesa" | 49 #define MESA_CONFIG_STRING "|mesa" |
45 #else | 50 #else |
46 #define MESA_CONFIG_STRING "" | 51 #define MESA_CONFIG_STRING "" |
47 #endif | 52 #endif |
48 | 53 |
49 // Although this config does not support all the same options as gm, the names s
hould be kept | 54 // Although this config does not support all the same options as gm, the names s
hould be kept |
50 // consistent. | 55 // consistent. |
51 DEFINE_string(config, "8888", "[" | 56 DEFINE_string(config, "8888", "[" |
52 "8888" GPU_CONFIG_STRING ANGLE_CONFIG_STRING MESA_CONFIG_STRING | 57 "8888" GPU_CONFIG_STRING ANGLE_CONFIG_STRING COMMAND_BUFFER_CONFIG
_STRING MESA_CONFIG_STRING |
53 "]: Use the corresponding config."); | 58 "]: Use the corresponding config."); |
54 | 59 |
55 DEFINE_bool(deferImageDecoding, false, "Defer decoding until drawing images. " | 60 DEFINE_bool(deferImageDecoding, false, "Defer decoding until drawing images. " |
56 "Has no effect if the provided skp does not have its images encoded.
"); | 61 "Has no effect if the provided skp does not have its images encoded.
"); |
57 DEFINE_string(mode, "simple", "Run in the corresponding mode:\n" | 62 DEFINE_string(mode, "simple", "Run in the corresponding mode:\n" |
58 "simple: Simple rendering.\n" | 63 "simple: Simple rendering.\n" |
59 "tile width height: Use tiles with the given dimensions or percent
ages.\n" | 64 "tile width height: Use tiles with the given dimensions or percent
ages.\n" |
60 "pow2tile minWidth height: Use tiles with widths that are all a po
wer\n" | 65 "pow2tile minWidth height: Use tiles with widths that are all a po
wer\n" |
61 "\tof two such that they minimize the amount of wasted tile space.
\n" | 66 "\tof two such that they minimize the amount of wasted tile space.
\n" |
62 "\tminWidth must be a power of two.\n" | 67 "\tminWidth must be a power of two.\n" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 310 } |
306 else if (0 == strcmp(FLAGS_config[0], "gpudft")) { | 311 else if (0 == strcmp(FLAGS_config[0], "gpudft")) { |
307 deviceType = sk_tools::PictureRenderer::kGPU_DeviceType; | 312 deviceType = sk_tools::PictureRenderer::kGPU_DeviceType; |
308 useDFText = true; | 313 useDFText = true; |
309 } | 314 } |
310 #if SK_ANGLE | 315 #if SK_ANGLE |
311 else if (0 == strcmp(FLAGS_config[0], "angle")) { | 316 else if (0 == strcmp(FLAGS_config[0], "angle")) { |
312 deviceType = sk_tools::PictureRenderer::kAngle_DeviceType; | 317 deviceType = sk_tools::PictureRenderer::kAngle_DeviceType; |
313 } | 318 } |
314 #endif | 319 #endif |
| 320 #if SK_COMMAND_BUFFER |
| 321 else if (0 == strcmp(FLAGS_config[0], "commandbuffer")) { |
| 322 deviceType = sk_tools::PictureRenderer::kCommandBuffer_DeviceType; |
| 323 } |
| 324 #endif |
315 #if SK_MESA | 325 #if SK_MESA |
316 else if (0 == strcmp(FLAGS_config[0], "mesa")) { | 326 else if (0 == strcmp(FLAGS_config[0], "mesa")) { |
317 deviceType = sk_tools::PictureRenderer::kMesa_DeviceType; | 327 deviceType = sk_tools::PictureRenderer::kMesa_DeviceType; |
318 } | 328 } |
319 #endif | 329 #endif |
320 #endif | 330 #endif |
321 else { | 331 else { |
322 error.printf("%s is not a valid mode for --config\n", FLAGS_config[0
]); | 332 error.printf("%s is not a valid mode for --config\n", FLAGS_config[0
]); |
323 return NULL; | 333 return NULL; |
324 } | 334 } |
(...skipping 27 matching lines...) Expand all Loading... |
352 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { | 362 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { |
353 error.printf("--pipe and --bbh cannot be used together\n"); | 363 error.printf("--pipe and --bbh cannot be used together\n"); |
354 return NULL; | 364 return NULL; |
355 } | 365 } |
356 } | 366 } |
357 renderer->setBBoxHierarchyType(bbhType); | 367 renderer->setBBoxHierarchyType(bbhType); |
358 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); | 368 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); |
359 | 369 |
360 return renderer.detach(); | 370 return renderer.detach(); |
361 } | 371 } |
OLD | NEW |