diff options
Diffstat (limited to 'src/pathops/SkOpSpan.cpp')
-rwxr-xr-x | src/pathops/SkOpSpan.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp index ae4771cffc..f5a52099da 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(); } |