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

Unified Diff: bench/MipMapBench.cpp

Issue 1594533005: update mipbuilder bench to exercise all 4 procs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/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); )
« 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