Chromium Code Reviews| 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" |
| 11 #include "PictureRenderer.h" | 11 #include "PictureRenderer.h" |
| 12 #include "picture_utils.h" | 12 #include "picture_utils.h" |
| 13 #include "SkCommandLineFlags.h" | 13 #include "SkCommandLineFlags.h" |
| 14 #include "SkData.h" | 14 #include "SkData.h" |
| 15 #include "SkImage.h" | 15 #include "SkImage.h" |
| 16 #include "SkImageDecoder.h" | 16 #include "SkImageDecoder.h" |
| 17 #include "SkString.h" | 17 #include "SkString.h" |
| 18 | 18 |
| 19 // Alphabetized list of flags used by this file or bench_ and render_pictures. | 19 // Alphabetized list of flags used by this file or bench_ and render_pictures. |
| 20 DEFINE_string(bbh, "none", "bbhType [width height]: Set the bounding box hierarc hy type to " | 20 DEFINE_string(bbh, "none", "bbhType [width height]: Set the bounding box hierarc hy type to " |
| 21 "be used. Accepted values are: none, rtree, grid. " | 21 "be used. Accepted values are: none, rtree, grid. " |
| 22 "Not compatible with --pipe. With value " | 22 "Not compatible with --pipe. With value " |
| 23 "'grid', width and height must be specified. 'grid' can " | 23 "'grid', width and height must be specified. 'grid' can " |
| 24 "only be used with modes tile, record, and " | 24 "only be used with modes tile, record, and " |
| 25 "playbackCreation."); | 25 "playbackCreation."); |
| 26 // Although this config does not support all the same options as gm, the names s hould be kept | 26 // Although this config does not support all the same options as gm, the names s hould be kept |
| 27 // consistent. | 27 // consistent. |
| 28 #if SK_ANGLE | 28 #if SK_ANGLE |
| 29 // ANGLE assumes GPU | 29 // ANGLE assumes GPU |
| 30 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16|angle]: Use the correspond ing config."); | 30 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16|angle]: Use the correspond ing config."); |
|
robertphillips
2014/01/06 15:57:59
What if we have both angle and mesa defined?
epoger
2014/01/06 16:01:47
Right. I guess we need something like this:
SkSt
rmistry
2014/01/06 18:03:55
Done with something similar to the above suggestio
| |
| 31 #elif SK_MESA | |
| 32 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16|mesa]: Use the correspondi ng config."); | |
| 31 #elif SK_SUPPORT_GPU | 33 #elif SK_SUPPORT_GPU |
| 32 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16]: Use the corresponding co nfig."); | 34 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16]: Use the corresponding co nfig."); |
| 33 #else | 35 #else |
| 34 DEFINE_string(config, "8888", "[8888]: Use the corresponding config."); | 36 DEFINE_string(config, "8888", "[8888]: Use the corresponding config."); |
| 35 #endif | 37 #endif |
| 36 | 38 |
| 37 DEFINE_bool(deferImageDecoding, false, "Defer decoding until drawing images. " | 39 DEFINE_bool(deferImageDecoding, false, "Defer decoding until drawing images. " |
| 38 "Has no effect if the provided skp does not have its images encoded. "); | 40 "Has no effect if the provided skp does not have its images encoded. "); |
| 39 DEFINE_string(mode, "simple", "Run in the corresponding mode:\n" | 41 DEFINE_string(mode, "simple", "Run in the corresponding mode:\n" |
| 40 "simple: Simple rendering.\n" | 42 "simple: Simple rendering.\n" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 } | 280 } |
| 279 #if SK_ANGLE | 281 #if SK_ANGLE |
| 280 else if (0 == strcmp(FLAGS_config[0], "angle")) { | 282 else if (0 == strcmp(FLAGS_config[0], "angle")) { |
| 281 deviceType = sk_tools::PictureRenderer::kAngle_DeviceType; | 283 deviceType = sk_tools::PictureRenderer::kAngle_DeviceType; |
| 282 if (FLAGS_multi > 1) { | 284 if (FLAGS_multi > 1) { |
| 283 error.printf("Angle not compatible with multithreaded tiling.\n" ); | 285 error.printf("Angle not compatible with multithreaded tiling.\n" ); |
| 284 return NULL; | 286 return NULL; |
| 285 } | 287 } |
| 286 } | 288 } |
| 287 #endif | 289 #endif |
| 290 #if SK_MESA | |
| 291 else if (0 == strcmp(FLAGS_config[0], "mesa")) { | |
| 292 deviceType = sk_tools::PictureRenderer::kMesa_DeviceType; | |
| 293 if (FLAGS_multi > 1) { | |
| 294 error.printf("Mesa not compatible with multithreaded tiling.\n") ; | |
| 295 return NULL; | |
| 296 } | |
| 297 } | |
| 298 #endif | |
| 288 #endif | 299 #endif |
| 289 else { | 300 else { |
| 290 error.printf("%s is not a valid mode for --config\n", FLAGS_config[0 ]); | 301 error.printf("%s is not a valid mode for --config\n", FLAGS_config[0 ]); |
| 291 return NULL; | 302 return NULL; |
| 292 } | 303 } |
| 293 renderer->setDeviceType(deviceType); | 304 renderer->setDeviceType(deviceType); |
| 294 #if SK_SUPPORT_GPU | 305 #if SK_SUPPORT_GPU |
| 295 renderer->setSampleCount(sampleCount); | 306 renderer->setSampleCount(sampleCount); |
| 296 #endif | 307 #endif |
| 297 } | 308 } |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 326 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType != bbhType) { | 337 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType != bbhType) { |
| 327 error.printf("--pipe and --bbh cannot be used together\n"); | 338 error.printf("--pipe and --bbh cannot be used together\n"); |
| 328 return NULL; | 339 return NULL; |
| 329 } | 340 } |
| 330 } | 341 } |
| 331 renderer->setBBoxHierarchyType(bbhType); | 342 renderer->setBBoxHierarchyType(bbhType); |
| 332 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); | 343 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); |
| 333 | 344 |
| 334 return renderer.detach(); | 345 return renderer.detach(); |
| 335 } | 346 } |
| OLD | NEW |