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

Side by Side Diff: tools/CopyTilesRenderer.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/CopyTilesRenderer.h ('k') | tools/PictureRenderer.h » ('j') | 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 "picture_utils.h" 8 #include "picture_utils.h"
9 #include "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkDevice.h" 11 #include "SkDevice.h"
12 #include "SkImageEncoder.h" 12 #include "SkImageEncoder.h"
13 #include "SkPicture.h" 13 #include "SkPicture.h"
14 #include "SkPixelRef.h" 14 #include "SkPixelRef.h"
15 #include "SkRect.h" 15 #include "SkRect.h"
16 #include "SkString.h" 16 #include "SkString.h"
17 17
18 namespace sk_tools { 18 namespace sk_tools {
19 #if SK_SUPPORT_GPU
20 CopyTilesRenderer::CopyTilesRenderer(const GrContext::Options& opts, int x, int y)
21 : INHERITED(opts)
22 , fXTilesPerLargeTile(x)
23 , fYTilesPerLargeTile(y) { }
24 #else
19 CopyTilesRenderer::CopyTilesRenderer(int x, int y) 25 CopyTilesRenderer::CopyTilesRenderer(int x, int y)
20 : fXTilesPerLargeTile(x) 26 : fXTilesPerLargeTile(x)
21 , fYTilesPerLargeTile(y) { 27 , fYTilesPerLargeTile(y) { }
22 } 28 #endif
23 void CopyTilesRenderer::init(const SkPicture* pict, const SkString* writePat h, 29 void CopyTilesRenderer::init(const SkPicture* pict, const SkString* writePat h,
24 const SkString* mismatchPath, const SkString* i nputFilename, 30 const SkString* mismatchPath, const SkString* i nputFilename,
25 bool useChecksumBasedFilenames) { 31 bool useChecksumBasedFilenames) {
26 // Do not call INHERITED::init(), which would create a (potentially larg e) canvas which is 32 // Do not call INHERITED::init(), which would create a (potentially larg e) canvas which is
27 // not used by bench_pictures. 33 // not used by bench_pictures.
28 SkASSERT(pict != NULL); 34 SkASSERT(pict != NULL);
29 // Only work with absolute widths (as opposed to percentages). 35 // Only work with absolute widths (as opposed to percentages).
30 SkASSERT(this->getTileWidth() != 0 && this->getTileHeight() != 0); 36 SkASSERT(this->getTileWidth() != 0 && this->getTileHeight() != 0);
31 fPicture.reset(pict)->ref(); 37 fPicture.reset(pict)->ref();
32 this->CopyString(&fWritePath, writePath); 38 this->CopyString(&fWritePath, writePath);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 99 }
94 } 100 }
95 } 101 }
96 return success; 102 return success;
97 } 103 }
98 104
99 SkString CopyTilesRenderer::getConfigNameInternal() { 105 SkString CopyTilesRenderer::getConfigNameInternal() {
100 return SkString("copy_tiles"); 106 return SkString("copy_tiles");
101 } 107 }
102 } 108 }
OLDNEW
« no previous file with comments | « tools/CopyTilesRenderer.h ('k') | tools/PictureRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698