aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/cubicpaths.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2017-01-05 12:08:38 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-05 18:44:25 +0000
commitd4631986e6b3a668a4a86e54a0e0027b201188b9 (patch)
treee4ed62effeee10f6d8e3cc5393007391fe40821c /gm/cubicpaths.cpp
parentefcc41805b43347444b83c1705d3d60c8d0caa70 (diff)
ignore max curvature at end point
When a stroked cubic folds back on itself, the stroker draws a round join. If the max curvature is at the endpoint, skip the join. R=reed@google.com BUG=skia:6083 Change-Id: I45e429432fcec311fa1115058515639370fe9a16 Reviewed-on: https://skia-review.googlesource.com/6606 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'gm/cubicpaths.cpp')
-rw-r--r--gm/cubicpaths.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/gm/cubicpaths.cpp b/gm/cubicpaths.cpp
index abac5b2177..023316b658 100644
--- a/gm/cubicpaths.cpp
+++ b/gm/cubicpaths.cpp
@@ -426,6 +426,30 @@ DEF_SIMPLE_GM(bug5099, canvas, 50, 50) {
canvas->drawPath(path, p);
}
+DEF_SIMPLE_GM(bug6083, canvas, 100, 50) {
+ SkPaint p;
+ p.setColor(SK_ColorRED);
+ p.setAntiAlias(true);
+ p.setStyle(SkPaint::kStroke_Style);
+ p.setStrokeWidth(15);
+ canvas->translate(-500, -130);
+ SkPath path;
+ path.moveTo(500.988f, 155.200f);
+ path.lineTo(526.109f, 155.200f);
+ SkPoint p1 = { 526.109f, 155.200f };
+ SkPoint p2 = { 525.968f, 212.968f };
+ SkPoint p3 = { 526.109f, 241.840f };
+ path.cubicTo(p1, p2, p3);
+ canvas->drawPath(path, p);
+ canvas->translate(50, 0);
+ path.reset();
+ p2.set(525.968f, 213.172f);
+ path.moveTo(500.988f, 155.200f);
+ path.lineTo(526.109f, 155.200f);
+ path.cubicTo(p1, p2, p3);
+ canvas->drawPath(path, p);
+}
+
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return new CubicPathGM; )