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

Side by Side Diff: tools/PictureRenderingFlags.cpp

Issue 125083004: Support mesa config in render_pictures. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressing code review comments Created 6 years, 11 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 | Annotate | Revision Log
« 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 #include "PictureRenderer.h" 11 #include "PictureRenderer.h"
12 #include "picture_utils.h" 12 #include "picture_utils.h"
13 #include "SkCommandLineFlags.h" 13 #include "SkCommandLineFlags.h"
14 #include "SkData.h" 14 #include "SkData.h"
15 #include "SkImage.h" 15 #include "SkImage.h"
16 #include "SkImageDecoder.h" 16 #include "SkImageDecoder.h"
17 #include "SkString.h" 17 #include "SkString.h"
18 18
19 // 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.
20 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 "
21 "be used. Accepted values are: none, rtree, grid. " 21 "be used. Accepted values are: none, rtree, grid. "
22 "Not compatible with --pipe. With value " 22 "Not compatible with --pipe. With value "
23 "'grid', width and height must be specified. 'grid' can " 23 "'grid', width and height must be specified. 'grid' can "
24 "only be used with modes tile, record, and " 24 "only be used with modes tile, record, and "
25 "playbackCreation."); 25 "playbackCreation.");
26 // Although this config does not support all the same options as gm, the names s hould be kept 26 // Although this config does not support all the same options as gm, the names s hould be kept
27 // consistent. 27 // consistent.
28 DEFINE_string(config, "8888", "["
29 "8888"
30 #if SK_SUPPORT_GPU
31 "|gpu|msaa4|msaa16"
32 #endif
28 #if SK_ANGLE 33 #if SK_ANGLE
29 // ANGLE assumes GPU 34 // ANGLE assumes GPU
epoger 2014/01/06 18:27:41 you don't need the "ANGLE assumes GPU" comment any
rmistry 2014/01/06 18:33:25 Done.
30 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16|angle]: Use the correspond ing config."); 35 "|angle"
31 #elif SK_SUPPORT_GPU
32 DEFINE_string(config, "8888", "[8888|gpu|msaa4|msaa16]: Use the corresponding co nfig.");
33 #else
34 DEFINE_string(config, "8888", "[8888]: Use the corresponding config.");
35 #endif 36 #endif
37 #if SK_MESA
38 "|mesa"
39 #endif
40 "]: Use the corresponding config.");
36 41
37 DEFINE_bool(deferImageDecoding, false, "Defer decoding until drawing images. " 42 DEFINE_bool(deferImageDecoding, false, "Defer decoding until drawing images. "
38 "Has no effect if the provided skp does not have its images encoded. "); 43 "Has no effect if the provided skp does not have its images encoded. ");
39 DEFINE_string(mode, "simple", "Run in the corresponding mode:\n" 44 DEFINE_string(mode, "simple", "Run in the corresponding mode:\n"
40 "simple: Simple rendering.\n" 45 "simple: Simple rendering.\n"
41 "tile width height: Use tiles with the given dimensions or percent ages.\n" 46 "tile width height: Use tiles with the given dimensions or percent ages.\n"
42 "pow2tile minWidth height: Use tiles with widths that are all a po wer\n" 47 "pow2tile minWidth height: Use tiles with widths that are all a po wer\n"
43 "\tof two such that they minimize the amount of wasted tile space. \n" 48 "\tof two such that they minimize the amount of wasted tile space. \n"
44 "\tminWidth must be a power of two.\n" 49 "\tminWidth must be a power of two.\n"
45 "copyTile width height: Draw the picture, then copy into tiles. If the\n" 50 "copyTile width height: Draw the picture, then copy into tiles. If the\n"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 283 }
279 #if SK_ANGLE 284 #if SK_ANGLE
280 else if (0 == strcmp(FLAGS_config[0], "angle")) { 285 else if (0 == strcmp(FLAGS_config[0], "angle")) {
281 deviceType = sk_tools::PictureRenderer::kAngle_DeviceType; 286 deviceType = sk_tools::PictureRenderer::kAngle_DeviceType;
282 if (FLAGS_multi > 1) { 287 if (FLAGS_multi > 1) {
283 error.printf("Angle not compatible with multithreaded tiling.\n" ); 288 error.printf("Angle not compatible with multithreaded tiling.\n" );
284 return NULL; 289 return NULL;
285 } 290 }
286 } 291 }
287 #endif 292 #endif
293 #if SK_MESA
294 else if (0 == strcmp(FLAGS_config[0], "mesa")) {
295 deviceType = sk_tools::PictureRenderer::kMesa_DeviceType;
296 if (FLAGS_multi > 1) {
297 error.printf("Mesa not compatible with multithreaded tiling.\n") ;
298 return NULL;
299 }
300 }
301 #endif
288 #endif 302 #endif
289 else { 303 else {
290 error.printf("%s is not a valid mode for --config\n", FLAGS_config[0 ]); 304 error.printf("%s is not a valid mode for --config\n", FLAGS_config[0 ]);
291 return NULL; 305 return NULL;
292 } 306 }
293 renderer->setDeviceType(deviceType); 307 renderer->setDeviceType(deviceType);
294 #if SK_SUPPORT_GPU 308 #if SK_SUPPORT_GPU
295 renderer->setSampleCount(sampleCount); 309 renderer->setSampleCount(sampleCount);
296 #endif 310 #endif
297 } 311 }
(...skipping 28 matching lines...) Expand all
326 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType != bbhType) { 340 if (FLAGS_pipe && sk_tools::PictureRenderer::kNone_BBoxHierarchyType != bbhType) {
327 error.printf("--pipe and --bbh cannot be used together\n"); 341 error.printf("--pipe and --bbh cannot be used together\n");
328 return NULL; 342 return NULL;
329 } 343 }
330 } 344 }
331 renderer->setBBoxHierarchyType(bbhType); 345 renderer->setBBoxHierarchyType(bbhType);
332 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale)); 346 renderer->setScaleFactor(SkDoubleToScalar(FLAGS_scale));
333 347
334 return renderer.detach(); 348 return renderer.detach();
335 } 349 }
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