diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-31 15:25:22 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-31 15:25:22 +0000 |
commit | 3e44e4d1beaf8e5fd6114ef392af5cab132b9f23 (patch) | |
tree | dfa39830704f2428a9b1b1b3452d2c40a8c725b6 /src/core | |
parent | 9732f62eaec427e0d4a8de06748ebb59450dfe31 (diff) |
fall through to cross-product if the y-max-baseline returns a degenerate line
(i.e. maxIndex == minIndex)
git-svn-id: http://skia.googlecode.com/svn/trunk@3119 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPath.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 08fdb9d65f..72a7d688df 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -2023,7 +2023,9 @@ bool SkPath::cheapComputeDirection(Direction* dir) const { if (pts[(index + 1) % n].fY == pts[index].fY) { int maxIndex; int minIndex = find_min_max_x_at_y(pts, index, n, &maxIndex); - // minIndex might == maxIndex, but that should be fine. + if (minIndex == maxIndex) { + goto TRY_CROSSPROD; + } SkASSERT(pts[minIndex].fY == pts[index].fY); SkASSERT(pts[maxIndex].fY == pts[index].fY); SkASSERT(pts[minIndex].fX <= pts[maxIndex].fX); @@ -2031,6 +2033,7 @@ bool SkPath::cheapComputeDirection(Direction* dir) const { // SkScalar, since we just want - or + to signal the direction. cross = minIndex - maxIndex; } else { + TRY_CROSSPROD: // Find a next and prev index to use for the cross-product test, // but we try to find pts that form non-zero vectors from pts[index] // |