Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2006)

Unified Diff: bench/SKPBench.cpp

Issue 982863003: Increase default tile sizes in nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698