Index: bench/SKPBench.cpp |
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp |
index 800890265e647f38ce02b8f00c55cb4595676b16..3f521799fa0d27af6e8f7a174137e1904df37e5d 100644 |
--- a/bench/SKPBench.cpp |
+++ b/bench/SKPBench.cpp |
@@ -10,7 +10,8 @@ |
#include "SkMultiPictureDraw.h" |
#include "SkSurface.h" |
-DEFINE_int32(benchTile, 256, "Tile dimension used for SKP playback."); |
+DEFINE_int32(benchTileW, 1600, "Tile width used for SKP playback."); |
+DEFINE_int32(benchTileH, 512, "Tile height used for SKP playback."); |
SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip, SkScalar scale, |
bool useMultiPictureDraw) |
@@ -43,17 +44,20 @@ void SKPBench::onPerCanvasPreDraw(SkCanvas* canvas) { |
SkIRect bounds; |
SkAssertResult(canvas->getClipDeviceBounds(&bounds)); |
- int xTiles = SkScalarCeilToInt(bounds.width() / SkIntToScalar(FLAGS_benchTile)); |
- int yTiles = SkScalarCeilToInt(bounds.height() / SkIntToScalar(FLAGS_benchTile)); |
+ int tileW = SkTMin(FLAGS_benchTileW, bounds.width()); |
+ int tileH = SkTMin(FLAGS_benchTileH, bounds.height()); |
+ |
+ int xTiles = SkScalarCeilToInt(bounds.width() / SkIntToScalar(tileW)); |
+ int yTiles = SkScalarCeilToInt(bounds.height() / SkIntToScalar(tileH)); |
fSurfaces.setReserve(xTiles * yTiles); |
fTileRects.setReserve(xTiles * yTiles); |
- SkImageInfo ii = canvas->imageInfo().makeWH(FLAGS_benchTile, FLAGS_benchTile); |
+ SkImageInfo ii = canvas->imageInfo().makeWH(tileW, tileH); |
- for (int y = bounds.fTop; y < bounds.fBottom; y += FLAGS_benchTile) { |
- for (int x = bounds.fLeft; x < bounds.fRight; x += FLAGS_benchTile) { |
- const SkIRect tileRect = SkIRect::MakeXYWH(x, y, FLAGS_benchTile, FLAGS_benchTile); |
+ for (int y = bounds.fTop; y < bounds.fBottom; y += tileH) { |
+ for (int x = bounds.fLeft; x < bounds.fRight; x += tileW) { |
+ const SkIRect tileRect = SkIRect::MakeXYWH(x, y, tileW, tileH); |
*fTileRects.append() = tileRect; |
*fSurfaces.push() = canvas->newSurface(ii); |