OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2012 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef CopyTilesRenderer_DEFINED | |
9 #define CopyTilesRenderer_DEFINED | |
10 | |
11 #include "PictureRenderer.h" | |
12 #include "SkTypes.h" | |
13 | |
14 struct GrContextOptions; | |
15 class SkPicture; | |
16 class SkString; | |
17 | |
18 namespace sk_tools { | |
19 /** | |
20 * PictureRenderer that draws the picture and then extracts it into tiles.
For large pictures, | |
21 * it will divide the picture into large tiles and draw the picture once fo
r each large tile. | |
22 */ | |
23 class CopyTilesRenderer : public TiledPictureRenderer { | |
24 | |
25 public: | |
26 #if SK_SUPPORT_GPU | |
27 CopyTilesRenderer(const GrContextOptions &opts, int x, int y); | |
28 #else | |
29 CopyTilesRenderer(int x, int y); | |
30 #endif | |
31 virtual void init(const SkPicture* pict, | |
32 const SkString* writePath, | |
33 const SkString* mismatchPath, | |
34 const SkString* inputFilename, | |
35 bool useChecksumBasedFilenames, | |
36 bool useMultiPictureDraw) override; | |
37 | |
38 /** | |
39 * Similar to TiledPictureRenderer, this will draw a PNG for each tile.
However, the | |
40 * numbering (and actual tiles) will be different. | |
41 */ | |
42 bool render(SkBitmap** out) override; | |
43 | |
44 bool supportsTimingIndividualTiles() override { return false; } | |
45 | |
46 private: | |
47 int fXTilesPerLargeTile; | |
48 int fYTilesPerLargeTile; | |
49 | |
50 int fLargeTileWidth; | |
51 int fLargeTileHeight; | |
52 | |
53 SkString getConfigNameInternal() override; | |
54 | |
55 typedef TiledPictureRenderer INHERITED; | |
56 }; | |
57 } // sk_tools | |
58 #endif // CopyTilesRenderer_DEFINED | |
OLD | NEW |