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

Unified Diff: bench/MipMapBench.cpp

Issue 1589503006: test pow2 and non mipbuilders (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 137fbe47d5df659dcbba8162c34c8e7a8a26ae5b..d6ca4231ec1422e7ff82c6899c246dfefe8f4ca1 100644
--- a/bench/MipMapBench.cpp
+++ b/bench/MipMapBench.cpp
@@ -11,24 +11,28 @@
class MipMapBench: public Benchmark {
SkBitmap fBitmap;
+ SkString fName;
+ const int fN;
public:
- MipMapBench() {}
+ MipMapBench(int N) : fN(N) {
+ fName.printf("mipmap_build_%d", N);
+ }
protected:
bool isSuitableFor(Backend backend) override {
return kNonRendering_Backend == backend;
}
- const char* onGetName() override { return "mipmap_build"; }
+ const char* onGetName() override { return fName.c_str(); }
void onDelayedSetup() override {
- fBitmap.allocN32Pixels(1000, 1000, true);
+ fBitmap.allocN32Pixels(fN, fN, true);
fBitmap.eraseColor(SK_ColorWHITE); // so we don't read uninitialized memory
}
void onDraw(int loops, SkCanvas*) override {
- for (int i = 0; i < loops; i++) {
+ for (int i = 0; i < loops * 4; i++) {
SkMipMap::Build(fBitmap, nullptr)->unref();
}
}
@@ -37,4 +41,5 @@ private:
typedef Benchmark INHERITED;
};
-DEF_BENCH( return new MipMapBench; )
+DEF_BENCH( return new MipMapBench(511); )
+DEF_BENCH( return new MipMapBench(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