Allow bench_pictures to have its viewport set on the command line.
Instead of drawing the entire (potentially very large) picture, only
draw one viewport's worth.
example:
bench_pictures <skp directory> --viewport 640 480
BUG=https://code.google.com/p/skia/issues/detail?id=1007
Review URL: https://codereview.appspot.com/6943052
git-svn-id: http://skia.googlecode.com/svn/trunk@6799 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/CopyTilesRenderer.cpp b/tools/CopyTilesRenderer.cpp
index 553209c..0df43bb 100644
--- a/tools/CopyTilesRenderer.cpp
+++ b/tools/CopyTilesRenderer.cpp
@@ -38,8 +38,8 @@
int i = 0;
bool success = true;
SkBitmap dst;
- for (int x = 0; x < fPicture->width(); x += fLargeTileWidth) {
- for (int y = 0; y < fPicture->height(); y += fLargeTileHeight) {
+ for (int x = 0; x < this->getViewWidth(); x += fLargeTileWidth) {
+ for (int y = 0; y < this->getViewHeight(); y += fLargeTileHeight) {
SkAutoCanvasRestore autoRestore(fCanvas, true);
fCanvas->translate(SkIntToScalar(-x), SkIntToScalar(-y));
// Draw the picture