From f0ca0e0844021d39466c5b69cc9afd195e353bba Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 12 Jul 2017 11:14:26 -0400 Subject: Extend final point in closed degenerate hairline segments For single-contour paths (MLZ), the close is ignored during iteration, and we instead process the 'Done', which does extend in both directions. But if there's a second contour (MLZM), then we process the 'Close', and only extend the degenerate segment in one direction. Depending on where the path was positioned (relative to pixel centers), this led to some contours not drawing at all. Bug: skia: Change-Id: I88aeaecc94c0e69532479e50920ba2e0cc6f4bda Reviewed-on: https://skia-review.googlesource.com/22520 Reviewed-by: Cary Clark Commit-Queue: Brian Osman --- src/core/SkScan_Hairline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp index ce3fe2b604..84278f4182 100644 --- a/src/core/SkScan_Hairline.cpp +++ b/src/core/SkScan_Hairline.cpp @@ -447,7 +447,8 @@ void extend_pts(SkPath::Verb prevVerb, SkPath::Verb nextVerb, SkPoint* pts, int ++first; } while (++controls < ptCount); } - if (SkPath::kMove_Verb == nextVerb || SkPath::kDone_Verb == nextVerb) { + if (SkPath::kMove_Verb == nextVerb || SkPath::kDone_Verb == nextVerb + || SkPath::kClose_Verb == nextVerb) { SkPoint* last = &pts[ptCount - 1]; SkPoint* ctrl = last; int controls = ptCount - 1; -- cgit v1.2.3