| 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 "GrContextOptions.h" | |
| 12 #include "PictureRenderer.h" | 11 #include "PictureRenderer.h" |
| 13 #include "picture_utils.h" | 12 #include "picture_utils.h" |
| 14 #include "SkCommandLineFlags.h" | 13 #include "SkCommandLineFlags.h" |
| 15 #include "SkData.h" | 14 #include "SkData.h" |
| 16 #include "SkImage.h" | 15 #include "SkImage.h" |
| 17 #include "SkImageDecoder.h" | 16 #include "SkImageDecoder.h" |
| 18 #include "SkString.h" | 17 #include "SkString.h" |
| 19 | 18 |
| 20 // 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. |
| 21 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 " |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 error.reset(); | 87 error.reset(); |
| 89 | 88 |
| 90 bool useTiles = false; | 89 bool useTiles = false; |
| 91 const char* widthString = NULL; | 90 const char* widthString = NULL; |
| 92 const char* heightString = NULL; | 91 const char* heightString = NULL; |
| 93 bool isPowerOf2Mode = false; | 92 bool isPowerOf2Mode = false; |
| 94 bool isCopyMode = false; | 93 bool isCopyMode = false; |
| 95 const char* mode = NULL; | 94 const char* mode = NULL; |
| 96 | 95 |
| 97 #if SK_SUPPORT_GPU | 96 #if SK_SUPPORT_GPU |
| 98 GrContextOptions grContextOpts; | 97 GrContext::Options grContextOpts; |
| 99 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; | 98 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; |
| 100 #define RENDERER_ARGS (grContextOpts) | 99 #define RENDERER_ARGS (grContextOpts) |
| 101 #else | 100 #else |
| 102 #define RENDERER_ARGS () | 101 #define RENDERER_ARGS () |
| 103 #endif | 102 #endif |
| 104 | 103 |
| 105 SkAutoTUnref<sk_tools::PictureRenderer> renderer; | 104 SkAutoTUnref<sk_tools::PictureRenderer> renderer; |
| 106 if (FLAGS_mode.count() >= 1) { | 105 if (FLAGS_mode.count() >= 1) { |
| 107 mode = FLAGS_mode[0]; | 106 mode = FLAGS_mode[0]; |
| 108 if (0 == strcmp(mode, "record")) { | 107 if (0 == strcmp(mode, "record")) { |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { | 349 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { |
| 351 error.printf("--pipe and --bbh cannot be used together\n"); | 350 error.printf("--pipe and --bbh cannot be used together\n"); |
| 352 return NULL; | 351 return NULL; |
| 353 } | 352 } |
| 354 } | 353 } |
| 355 renderer->setBBoxHierarchyType(bbhType); | 354 renderer->setBBoxHierarchyType(bbhType); |
| 356 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); | 355 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); |
| 357 | 356 |
| 358 return renderer.detach(); | 357 return renderer.detach(); |
| 359 } | 358 } |
| OLD | NEW |