diff options
author | reed <reed@google.com> | 2016-01-15 07:41:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-15 07:41:07 -0800 |
commit | 3396fb5ccb7012a6a4907480454d1d743738a6b3 (patch) | |
tree | 44232b9dba3b3f0c92e4cda9e6b29bc09c6a73d6 | |
parent | 2a641eebf6d552e72dd7604b74dce640c15a3130 (diff) |
test pow2 and non mipbuilders
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1589503006
TBR=
Review URL: https://codereview.chromium.org/1589503006
-rw-r--r-- | bench/MipMapBench.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bench/MipMapBench.cpp b/bench/MipMapBench.cpp index 137fbe47d5..d6ca4231ec 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); ) |