Index: bench/RectBench.cpp |
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp |
index f793c8ff57124758c567ed33f3189dfccfe7c32d..23fb7c50c26c5af12435ca4f28e216f1c739e231 100644 |
--- a/bench/RectBench.cpp |
+++ b/bench/RectBench.cpp |
@@ -114,6 +114,30 @@ private: |
typedef RectBench INHERITED; |
}; |
+class TransparentRectBench : public RectBench { |
+public: |
+ TransparentRectBench() : 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("transparent_"); |
+ 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 TransparentRectBench();) |
+ |
/* init the blitmask bench |
*/ |
DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, |