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" |
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 CopyTilesRenderer::CopyTilesRenderer(int x, int y) | 19 CopyTilesRenderer::CopyTilesRenderer(int x, int y) |
20 : fXTilesPerLargeTile(x) | 20 : fXTilesPerLargeTile(x) |
21 , fYTilesPerLargeTile(y) { | 21 , fYTilesPerLargeTile(y) { |
22 } | 22 } |
23 void CopyTilesRenderer::init(SkPicture* pict, const SkString* writePath, | 23 void CopyTilesRenderer::init(const SkPicture* pict, const SkString* writePat
h, |
24 const SkString* mismatchPath, const SkString* i
nputFilename, | 24 const SkString* mismatchPath, const SkString* i
nputFilename, |
25 bool useChecksumBasedFilenames) { | 25 bool useChecksumBasedFilenames) { |
26 // Do not call INHERITED::init(), which would create a (potentially larg
e) canvas which is | 26 // Do not call INHERITED::init(), which would create a (potentially larg
e) canvas which is |
27 // not used by bench_pictures. | 27 // not used by bench_pictures. |
28 SkASSERT(pict != NULL); | 28 SkASSERT(pict != NULL); |
29 // Only work with absolute widths (as opposed to percentages). | 29 // Only work with absolute widths (as opposed to percentages). |
30 SkASSERT(this->getTileWidth() != 0 && this->getTileHeight() != 0); | 30 SkASSERT(this->getTileWidth() != 0 && this->getTileHeight() != 0); |
31 fPicture.reset(pict)->ref(); | 31 fPicture.reset(pict)->ref(); |
32 this->CopyString(&fWritePath, writePath); | 32 this->CopyString(&fWritePath, writePath); |
33 this->CopyString(&fMismatchPath, mismatchPath); | 33 this->CopyString(&fMismatchPath, mismatchPath); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
96 return success; | 96 return success; |
97 } | 97 } |
98 | 98 |
99 SkString CopyTilesRenderer::getConfigNameInternal() { | 99 SkString CopyTilesRenderer::getConfigNameInternal() { |
100 return SkString("copy_tiles"); | 100 return SkString("copy_tiles"); |
101 } | 101 } |
102 } | 102 } |
OLD | NEW |