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

Unified Diff: bench/RectBench.cpp

Issue 1363663004: stop scaling loops and improve warmup bench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: transparent Created 5 years, 3 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 | tools/VisualBench/VisualLightweightBenchModule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | tools/VisualBench/VisualLightweightBenchModule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698