diff options
author | caryclark <caryclark@google.com> | 2015-12-14 08:38:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-14 08:38:09 -0800 |
commit | 9aacd9029c7076d5c0f0e62338b82ce91de68ef9 (patch) | |
tree | b14cac7ed0c2bd12b879f069cd5603f0e60fee0b /src/core/SkCubicClipper.cpp | |
parent | b11c4ff668d638afa81503623ae8c82afb57a8e1 (diff) |
If a point is on a path edge, it's in the path, at least for all cases where the path edge is not canceled with another edge through coincidence.
Add test cases for edges and conics, and make sure it all works.
R=reed@google.com
BUG=skia:4669,4265
Review URL: https://codereview.chromium.org/1517883002
Diffstat (limited to 'src/core/SkCubicClipper.cpp')
-rw-r--r-- | src/core/SkCubicClipper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkCubicClipper.cpp b/src/core/SkCubicClipper.cpp index 81ef18de7a..469fc222e3 100644 --- a/src/core/SkCubicClipper.cpp +++ b/src/core/SkCubicClipper.cpp @@ -20,7 +20,7 @@ void SkCubicClipper::setClip(const SkIRect& clip) { } -static bool chopMonoCubicAtY(SkPoint pts[4], SkScalar y, SkScalar* t) { +bool SkCubicClipper::ChopMonoAtY(const SkPoint pts[4], SkScalar y, SkScalar* t) { SkScalar ycrv[4]; ycrv[0] = pts[0].fY - y; ycrv[1] = pts[1].fY - y; @@ -131,7 +131,7 @@ bool SkCubicClipper::clipCubic(const SkPoint srcPts[4], SkPoint dst[4]) { SkPoint tmp[7]; // for SkChopCubicAt // are we partially above - if (dst[0].fY < ctop && chopMonoCubicAtY(dst, ctop, &t)) { + if (dst[0].fY < ctop && ChopMonoAtY(dst, ctop, &t)) { SkChopCubicAt(dst, tmp, t); dst[0] = tmp[3]; dst[1] = tmp[4]; @@ -139,7 +139,7 @@ bool SkCubicClipper::clipCubic(const SkPoint srcPts[4], SkPoint dst[4]) { } // are we partially below - if (dst[3].fY > cbot && chopMonoCubicAtY(dst, cbot, &t)) { + if (dst[3].fY > cbot && ChopMonoAtY(dst, cbot, &t)) { SkChopCubicAt(dst, tmp, t); dst[1] = tmp[1]; dst[2] = tmp[2]; |