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

Unified Diff: src/pathops/SkOpSpan.cpp

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/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 ae4771cffc01ee15cfe4ce65b5bea8d4cd7fdc29..f5a52099da4be84f9d9a71ce7cb37b48637eeccd 100755
--- a/src/pathops/SkOpSpan.cpp
+++ b/src/pathops/SkOpSpan.cpp
@@ -13,10 +13,64 @@ bool SkOpPtT::alias() const {
return this->span()->ptT() != this;
}
+bool SkOpPtT::contains(const SkOpPtT* check) const {
+ SkASSERT(this != check);
+ const SkOpPtT* ptT = this;
+ const SkOpPtT* stopPtT = ptT;
+ while ((ptT = ptT->next()) != stopPtT) {
+ if (ptT == check) {
+ return true;
+ }
+ }
+ return false;
+}
+
+SkOpPtT* SkOpPtT::contains(const SkOpSegment* check) {
+ SkASSERT(this->segment() != check);
+ SkOpPtT* ptT = this;
+ const SkOpPtT* stopPtT = ptT;
+ while ((ptT = ptT->next()) != stopPtT) {
+ if (ptT->segment() == check) {
+ return ptT;
+ }
+ }
+ return NULL;
+}
+
SkOpContour* SkOpPtT::contour() const {
return segment()->contour();
}
+SkOpPtT* SkOpPtT::doppelganger() {
+ SkASSERT(fDeleted);
+ SkOpPtT* ptT = fNext;
+ while (ptT->fDeleted) {
+ ptT = ptT->fNext;
+ }
+ const SkOpPtT* stopPtT = ptT;
+ do {
+ if (ptT->fSpan == fSpan) {
+ return ptT;
+ }
+ ptT = ptT->fNext;
+ } while (stopPtT != ptT);
+ SkASSERT(0);
+ return NULL;
+}
+
+SkOpPtT* SkOpPtT::find(SkOpSegment* segment) {
+ SkOpPtT* ptT = this;
+ const SkOpPtT* stopPtT = ptT;
+ do {
+ if (ptT->segment() == segment) {
+ return ptT;
+ }
+ ptT = ptT->fNext;
+ } while (stopPtT != ptT);
+ SkASSERT(0);
+ return NULL;
+}
+
SkOpGlobalState* SkOpPtT::globalState() const {
return contour()->globalState();
}
« 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