Added an option to specify the tiling size to render_pictures.
With this change I should be able to start merging the rendering implementations of bench_pictures and render_pictures.
Review URL: https://codereview.appspot.com/6427061
git-svn-id: http://skia.googlecode.com/svn/trunk@4816 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 71f936e..5f3496c 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -33,6 +33,14 @@
void TiledPictureRenderer::init(const SkPicture& pict) {
deleteTiles();
+
+ if (fTileWidthPercentage > 0) {
+ fTileWidth = sk_float_ceil2int(fTileWidthPercentage * pict.width() / 100);
+ }
+ if (fTileHeightPercentage > 0) {
+ fTileHeight = sk_float_ceil2int(fTileHeightPercentage * pict.height() / 100);
+ }
+
setupTiles(pict);
}