Zero length lines may have caps, but do not need joins.
Check to see if the point is preceeded or followed
by a line with a computable tangent before adding the join.
R=reed@google.com
BUG=566075
Review URL: https://codereview.chromium.org/1504043002
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index aa2db9c..303d4a5 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -210,6 +210,32 @@
canvas->drawPath(path, p);
}
+DEF_SIMPLE_GM(zerolinestroke, canvas, 90, 120) {
+ SkPaint paint;
+ paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStrokeWidth(20);
+ paint.setAntiAlias(true);
+ paint.setStrokeCap(SkPaint::kRound_Cap);
+
+ SkPath path;
+ path.moveTo(30, 90);
+ path.lineTo(30, 90);
+ path.lineTo(60, 90);
+ path.lineTo(60, 90);
+ canvas->drawPath(path, paint);
+
+ path.reset();
+ path.moveTo(30, 30);
+ path.lineTo(60, 30);
+ canvas->drawPath(path, paint);
+
+ path.reset();
+ path.moveTo(30, 60);
+ path.lineTo(30, 60);
+ path.lineTo(60, 60);
+ canvas->drawPath(path, paint);
+}
+
class Strokes2GM : public skiagm::GM {
SkPath fPath;
protected: