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