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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 renderer.reset(SkNEW(sk_tools::PlaybackCreationRenderer)); | 128 renderer.reset(SkNEW(sk_tools::PlaybackCreationRenderer)); |
129 gridSupported = true; | 129 gridSupported = true; |
130 // undocumented | 130 // undocumented |
131 } else if (0 == strcmp(mode, "gatherPixelRefs") && kBench_PictureTool ==
tool) { | 131 } else if (0 == strcmp(mode, "gatherPixelRefs") && kBench_PictureTool ==
tool) { |
132 renderer.reset(sk_tools::CreateGatherPixelRefsRenderer()); | 132 renderer.reset(sk_tools::CreateGatherPixelRefsRenderer()); |
133 } else if (0 == strcmp(mode, "rerecord") && kRender_PictureTool == tool)
{ | 133 } else if (0 == strcmp(mode, "rerecord") && kRender_PictureTool == tool)
{ |
134 renderer.reset(SkNEW(sk_tools::RecordPictureRenderer)); | 134 renderer.reset(SkNEW(sk_tools::RecordPictureRenderer)); |
135 // Allow 'mode' to be set to 'simple', but do not create a renderer, so
we can | 135 // Allow 'mode' to be set to 'simple', but do not create a renderer, so
we can |
136 // ensure that pipe does not override a mode besides simple. The rendere
r will | 136 // ensure that pipe does not override a mode besides simple. The rendere
r will |
137 // be created below. | 137 // be created below. |
138 } else if (0 != strcmp(mode, "simple")) { | 138 } else if (0 == strcmp(mode, "simple")) { |
| 139 gridSupported = true; |
| 140 } else { |
139 error.printf("%s is not a valid mode for --mode\n", mode); | 141 error.printf("%s is not a valid mode for --mode\n", mode); |
140 return NULL; | 142 return NULL; |
141 } | 143 } |
142 } | 144 } |
143 | 145 |
144 if (useTiles) { | 146 if (useTiles) { |
145 SkASSERT(NULL == renderer); | 147 SkASSERT(NULL == renderer); |
146 SkAutoTUnref<sk_tools::TiledPictureRenderer> tiledRenderer; | 148 SkAutoTUnref<sk_tools::TiledPictureRenderer> tiledRenderer; |
147 if (isCopyMode) { | 149 if (isCopyMode) { |
148 int xTiles = -1; | 150 int xTiles = -1; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { | 368 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { |
367 error.printf("--pipe and --bbh cannot be used together\n"); | 369 error.printf("--pipe and --bbh cannot be used together\n"); |
368 return NULL; | 370 return NULL; |
369 } | 371 } |
370 } | 372 } |
371 renderer->setBBoxHierarchyType(bbhType); | 373 renderer->setBBoxHierarchyType(bbhType); |
372 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); | 374 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); |
373 | 375 |
374 return renderer.detach(); | 376 return renderer.detach(); |
375 } | 377 } |
OLD | NEW |