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); 26 virtual void init(SkPicture* pict) SK_OVERRIDE; 27 28 /** 29 * Similar to TiledPictureRenderer, this will draw a PNG for each tile. However, the 30 * numbering (and actual tiles) will be different. 31 */ 32 virtual bool render(const SkString* path, SkBitmap** out) SK_OVERRIDE; 33 34 private: 35 int fXTilesPerLargeTile; 36 int fYTilesPerLargeTile; 37 38 int fLargeTileWidth; 39 int fLargeTileHeight; 40 41 virtual SkString getConfigNameInternal() SK_OVERRIDE; 42 43 typedef TiledPictureRenderer INHERITED; 44 }; 45 } // sk_tools 46 #endif // CopyTilesRenderer_DEFINED 47