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

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: 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..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,
« 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