Index: src/pathops/SkDCubicIntersection.cpp |
diff --git a/src/pathops/SkDCubicIntersection.cpp b/src/pathops/SkDCubicIntersection.cpp |
index 1c237d9cf12fbebdb072be8a2feb3e46a1b06abc..9d83242eda6085171615d47af598bcd65fb019dd 100644 |
--- a/src/pathops/SkDCubicIntersection.cpp |
+++ b/src/pathops/SkDCubicIntersection.cpp |
@@ -681,11 +681,17 @@ int SkIntersections::intersect(const SkDCubic& c) { |
if (c.endsAreExtremaInXOrY()) { |
return false; |
} |
+ // OPTIMIZATION: could quick reject if neither end point tangent ray intersected the line |
+ // segment formed by the opposite end point to the control point |
(void) intersect(c, c); |
if (used() > 0) { |
- SkASSERT(used() == 1); |
- if (fT[0][0] > fT[1][0]) { |
- swapPts(); |
+ if (approximately_equal_double(fT[0][0], fT[1][0])) { |
+ fUsed = 0; |
+ } else { |
+ SkASSERT(used() == 1); |
+ if (fT[0][0] > fT[1][0]) { |
+ swapPts(); |
+ } |
} |
} |
return used(); |