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

Unified Diff: src/pathops/SkAddIntersections.cpp

Issue 633393002: harden pathops for pathological test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: exclude new test that asserts in debug Created 6 years, 1 month 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 | « gyp/pathops_unittest.gypi ('k') | src/pathops/SkDCubicIntersection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkAddIntersections.cpp
diff --git a/src/pathops/SkAddIntersections.cpp b/src/pathops/SkAddIntersections.cpp
index 27422eda5f012a85e7381f866579a8a9a1d00f0e..c27434f9f778cb1a4df19570b6ecfdbeb8d90e38 100644
--- a/src/pathops/SkAddIntersections.cpp
+++ b/src/pathops/SkAddIntersections.cpp
@@ -307,6 +307,7 @@ bool AddIntersectTs(SkOpContour* test, SkOpContour* next) {
}
case SkIntersectionHelper::kQuad_Segment: {
pts = ts.quadQuad(wt.pts(), wn.pts());
+ ts.alignQuadPts(wt.pts(), wn.pts());
debugShowQuadIntersection(pts, wt, wn, ts);
break;
}
@@ -366,8 +367,7 @@ bool AddIntersectTs(SkOpContour* test, SkOpContour* next) {
if (wt.addCoincident(wn, ts, swap)) {
continue;
}
- ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
- pts = 1;
+ pts = ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
} else if (wn.segmentType() >= SkIntersectionHelper::kQuad_Segment
&& wt.segmentType() >= SkIntersectionHelper::kQuad_Segment
&& ts.isCoincident(0)) {
@@ -375,8 +375,7 @@ bool AddIntersectTs(SkOpContour* test, SkOpContour* next) {
if (wt.addCoincident(wn, ts, swap)) {
continue;
}
- ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
- pts = 1;
+ pts = ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
}
}
if (pts >= 2) {
@@ -387,8 +386,7 @@ bool AddIntersectTs(SkOpContour* test, SkOpContour* next) {
&& wn.isPartial(ts[!swap][pt], ts[!swap][pt + 1], point, next)) {
if (!wt.addPartialCoincident(wn, ts, pt, swap)) {
// remove extra point if two map to same float values
- ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
- pts = 1;
+ pts = ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
}
}
}
« no previous file with comments | « gyp/pathops_unittest.gypi ('k') | src/pathops/SkDCubicIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698