scroggo@google.com | 4a26d9d | 2012-11-07 18:01:46 +0000 | [diff] [blame] | 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 | class SkPicture; |
| 15 | class SkString; |
| 16 | |
| 17 | namespace sk_tools { |
| 18 | /** |
| 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 for each large tile. |
| 21 | */ |
| 22 | class CopyTilesRenderer : public TiledPictureRenderer { |
| 23 | |
| 24 | public: |
| 25 | CopyTilesRenderer(int x, int y); |
commit-bot@chromium.org | 3f04517 | 2014-05-15 15:10:48 +0000 | [diff] [blame] | 26 | virtual void init(SkPicture* pict, const SkString* writePath, const SkString* mismatchPath, |
| 27 | const SkString* inputFilename, |
commit-bot@chromium.org | f5e315c | 2014-03-19 17:26:07 +0000 | [diff] [blame] | 28 | bool useChecksumBasedFilenames) SK_OVERRIDE; |
scroggo@google.com | 4a26d9d | 2012-11-07 18:01:46 +0000 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Similar to TiledPictureRenderer, this will draw a PNG for each tile. However, the |
| 32 | * numbering (and actual tiles) will be different. |
| 33 | */ |
commit-bot@chromium.org | f5e315c | 2014-03-19 17:26:07 +0000 | [diff] [blame] | 34 | virtual bool render(SkBitmap** out) SK_OVERRIDE; |
scroggo@google.com | 4a26d9d | 2012-11-07 18:01:46 +0000 | [diff] [blame] | 35 | |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 36 | virtual bool supportsTimingIndividualTiles() SK_OVERRIDE { return false; } |
| 37 | |
scroggo@google.com | 4a26d9d | 2012-11-07 18:01:46 +0000 | [diff] [blame] | 38 | private: |
| 39 | int fXTilesPerLargeTile; |
| 40 | int fYTilesPerLargeTile; |
| 41 | |
| 42 | int fLargeTileWidth; |
| 43 | int fLargeTileHeight; |
| 44 | |
| 45 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 46 | |
| 47 | typedef TiledPictureRenderer INHERITED; |
| 48 | }; |
| 49 | } // sk_tools |
| 50 | #endif // CopyTilesRenderer_DEFINED |