Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: tools/PictureRenderingFlags.cpp

Issue 1158433006: Store context options on caps. (Closed) Base URL: https://skia.googlesource.com/skia.git@onecaps
Patch Set: remove case statement accidentally checked in Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/PictureRenderer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/PictureRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698