aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-01-15 18:47:38 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-15 18:47:38 -0800
commit0b64b98d8d5c86e31f7c2a14789b4d1537749020 (patch)
tree5868711df074bc2776ef870e03aa77819a7c19f7 /bench
parent32e0b4a34a2d461927056677e0ef99241e29df0d (diff)
update mipbuilder bench to exercise all 4 procs
Diffstat (limited to 'bench')
-rw-r--r--bench/MipMapBench.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/bench/MipMapBench.cpp b/bench/MipMapBench.cpp
index d6ca4231ec..652524364b 100644
--- a/bench/MipMapBench.cpp
+++ b/bench/MipMapBench.cpp
@@ -12,11 +12,11 @@
class MipMapBench: public Benchmark {
SkBitmap fBitmap;
SkString fName;
- const int fN;
+ const int fW, fH;
public:
- MipMapBench(int N) : fN(N) {
- fName.printf("mipmap_build_%d", N);
+ MipMapBench(int w, int h) : fW(w), fH(h) {
+ fName.printf("mipmap_build_%dx%d", w, h);
}
protected:
@@ -27,7 +27,7 @@ protected:
const char* onGetName() override { return fName.c_str(); }
void onDelayedSetup() override {
- fBitmap.allocN32Pixels(fN, fN, true);
+ fBitmap.allocN32Pixels(fW, fH, true);
fBitmap.eraseColor(SK_ColorWHITE); // so we don't read uninitialized memory
}
@@ -41,5 +41,10 @@ private:
typedef Benchmark INHERITED;
};
-DEF_BENCH( return new MipMapBench(511); )
-DEF_BENCH( return new MipMapBench(512); )
+// Build variants that exercise the width and heights being even or odd at each level, as the
+// impl specializes on each of these.
+//
+DEF_BENCH( return new MipMapBench(511, 511); )
+DEF_BENCH( return new MipMapBench(512, 511); )
+DEF_BENCH( return new MipMapBench(511, 512); )
+DEF_BENCH( return new MipMapBench(512, 512); )