Index: src/pathops/SkDCubicIntersection.cpp |
diff --git a/src/pathops/SkDCubicIntersection.cpp b/src/pathops/SkDCubicIntersection.cpp |
index dc1063c34ca29b9aa8dca585ed96e05db92e0abe..dd51195d77ac746c1078da27b59f482d0a139d9f 100644 |
--- a/src/pathops/SkDCubicIntersection.cpp |
+++ b/src/pathops/SkDCubicIntersection.cpp |
@@ -494,7 +494,18 @@ int SkIntersections::intersect(const SkDCubic& c1, const SkDCubic& c2) { |
cubicNearEnd(c1, false, c2, c2Bounds); |
} |
if (!(exactEndBits & 8)) { |
+ if (selfIntersect && fUsed) { |
+ return fUsed; |
+ } |
cubicNearEnd(c1, true, c2, c2Bounds); |
+ if (selfIntersect && fUsed && ((approximately_less_than_zero(fT[0][0]) |
+ && approximately_less_than_zero(fT[1][0])) |
+ || (approximately_greater_than_one(fT[0][0]) |
+ && approximately_greater_than_one(fT[1][0])))) { |
+ SkASSERT(fUsed == 1); |
+ fUsed = 0; |
+ return fUsed; |
+ } |
} |
if (!selfIntersect) { |
SkDRect c1Bounds; |