diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-23 15:27:41 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-23 15:27:41 +0000 |
commit | 4fdbb229649caf74e5c1b55a1823926df903af34 (patch) | |
tree | 5f822b5335b213ce7f9857cac288e79e4f3cc8f9 /src/pathops/SkPathOpsCubic.cpp | |
parent | 672222e400ec10024106a394512ce864d5b839ea (diff) |
turn off debugging printfs
fix pathops issues 1417, 1418
be more rigorous about pulling intersections of lines to end points
rewrite cubic/line and quad/line intersections to share style
BUG=
Review URL: https://codereview.chromium.org/19543005
git-svn-id: http://skia.googlecode.com/svn/trunk@10270 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsCubic.cpp')
-rw-r--r-- | src/pathops/SkPathOpsCubic.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pathops/SkPathOpsCubic.cpp b/src/pathops/SkPathOpsCubic.cpp index 60dca44a27..5fbfeba50d 100644 --- a/src/pathops/SkPathOpsCubic.cpp +++ b/src/pathops/SkPathOpsCubic.cpp @@ -304,7 +304,7 @@ SkDPoint SkDCubic::top(double startT, double endT) const { int roots = FindExtrema(sub[0].fY, sub[1].fY, sub[2].fY, sub[3].fY, extremeTs); for (int index = 0; index < roots; ++index) { double t = startT + (endT - startT) * extremeTs[index]; - SkDPoint mid = xyAtT(t); + SkDPoint mid = ptAtT(t); if (topPt.fY > mid.fY || (topPt.fY == mid.fY && topPt.fX > mid.fX)) { topPt = mid; } @@ -313,7 +313,13 @@ SkDPoint SkDCubic::top(double startT, double endT) const { return topPt; } -SkDPoint SkDCubic::xyAtT(double t) const { +SkDPoint SkDCubic::ptAtT(double t) const { + if (0 == t) { + return fPts[0]; + } + if (1 == t) { + return fPts[3]; + } double one_t = 1 - t; double one_t2 = one_t * one_t; double a = one_t2 * one_t; |