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

Unified Diff: bench/SKPBench.cpp

Issue 1189863002: nanobench: split CPU and GPU .SKP tile sizes. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: update flags Created 5 years, 6 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 | tools/nanobench_flags.json » ('j') | 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 592d0428fd01f7c449dc91e7f9b0229366570ca4..757ee4655ed3d3bad777e7625941d04b96ab23b5 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -10,8 +10,12 @@
#include "SkMultiPictureDraw.h"
#include "SkSurface.h"
-DEFINE_int32(benchTileW, 1600, "Tile width used for SKP playback.");
-DEFINE_int32(benchTileH, 512, "Tile height used for SKP playback.");
+// These CPU tile sizes are not good per se, but they are similar to what Chrome uses.
+DEFINE_int32(CPUbenchTileW, 256, "Tile width used for CPU SKP playback.");
+DEFINE_int32(CPUbenchTileH, 256, "Tile height used for CPU SKP playback.");
+
+DEFINE_int32(GPUbenchTileW, 1600, "Tile width used for GPU SKP playback.");
+DEFINE_int32(GPUbenchTileH, 512, "Tile height used for GPU SKP playback.");
SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip, SkScalar scale,
bool useMultiPictureDraw)
@@ -44,8 +48,12 @@ void SKPBench::onPerCanvasPreDraw(SkCanvas* canvas) {
SkIRect bounds;
SkAssertResult(canvas->getClipDeviceBounds(&bounds));
- int tileW = SkTMin(FLAGS_benchTileW, bounds.width());
- int tileH = SkTMin(FLAGS_benchTileH, bounds.height());
+ const bool gpu = canvas->getGrContext() != nullptr;
+ int tileW = gpu ? FLAGS_GPUbenchTileW : FLAGS_CPUbenchTileW,
+ tileH = gpu ? FLAGS_GPUbenchTileH : FLAGS_CPUbenchTileH;
+
+ tileW = SkTMin(tileW, bounds.width());
+ tileH = SkTMin(tileH, bounds.height());
int xTiles = SkScalarCeilToInt(bounds.width() / SkIntToScalar(tileW));
int yTiles = SkScalarCeilToInt(bounds.height() / SkIntToScalar(tileH));
« no previous file with comments | « no previous file | tools/nanobench_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698