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

Unified Diff: src/pathops/SkOpContour.h

Issue 1182493015: pathops coincident fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: all tests (including extended) work Created 5 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
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpContour.h
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index f8143cf5550a30a20364824d3114015dd9cacf29..1225416eaa6c6e2378ab928861eba563d18aaa47 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -34,6 +34,14 @@ public:
: fBounds.fTop < rh.fBounds.fTop;
}
+ void addAlignIntersections(SkOpContourHead* contourList, SkChunkAlloc* allocator) {
+ SkASSERT(fCount > 0);
+ SkOpSegment* segment = &fHead;
+ do {
+ segment->addAlignIntersections(contourList, allocator);
+ } while ((segment = segment->next()));
+ }
+
void addConic(SkPoint pts[3], SkScalar weight, SkChunkAlloc* allocator) {
appendSegment(allocator).addConic(pts, weight, this);
}
@@ -222,16 +230,23 @@ public:
} while ((segment = segment->next()));
}
- void missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocator) {
+ bool missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocator) {
SkASSERT(fCount > 0);
SkOpSegment* segment = &fHead;
+ bool result = false;
do {
if (fState->angleCoincidence()) {
segment->checkAngleCoin(coincidences, allocator);
- } else {
- segment->missingCoincidence(coincidences, allocator);
+ } else if (segment->missingCoincidence(coincidences, allocator)) {
+ result = true;
+ // FIXME: trying again loops forever in issue3651_6
+ // The continue below is speculative -- once there's an actual case that requires it,
+ // add the plumbing necessary to look for another missing coincidence in the same segment
+ // continue; // try again in case another missing coincidence is further along
}
- } while ((segment = segment->next()));
+ segment = segment->next();
+ } while (segment);
+ return result;
}
bool moveMultiples() {
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698