| 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 #ifndef CopyTilesRenderer_DEFINED | 8 #ifndef CopyTilesRenderer_DEFINED |
| 9 #define CopyTilesRenderer_DEFINED | 9 #define CopyTilesRenderer_DEFINED |
| 10 | 10 |
| 11 #include "PictureRenderer.h" | 11 #include "PictureRenderer.h" |
| 12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
| 13 | 13 |
| 14 class SkPicture; | 14 class SkPicture; |
| 15 class SkString; | 15 class SkString; |
| 16 | 16 |
| 17 namespace sk_tools { | 17 namespace sk_tools { |
| 18 /** | 18 /** |
| 19 * PictureRenderer that draws the picture and then extracts it into tiles.
For large pictures, | 19 * PictureRenderer that draws the picture and then extracts it into tiles.
For large pictures, |
| 20 * it will divide the picture into large tiles and draw the picture once fo
r each large tile. | 20 * it will divide the picture into large tiles and draw the picture once fo
r each large tile. |
| 21 */ | 21 */ |
| 22 class CopyTilesRenderer : public TiledPictureRenderer { | 22 class CopyTilesRenderer : public TiledPictureRenderer { |
| 23 | 23 |
| 24 public: | 24 public: |
| 25 CopyTilesRenderer(int x, int y); | 25 CopyTilesRenderer(int x, int y); |
| 26 virtual void init(SkPicture* pict, const SkString* writePath, const SkSt
ring* mismatchPath, | 26 virtual void init(const SkPicture* pict, |
| 27 const SkString* writePath, |
| 28 const SkString* mismatchPath, |
| 27 const SkString* inputFilename, | 29 const SkString* inputFilename, |
| 28 bool useChecksumBasedFilenames) SK_OVERRIDE; | 30 bool useChecksumBasedFilenames) SK_OVERRIDE; |
| 29 | 31 |
| 30 /** | 32 /** |
| 31 * Similar to TiledPictureRenderer, this will draw a PNG for each tile.
However, the | 33 * Similar to TiledPictureRenderer, this will draw a PNG for each tile.
However, the |
| 32 * numbering (and actual tiles) will be different. | 34 * numbering (and actual tiles) will be different. |
| 33 */ | 35 */ |
| 34 virtual bool render(SkBitmap** out) SK_OVERRIDE; | 36 virtual bool render(SkBitmap** out) SK_OVERRIDE; |
| 35 | 37 |
| 36 virtual bool supportsTimingIndividualTiles() SK_OVERRIDE { return false;
} | 38 virtual bool supportsTimingIndividualTiles() SK_OVERRIDE { return false;
} |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 int fXTilesPerLargeTile; | 41 int fXTilesPerLargeTile; |
| 40 int fYTilesPerLargeTile; | 42 int fYTilesPerLargeTile; |
| 41 | 43 |
| 42 int fLargeTileWidth; | 44 int fLargeTileWidth; |
| 43 int fLargeTileHeight; | 45 int fLargeTileHeight; |
| 44 | 46 |
| 45 virtual SkString getConfigNameInternal() SK_OVERRIDE; | 47 virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 46 | 48 |
| 47 typedef TiledPictureRenderer INHERITED; | 49 typedef TiledPictureRenderer INHERITED; |
| 48 }; | 50 }; |
| 49 } // sk_tools | 51 } // sk_tools |
| 50 #endif // CopyTilesRenderer_DEFINED | 52 #endif // CopyTilesRenderer_DEFINED |
| OLD | NEW |