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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 widthString = FLAGS_mode[1]; | 124 widthString = FLAGS_mode[1]; |
125 if (FLAGS_mode.count() < 3) { | 125 if (FLAGS_mode.count() < 3) { |
126 error.printf("Missing height for --mode %s\n", mode); | 126 error.printf("Missing height for --mode %s\n", mode); |
127 return NULL; | 127 return NULL; |
128 } | 128 } |
129 | 129 |
130 heightString = FLAGS_mode[2]; | 130 heightString = FLAGS_mode[2]; |
131 } else if (0 == strcmp(mode, "playbackCreation") && kBench_PictureTool =
= tool) { | 131 } else if (0 == strcmp(mode, "playbackCreation") && kBench_PictureTool =
= tool) { |
132 renderer.reset(SkNEW_ARGS(sk_tools::PlaybackCreationRenderer, RENDER
ER_ARGS)); | 132 renderer.reset(SkNEW_ARGS(sk_tools::PlaybackCreationRenderer, RENDER
ER_ARGS)); |
133 // undocumented | 133 // undocumented |
134 } else if (0 == strcmp(mode, "gatherPixelRefs") && kBench_PictureTool ==
tool) { | |
135 #if SK_SUPPORT_GPU | |
136 renderer.reset(sk_tools::CreateGatherPixelRefsRenderer(grContextOpts
)); | |
137 #else | |
138 renderer.reset(sk_tools::CreateGatherPixelRefsRenderer()); | |
139 #endif | |
140 } else if (0 == strcmp(mode, "rerecord") && kRender_PictureTool == tool)
{ | 134 } else if (0 == strcmp(mode, "rerecord") && kRender_PictureTool == tool)
{ |
141 renderer.reset(SkNEW_ARGS(sk_tools::RecordPictureRenderer, RENDERER_
ARGS)); | 135 renderer.reset(SkNEW_ARGS(sk_tools::RecordPictureRenderer, RENDERER_
ARGS)); |
142 } else if (0 == strcmp(mode, "simple")) { | 136 } else if (0 == strcmp(mode, "simple")) { |
143 // Allow 'mode' to be set to 'simple', but do not create a renderer,
so we can | 137 // Allow 'mode' to be set to 'simple', but do not create a renderer,
so we can |
144 // ensure that pipe does not override a mode besides simple. The ren
derer will | 138 // ensure that pipe does not override a mode besides simple. The ren
derer will |
145 // be created below. | 139 // be created below. |
146 } else { | 140 } else { |
147 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); |
148 return NULL; | 142 return NULL; |
149 } | 143 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { | 349 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
bbhType) { |
356 error.printf("--pipe and --bbh cannot be used together\n"); | 350 error.printf("--pipe and --bbh cannot be used together\n"); |
357 return NULL; | 351 return NULL; |
358 } | 352 } |
359 } | 353 } |
360 renderer->setBBoxHierarchyType(bbhType); | 354 renderer->setBBoxHierarchyType(bbhType); |
361 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); | 355 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); |
362 | 356 |
363 return renderer.detach(); | 357 return renderer.detach(); |
364 } | 358 } |
OLD | NEW |