OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #ifndef SkOpCoincidence_DEFINED | 7 #ifndef SkOpCoincidence_DEFINED |
8 #define SkOpCoincidence_DEFINED | 8 #define SkOpCoincidence_DEFINED |
9 | 9 |
10 #include "SkTDArray.h" | 10 #include "SkTDArray.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 SkCoincidentSpans* next() { return fNext; } | 67 SkCoincidentSpans* next() { return fNext; } |
68 const SkCoincidentSpans* next() const { return fNext; } | 68 const SkCoincidentSpans* next() const { return fNext; } |
69 SkCoincidentSpans** nextPtr() { return &fNext; } | 69 SkCoincidentSpans** nextPtr() { return &fNext; } |
70 const SkOpPtT* oppPtTStart() const { return fOppPtTStart; } | 70 const SkOpPtT* oppPtTStart() const { return fOppPtTStart; } |
71 const SkOpPtT* oppPtTEnd() const { return fOppPtTEnd; } | 71 const SkOpPtT* oppPtTEnd() const { return fOppPtTEnd; } |
72 // These return non-const pointers so that, as copies, they can be added | 72 // These return non-const pointers so that, as copies, they can be added |
73 // to a new span pair | 73 // to a new span pair |
74 SkOpPtT* oppPtTStartWritable() const { return const_cast<SkOpPtT*>(fOppPtTSt
art); } | 74 SkOpPtT* oppPtTStartWritable() const { return const_cast<SkOpPtT*>(fOppPtTSt
art); } |
75 SkOpPtT* oppPtTEndWritable() const { return const_cast<SkOpPtT*>(fOppPtTEnd)
; } | 75 SkOpPtT* oppPtTEndWritable() const { return const_cast<SkOpPtT*>(fOppPtTEnd)
; } |
76 bool ordered() const; | 76 bool ordered(bool* result) const; |
77 | 77 |
78 void set(SkCoincidentSpans* next, const SkOpPtT* coinPtTStart, const SkOpPtT
* coinPtTEnd, | 78 void set(SkCoincidentSpans* next, const SkOpPtT* coinPtTStart, const SkOpPtT
* coinPtTEnd, |
79 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd); | 79 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd); |
80 | 80 |
81 void setCoinPtTEnd(const SkOpPtT* ptT) { | 81 void setCoinPtTEnd(const SkOpPtT* ptT) { |
82 SkOPASSERT(ptT == ptT->span()->ptT()); | 82 SkOPASSERT(ptT == ptT->span()->ptT()); |
83 SkASSERT(!fCoinPtTStart || ptT->fT != fCoinPtTStart->fT); | 83 SkASSERT(!fCoinPtTStart || ptT->fT != fCoinPtTStart->fT); |
84 SkASSERT(!fCoinPtTStart || fCoinPtTStart->segment() == ptT->segment()); | 84 SkASSERT(!fCoinPtTStart || fCoinPtTStart->segment() == ptT->segment()); |
85 fCoinPtTEnd = ptT; | 85 fCoinPtTEnd = ptT; |
86 ptT->setCoincident(); | 86 ptT->setCoincident(); |
(...skipping 14 matching lines...) Expand all Loading... |
101 | 101 |
102 void setOppPtTEnd(const SkOpPtT* ptT) { | 102 void setOppPtTEnd(const SkOpPtT* ptT) { |
103 SkOPASSERT(ptT == ptT->span()->ptT()); | 103 SkOPASSERT(ptT == ptT->span()->ptT()); |
104 SkOPASSERT(!fOppPtTStart || ptT->fT != fOppPtTStart->fT); | 104 SkOPASSERT(!fOppPtTStart || ptT->fT != fOppPtTStart->fT); |
105 SkASSERT(!fOppPtTStart || fOppPtTStart->segment() == ptT->segment()); | 105 SkASSERT(!fOppPtTStart || fOppPtTStart->segment() == ptT->segment()); |
106 fOppPtTEnd = ptT; | 106 fOppPtTEnd = ptT; |
107 ptT->setCoincident(); | 107 ptT->setCoincident(); |
108 } | 108 } |
109 | 109 |
110 void setOppPtTStart(const SkOpPtT* ptT) { | 110 void setOppPtTStart(const SkOpPtT* ptT) { |
111 SkASSERT(ptT == ptT->span()->ptT()); | 111 SkOPASSERT(ptT == ptT->span()->ptT()); |
112 SkOPASSERT(!fOppPtTEnd || ptT->fT != fOppPtTEnd->fT); | 112 SkOPASSERT(!fOppPtTEnd || ptT->fT != fOppPtTEnd->fT); |
113 SkASSERT(!fOppPtTEnd || fOppPtTEnd->segment() == ptT->segment()); | 113 SkASSERT(!fOppPtTEnd || fOppPtTEnd->segment() == ptT->segment()); |
114 fOppPtTStart = ptT; | 114 fOppPtTStart = ptT; |
115 ptT->setCoincident(); | 115 ptT->setCoincident(); |
116 } | 116 } |
117 | 117 |
118 void setStarts(const SkOpPtT* coinPtTStart, const SkOpPtT* oppPtTStart) { | 118 void setStarts(const SkOpPtT* coinPtTStart, const SkOpPtT* oppPtTStart) { |
119 this->setCoinPtTStart(coinPtTStart); | 119 this->setCoinPtTStart(coinPtTStart); |
120 this->setOppPtTStart(oppPtTStart); | 120 this->setOppPtTStart(oppPtTStart); |
121 } | 121 } |
(...skipping 21 matching lines...) Expand all Loading... |
143 , fCoinExtended(false) | 143 , fCoinExtended(false) |
144 , fSpanMerged(false) { | 144 , fSpanMerged(false) { |
145 globalState->setCoincidence(this); | 145 globalState->setCoincidence(this); |
146 } | 146 } |
147 | 147 |
148 void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart, | 148 void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart, |
149 SkOpPtT* oppPtTEnd); | 149 SkOpPtT* oppPtTEnd); |
150 bool addEndMovedSpans(DEBUG_COIN_DECLARE_ONLY_PARAMS()); | 150 bool addEndMovedSpans(DEBUG_COIN_DECLARE_ONLY_PARAMS()); |
151 bool addExpanded(DEBUG_COIN_DECLARE_ONLY_PARAMS()); | 151 bool addExpanded(DEBUG_COIN_DECLARE_ONLY_PARAMS()); |
152 bool addMissing(bool* added DEBUG_COIN_DECLARE_PARAMS()); | 152 bool addMissing(bool* added DEBUG_COIN_DECLARE_PARAMS()); |
153 void apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()); | 153 bool apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()); |
154 bool contains(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, | 154 bool contains(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, |
155 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) const; | 155 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) const; |
156 void correctEnds(DEBUG_COIN_DECLARE_ONLY_PARAMS()); | 156 void correctEnds(DEBUG_COIN_DECLARE_ONLY_PARAMS()); |
157 | 157 |
158 #if DEBUG_COIN | 158 #if DEBUG_COIN |
159 void debugAddEndMovedSpans(SkPathOpsDebug::GlitchLog* log) const; | 159 void debugAddEndMovedSpans(SkPathOpsDebug::GlitchLog* log) const; |
160 void debugAddExpanded(SkPathOpsDebug::GlitchLog* ) const; | 160 void debugAddExpanded(SkPathOpsDebug::GlitchLog* ) const; |
161 void debugAddMissing(SkPathOpsDebug::GlitchLog* , bool* added) const; | 161 void debugAddMissing(SkPathOpsDebug::GlitchLog* , bool* added) const; |
162 void debugAddOrOverlap(SkPathOpsDebug::GlitchLog* log, | 162 void debugAddOrOverlap(SkPathOpsDebug::GlitchLog* log, |
163 const SkOpSegment* coinSeg, const SkOpSegment* oppSeg
, | 163 const SkOpSegment* coinSeg, const SkOpSegment* oppSeg
, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 SkCoincidentSpans* fTop; | 294 SkCoincidentSpans* fTop; |
295 SkOpGlobalState* fGlobalState; | 295 SkOpGlobalState* fGlobalState; |
296 bool fContinue; | 296 bool fContinue; |
297 bool fSpanDeleted; | 297 bool fSpanDeleted; |
298 bool fPtAllocated; | 298 bool fPtAllocated; |
299 bool fCoinExtended; | 299 bool fCoinExtended; |
300 bool fSpanMerged; | 300 bool fSpanMerged; |
301 }; | 301 }; |
302 | 302 |
303 #endif | 303 #endif |
OLD | NEW |