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

Side by Side Diff: tools/render_pictures_main.cpp

Issue 464423003: Add flag to bench/render pictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/bbh_shootout.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 2012 Google Inc. 2 * Copyright 2012 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 "LazyDecodeBitmap.h" 8 #include "LazyDecodeBitmap.h"
9 #include "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 sk_tools::PictureRenderer* referenceRenderer; 285 sk_tools::PictureRenderer* referenceRenderer;
286 // If the renderer uses a BBoxHierarchy, then the reference renderer 286 // If the renderer uses a BBoxHierarchy, then the reference renderer
287 // will be the same renderer, without the bbh. 287 // will be the same renderer, without the bbh.
288 AutoRestoreBbhType arbbh; 288 AutoRestoreBbhType arbbh;
289 if (sk_tools::PictureRenderer::kNone_BBoxHierarchyType != 289 if (sk_tools::PictureRenderer::kNone_BBoxHierarchyType !=
290 renderer.getBBoxHierarchyType()) { 290 renderer.getBBoxHierarchyType()) {
291 referenceRenderer = &renderer; 291 referenceRenderer = &renderer;
292 referenceRenderer->ref(); // to match auto unref below 292 referenceRenderer->ref(); // to match auto unref below
293 arbbh.set(referenceRenderer, sk_tools::PictureRenderer::kNone_BBoxHi erarchyType); 293 arbbh.set(referenceRenderer, sk_tools::PictureRenderer::kNone_BBoxHi erarchyType);
294 } else { 294 } else {
295 #if SK_SUPPORT_GPU
296 referenceRenderer = SkNEW_ARGS(sk_tools::SimplePictureRenderer,
297 (renderer.getGrContextOptions()));
298 #else
295 referenceRenderer = SkNEW(sk_tools::SimplePictureRenderer); 299 referenceRenderer = SkNEW(sk_tools::SimplePictureRenderer);
300 #endif
296 } 301 }
297 SkAutoTUnref<sk_tools::PictureRenderer> aurReferenceRenderer(referenceRe nderer); 302 SkAutoTUnref<sk_tools::PictureRenderer> aurReferenceRenderer(referenceRe nderer);
298 303
299 success = render_picture_internal(inputPath, NULL, NULL, *referenceRende rer, 304 success = render_picture_internal(inputPath, NULL, NULL, *referenceRende rer,
300 &referenceBitmap); 305 &referenceBitmap);
301 306
302 if (!success || NULL == referenceBitmap || NULL == referenceBitmap->getP ixels()) { 307 if (!success || NULL == referenceBitmap || NULL == referenceBitmap->getP ixels()) {
303 SkDebugf("Failed to draw the reference picture.\n"); 308 SkDebugf("Failed to draw the reference picture.\n");
304 SkDELETE(bitmap); 309 SkDELETE(bitmap);
305 SkDELETE(referenceBitmap); 310 SkDELETE(referenceBitmap);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
490 } 495 }
491 return 0; 496 return 0;
492 } 497 }
493 498
494 #if !defined SK_BUILD_FOR_IOS 499 #if !defined SK_BUILD_FOR_IOS
495 int main(int argc, char * const argv[]) { 500 int main(int argc, char * const argv[]) {
496 return tool_main(argc, (char**) argv); 501 return tool_main(argc, (char**) argv);
497 } 502 }
498 #endif 503 #endif
OLDNEW
« no previous file with comments | « tools/bbh_shootout.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698