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

Unified Diff: src/pathops/SkOpSpan.cpp

Issue 2321773002: pathops tiger checkpoint (Closed)
Patch Set: checkpoint (all not-under-development tests work) Created 4 years, 3 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/SkOpSpan.h ('k') | src/pathops/SkPathOpsCommon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpSpan.cpp
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp
index 70b47b6e9bba921b5d023f30b5d61e9e6c36a1c7..26c6f2522c2d40027227e3d1d95c574614971ed9 100755
--- a/src/pathops/SkOpSpan.cpp
+++ b/src/pathops/SkOpSpan.cpp
@@ -459,7 +459,7 @@ void SkOpSpan::init(SkOpSegment* segment, SkOpSpan* prev, double t, const SkPoin
}
// Please keep this in sync with debugInsertCoincidence()
-bool SkOpSpan::insertCoincidence(const SkOpSegment* segment, bool flipped) {
+bool SkOpSpan::insertCoincidence(const SkOpSegment* segment, bool flipped, bool ordered) {
if (this->containsCoincidence(segment)) {
return true;
}
@@ -467,16 +467,16 @@ bool SkOpSpan::insertCoincidence(const SkOpSegment* segment, bool flipped) {
while ((next = next->next()) != &fPtT) {
if (next->segment() == segment) {
SkOpSpan* span;
- if (flipped) {
- span = next->span()->prev();
- if (!span) {
- return false;
- }
+ SkOpSpanBase* base = next->span();
+ if (!ordered) {
+ const SkOpSpanBase* spanEnd = fNext->contains(segment)->span();
+ const SkOpPtT* start = base->ptT()->starter(spanEnd->ptT());
+ span = const_cast<SkOpSpan*>(start->span()->upCast());
+ } else if (flipped) {
+ span = base->prev();
+ FAIL_IF(!span);
} else {
- SkOpSpanBase* base = next->span();
- if (!base->upCastable()) {
- return false;
- }
+ FAIL_IF(!base->upCastable());
span = base->upCast();
}
this->insertCoincidence(span);
« no previous file with comments | « src/pathops/SkOpSpan.h ('k') | src/pathops/SkPathOpsCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698