diff options
author | Brian Osman <brianosman@google.com> | 2017-07-12 11:14:26 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-12 20:20:41 +0000 |
commit | f0ca0e0844021d39466c5b69cc9afd195e353bba (patch) | |
tree | e2f7bb25b1006aea033b83a215a59c94055ab103 | |
parent | 0db1b53a849ae145a32cd1315c9f4f03430e90cb (diff) |
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 <caryclark@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
-rw-r--r-- | src/core/SkScan_Hairline.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; |