Index: bench/MipMapBench.cpp |
diff --git a/bench/MipMapBench.cpp b/bench/MipMapBench.cpp |
index d6ca4231ec1422e7ff82c6899c246dfefe8f4ca1..652524364b2de8acf63c35153784409fc252e90a 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); ) |