Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Unified Diff: src/pathops/SkDCubicIntersection.cpp

Issue 340103002: fix last skp bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pathops/SkOpSegment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698