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