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

Unified Diff: gm/arcto.cpp

Issue 1805963002: allow one zero length dash (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dash nanobench Created 4 years, 9 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 | « bench/DashBench.cpp ('k') | gm/dashing.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/arcto.cpp
diff --git a/gm/arcto.cpp b/gm/arcto.cpp
index cd26eef35a21f5b450f7b1b0c3a3b7af0db05dcf..67387cb27df060f129a4c4cbbafe1b9a6f73b620 100644
--- a/gm/arcto.cpp
+++ b/gm/arcto.cpp
@@ -205,3 +205,24 @@ DEF_SIMPLE_GM(bug593049, canvas, 300, 300) {
canvas->drawPath(p, paint);
}
+
+#include "SkDashPathEffect.h"
+#include "SkPathMeasure.h"
+
+DEF_SIMPLE_GM(bug583299, canvas, 300, 300) {
+ const char* d="M60,60 A50,50 0 0 0 160,60 A50,50 0 0 0 60,60z";
+ SkPaint p;
+ p.setStyle(SkPaint::kStroke_Style);
+ p.setStrokeWidth(100);
+ p.setAntiAlias(true);
+ p.setColor(0xFF008200);
+ p.setStrokeCap(SkPaint::kSquare_Cap);
+ SkPath path;
+ SkParsePath::FromSVGString(d, &path);
+ SkPathMeasure meas(path, false);
+ SkScalar length = meas.getLength();
+ SkScalar intervals[] = {0, length };
+ int intervalCount = (int) SK_ARRAY_COUNT(intervals);
+ p.setPathEffect(SkDashPathEffect::Create(intervals, intervalCount, 0))->unref();
+ canvas->drawPath(path, p);
+}
« no previous file with comments | « bench/DashBench.cpp ('k') | gm/dashing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698