OLD | NEW |
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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #else | 25 #else |
26 CopyTilesRenderer::CopyTilesRenderer(int x, int y) | 26 CopyTilesRenderer::CopyTilesRenderer(int x, int y) |
27 : fXTilesPerLargeTile(x) | 27 : fXTilesPerLargeTile(x) |
28 , fYTilesPerLargeTile(y) { } | 28 , fYTilesPerLargeTile(y) { } |
29 #endif | 29 #endif |
30 void CopyTilesRenderer::init(const SkPicture* pict, const SkString* writePat
h, | 30 void CopyTilesRenderer::init(const SkPicture* pict, const SkString* writePat
h, |
31 const SkString* mismatchPath, const SkString* i
nputFilename, | 31 const SkString* mismatchPath, const SkString* i
nputFilename, |
32 bool useChecksumBasedFilenames, bool useMultiPi
ctureDraw) { | 32 bool useChecksumBasedFilenames, bool useMultiPi
ctureDraw) { |
33 // Do not call INHERITED::init(), which would create a (potentially larg
e) canvas which is | 33 // Do not call INHERITED::init(), which would create a (potentially larg
e) canvas which is |
34 // not used by bench_pictures. | 34 // not used by bench_pictures. |
35 SkASSERT(pict != NULL); | 35 SkASSERT(pict != nullptr); |
36 // Only work with absolute widths (as opposed to percentages). | 36 // Only work with absolute widths (as opposed to percentages). |
37 SkASSERT(this->getTileWidth() != 0 && this->getTileHeight() != 0); | 37 SkASSERT(this->getTileWidth() != 0 && this->getTileHeight() != 0); |
38 fPicture.reset(pict)->ref(); | 38 fPicture.reset(pict)->ref(); |
39 this->CopyString(&fWritePath, writePath); | 39 this->CopyString(&fWritePath, writePath); |
40 this->CopyString(&fMismatchPath, mismatchPath); | 40 this->CopyString(&fMismatchPath, mismatchPath); |
41 this->CopyString(&fInputFilename, inputFilename); | 41 this->CopyString(&fInputFilename, inputFilename); |
42 fUseChecksumBasedFilenames = useChecksumBasedFilenames; | 42 fUseChecksumBasedFilenames = useChecksumBasedFilenames; |
43 fUseMultiPictureDraw = useMultiPictureDraw; | 43 fUseMultiPictureDraw = useMultiPictureDraw; |
44 this->buildBBoxHierarchy(); | 44 this->buildBBoxHierarchy(); |
45 // In order to avoid allocating a large canvas (particularly important f
or GPU), create one | 45 // In order to avoid allocating a large canvas (particularly important f
or GPU), create one |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 } | 110 } |
111 } | 111 } |
112 return success; | 112 return success; |
113 } | 113 } |
114 | 114 |
115 SkString CopyTilesRenderer::getConfigNameInternal() { | 115 SkString CopyTilesRenderer::getConfigNameInternal() { |
116 return SkString("copy_tiles"); | 116 return SkString("copy_tiles"); |
117 } | 117 } |
118 } | 118 } |
OLD | NEW |