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
This commit is contained in:
parent
9732f62eae
commit
3e44e4d1be
@ -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]
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user