Chromium Code Reviews| Index: bench/RectBench.cpp |
| diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp |
| index f793c8ff57124758c567ed33f3189dfccfe7c32d..e084ffda715f117ce41aec0f879cc32380fecc14 100644 |
| --- a/bench/RectBench.cpp |
| +++ b/bench/RectBench.cpp |
| @@ -114,6 +114,30 @@ private: |
| typedef RectBench INHERITED; |
| }; |
| +class NonOpaqueRectBench : public RectBench { |
|
bsalomon
2015/09/24 19:31:31
TransparentRectBench?
|
| +public: |
| + NonOpaqueRectBench() : INHERITED(1, 0) {} |
| + |
| +protected: |
| + void setupPaint(SkPaint* paint) override { |
| + this->INHERITED::setupPaint(paint); |
| + // draw non opaque rect |
| + paint->setAlpha(0x80); |
| + } |
| + |
| + const char* onGetName() override { |
| + fName.set(this->INHERITED::onGetName()); |
| + fName.prepend("nonopaque_"); |
| + return fName.c_str(); |
| + } |
| + |
| +private: |
| + SkString fName; |
| + |
| + typedef RectBench INHERITED; |
| +}; |
| + |
| + |
| class OvalBench : public RectBench { |
| public: |
| OvalBench(int shift, int stroke = 0) : RectBench(shift, stroke) {} |
| @@ -269,6 +293,8 @@ DEF_BENCH(return new PointsBench(SkCanvas::kPolygon_PointMode, "polygon");) |
| DEF_BENCH(return new SrcModeRectBench();) |
| +DEF_BENCH(return new NonOpaqueRectBench();) |
| + |
| /* init the blitmask bench |
| */ |
| DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, |