aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ClipMaskBench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bench/ClipMaskBench.cpp')
-rw-r--r--bench/ClipMaskBench.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/bench/ClipMaskBench.cpp b/bench/ClipMaskBench.cpp
index fc3cc16705..b3b98f2fed 100644
--- a/bench/ClipMaskBench.cpp
+++ b/bench/ClipMaskBench.cpp
@@ -66,3 +66,40 @@ DEF_BENCH(return new ClipMaskBench("picture", [](int size) -> sk_sp<SkImage> {
SkColorSpace::MakeSRGB());
});)
+/////////
+#include "SkSurface.h"
+#include "SkPath.h"
+
+class RasterTileBench : public Benchmark {
+ sk_sp<SkSurface> fSurf;
+ SkPath fPath;
+ SkString fName;
+public:
+ RasterTileBench() : fName("rastertile") {
+ int W = 2014 * 20;
+ int H = 20;
+ fSurf = SkSurface::MakeRasterN32Premul(W, H);
+
+ fPath.moveTo(0, 0);
+ fPath.cubicTo(20, 10, 10, 15, 30, 5);
+ }
+
+protected:
+ const char* onGetName() override { return fName.c_str(); }
+
+ void onDraw(int loops, SkCanvas* canvas) override {
+ SkPaint paint;
+ paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStrokeWidth(1.1f);
+ paint.setAntiAlias(true);
+
+ for (int i = 0; i < loops; ++i) {
+ for (int j = 0; j < 1000; ++j) {
+ fSurf->getCanvas()->drawPath(fPath, paint);
+ }
+ }
+ }
+
+private:
+};
+DEF_BENCH(return new RasterTileBench;)