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

Unified Diff: src/pathops/SkOpAngle.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 | « src/pathops/SkOpAngle.h ('k') | src/pathops/SkOpContour.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpAngle.cpp
diff --git a/src/pathops/SkOpAngle.cpp b/src/pathops/SkOpAngle.cpp
index 0c87d3ba9e840939bea323d5a6f6ba456e89b0c3..b3a188c1e82307434d848e08dabbab16c6806e03 100644
--- a/src/pathops/SkOpAngle.cpp
+++ b/src/pathops/SkOpAngle.cpp
@@ -409,7 +409,12 @@ bool SkOpAngle::endsIntersect(const SkOpAngle& rh) const {
for (int index = 0; index < 2; ++index) {
const SkOpSegment& segment = index ? *rh.fSegment : *fSegment;
SkIntersections i;
- (*CurveIntersectRay[index ? rPts : lPts])(segment.pts(), rays[index], &i);
+ int cPts = index ? rPts : lPts;
+ (*CurveIntersectRay[cPts])(segment.pts(), rays[index], &i);
+ // if the curve is a line, then the line and the ray intersect only at their crossing
+ if (cPts == 1) { // line
+ continue;
+ }
// SkASSERT(i.used() >= 1);
// if (i.used() <= 1) {
// continue;
@@ -657,7 +662,7 @@ void SkOpAngle::insert(SkOpAngle* angle) {
}
SkOpAngle* next = fNext;
if (next->fNext == this) {
- if (angle->overlap(*this)) {
+ if (angle->overlap(*this)) { // angles are essentially coincident
return;
}
if (singleton || angle->after(this)) {
@@ -777,7 +782,7 @@ bool SkOpAngle::merge(SkOpAngle* angle) {
working = next;
} while (working != angle);
// it's likely that a pair of the angles are unorderable
-#if DEBUG_ANGLE
+#if 0 && DEBUG_ANGLE
SkOpAngle* last = angle;
working = angle->fNext;
do {
« no previous file with comments | « src/pathops/SkOpAngle.h ('k') | src/pathops/SkOpContour.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698