diff options
author | mtklein <mtklein@chromium.org> | 2014-10-23 14:35:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-23 14:35:01 -0700 |
commit | 14e4d392d4ffa50c0ddf359a426668d1718d7f92 (patch) | |
tree | e600768b7f2d557b580f4d66d7c205803bbef51c /bench | |
parent | efd7d45fc0fc5f2b924c774c5d38ce546f35f3ca (diff) |
Revert "Revert of create shaderproc for nofilter-opaque-dx (patchset #7 id:120001 of https://codereview.chromium.org/664783004/)"
This reverts commit 430b795cc8a1cdbddd8fdc5511a3a523348937f7 and adds suppressions.
BUG=skia:
Review URL: https://codereview.chromium.org/673023002
Diffstat (limited to 'bench')
-rw-r--r-- | bench/BitmapBench.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp index efd6d96684..da2e829a4d 100644 --- a/bench/BitmapBench.cpp +++ b/bench/BitmapBench.cpp @@ -75,6 +75,7 @@ class BitmapBench : public Benchmark { const SkAlphaType fAlphaType; const bool fForceUpdate; //bitmap marked as dirty before each draw. forces bitmap to be updated on device cache const bool fIsVolatile; + const bool fDoScale; SkBitmap fBitmap; SkPaint fPaint; @@ -83,11 +84,12 @@ class BitmapBench : public Benchmark { enum { W = 128 }; enum { H = 128 }; public: - BitmapBench(SkColorType ct, SkAlphaType at, bool forceUpdate = false, bool isVolatile = false) + BitmapBench(SkColorType ct, SkAlphaType at, bool forceUpdate, bool isVolatile, bool doScale) : fColorType(ct) , fAlphaType(at) , fForceUpdate(forceUpdate) , fIsVolatile(isVolatile) + , fDoScale(doScale) {} protected: @@ -95,10 +97,15 @@ protected: fName.set("bitmap"); fName.appendf("_%s%s", sk_tool_utils::colortype_name(fColorType), kOpaque_SkAlphaType == fAlphaType ? "" : "_A"); - if (fForceUpdate) + if (fDoScale) { + fName.append("_scale"); + } + if (fForceUpdate) { fName.append("_update"); - if (fIsVolatile) + } + if (fIsVolatile) { fName.append("_volatile"); + } return fName.c_str(); } @@ -125,6 +132,9 @@ protected: } virtual void onDraw(const int loops, SkCanvas* canvas) { + if (fDoScale) { + canvas->scale(.99f, .99f); + } SkIPoint dim = this->getSize(); SkRandom rand; @@ -193,7 +203,7 @@ class FilterBitmapBench : public BitmapBench { public: FilterBitmapBench(SkColorType ct, SkAlphaType at, bool forceUpdate, bool isVolitile, uint32_t flags) - : INHERITED(ct, at, forceUpdate, isVolitile) + : INHERITED(ct, at, forceUpdate, isVolitile, false) , fFlags(flags) { } @@ -272,7 +282,7 @@ private: public: SourceAlphaBitmapBench(SourceAlpha alpha, SkColorType ct, bool forceUpdate = false, bool bitmapVolatile = false) - : INHERITED(ct, kPremul_SkAlphaType, forceUpdate, bitmapVolatile) + : INHERITED(ct, kPremul_SkAlphaType, forceUpdate, bitmapVolatile, false) , fSourceAlpha(alpha) { } @@ -349,13 +359,14 @@ private: typedef BitmapBench INHERITED; }; -DEF_BENCH( return new BitmapBench(kN32_SkColorType, kPremul_SkAlphaType); ) -DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType); ) -DEF_BENCH( return new BitmapBench(kRGB_565_SkColorType, kOpaque_SkAlphaType); ) -DEF_BENCH( return new BitmapBench(kIndex_8_SkColorType, kPremul_SkAlphaType); ) -DEF_BENCH( return new BitmapBench(kIndex_8_SkColorType, kOpaque_SkAlphaType); ) -DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, true); ) -DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, false); ) +DEF_BENCH( return new BitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, false); ) +DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, false, false, false); ) +DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, false, false, true); ) +DEF_BENCH( return new BitmapBench(kRGB_565_SkColorType, kOpaque_SkAlphaType, false, false, false); ) +DEF_BENCH( return new BitmapBench(kIndex_8_SkColorType, kPremul_SkAlphaType, false, false, false); ) +DEF_BENCH( return new BitmapBench(kIndex_8_SkColorType, kOpaque_SkAlphaType, false, false, false); ) +DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, true, false); ) +DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, false, false); ) // scale filter -> S32_opaque_D32_filter_DX_{SSE2,SSSE3} and Fact9 is also for S32_D16_filter_DX_SSE2 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, kScale_Flag | kBilerp_Flag); ) |