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

Unified Diff: src/pathops/SkIntersections.h

Issue 2128633003: pathops coincidence and security rewrite (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: require resulting t to be between 0 and 1 Created 4 years, 5 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
Index: src/pathops/SkIntersections.h
diff --git a/src/pathops/SkIntersections.h b/src/pathops/SkIntersections.h
index 474142b269607f2a4b102e0fa88f9f5fe617ae2a..abc10e19dd4bc2d4e684497ddff2bda6935ea8e1 100644
--- a/src/pathops/SkIntersections.h
+++ b/src/pathops/SkIntersections.h
@@ -112,6 +112,11 @@ public:
return fUsed > 0 && (t == 0 ? fT[0][0] == 0 : fT[0][fUsed - 1] == 1);
}
+ bool hasOppT(double t) const {
+ SkASSERT(t == 0 || t == 1);
+ return fUsed > 0 && (fT[1][0] == t || fT[1][fUsed - 1] == t);
+ }
+
int insertSwap(double one, double two, const SkDPoint& pt) {
if (fSwap) {
return insert(two, one, pt);
@@ -180,7 +185,6 @@ public:
quad.set(a);
SkDLine line;
line.set(b);
- fMax = 3; // 2; permit small coincident segment + non-coincident intersection
return intersect(quad, line);
}
@@ -207,7 +211,7 @@ public:
bool swapped() const {
return fSwap;
}
-
+
int used() const {
return fUsed;
}

Powered by Google App Engine
This is Rietveld 408576698