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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 bool addMissing(); | 149 bool addMissing(); |
150 bool addUncommon(); | 150 bool addUncommon(); |
151 bool apply(); | 151 bool apply(); |
152 bool contains(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, | 152 bool contains(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, |
153 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) const; | 153 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) const; |
154 void correctEnds(); | 154 void correctEnds(); |
155 | 155 |
156 #if DEBUG_COINCIDENCE_VERBOSE | 156 #if DEBUG_COINCIDENCE_VERBOSE |
157 void debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog* ) const; | 157 void debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
158 void debugAddMissing(const char* id, SkPathOpsDebug::GlitchLog* ) const; | 158 void debugAddMissing(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
159 void debugAddOrOverlap(const SkOpSegment* coinSeg, const SkOpSegment* oppSeg
, | 159 void debugAddOrOverlap(const char* id, SkPathOpsDebug::GlitchLog* log, |
160 double coinTs, double coinTe, double oppTs, double op
pTe, | 160 const SkOpSegment* coinSeg, const SkOpSegment* oppSeg
, |
161 const char* id, SkPathOpsDebug::GlitchLog* log) const
; | 161 double coinTs, double coinTe, double oppTs, double op
pTe) const; |
162 #endif | 162 #endif |
163 | 163 |
164 const SkOpAngle* debugAngle(int id) const { | 164 const SkOpAngle* debugAngle(int id) const { |
165 return SkDEBUGRELEASE(fGlobalState->debugAngle(id), nullptr); | 165 return SkDEBUGRELEASE(fGlobalState->debugAngle(id), nullptr); |
166 } | 166 } |
167 | 167 |
168 #if DEBUG_COINCIDENCE_VERBOSE | 168 #if DEBUG_COINCIDENCE_VERBOSE |
169 void debugCheckOverlap(const char* id, SkPathOpsDebug::GlitchLog* log) const
; | 169 void debugCheckOverlap(const char* id, SkPathOpsDebug::GlitchLog* log) const
; |
170 void debugCheckValid(const char* id, SkPathOpsDebug::GlitchLog* log) const; | 170 void debugCheckValid(const char* id, SkPathOpsDebug::GlitchLog* log) const; |
171 #endif | 171 #endif |
172 | 172 |
173 SkOpContour* debugContour(int id) { | 173 SkOpContour* debugContour(int id) const { |
174 return SkDEBUGRELEASE(fGlobalState->debugContour(id), nullptr); | 174 return SkDEBUGRELEASE(fGlobalState->debugContour(id), nullptr); |
175 } | 175 } |
176 | 176 |
177 #if DEBUG_COINCIDENCE_VERBOSE | 177 #if DEBUG_COINCIDENCE_VERBOSE |
178 bool debugExpand(const char* id, SkPathOpsDebug::GlitchLog* ) const; | 178 bool debugExpand(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
179 void debugMark(const char* id, SkPathOpsDebug::GlitchLog* ) const; | 179 void debugMark(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
180 void debugMarkCollapsed(const char* id, SkPathOpsDebug::GlitchLog* , | 180 void debugMarkCollapsed(const char* id, SkPathOpsDebug::GlitchLog* , |
181 const SkCoincidentSpans* coin, const SkOpPtT* test)
const; | 181 const SkCoincidentSpans* coin, const SkOpPtT* test)
const; |
182 void debugMarkCollapsed(const char* id, SkPathOpsDebug::GlitchLog* , const S
kOpPtT* test) const; | 182 void debugMarkCollapsed(const char* id, SkPathOpsDebug::GlitchLog* , const S
kOpPtT* test) const; |
183 #endif | 183 #endif |
184 | 184 |
185 const SkOpPtT* debugPtT(int id) const { | 185 const SkOpPtT* debugPtT(int id) const { |
186 return SkDEBUGRELEASE(fGlobalState->debugPtT(id), nullptr); | 186 return SkDEBUGRELEASE(fGlobalState->debugPtT(id), nullptr); |
187 } | 187 } |
188 | 188 |
189 const SkOpSegment* debugSegment(int id) const { | 189 const SkOpSegment* debugSegment(int id) const { |
190 return SkDEBUGRELEASE(fGlobalState->debugSegment(id), nullptr); | 190 return SkDEBUGRELEASE(fGlobalState->debugSegment(id), nullptr); |
191 } | 191 } |
192 | 192 |
193 #if DEBUG_COINCIDENCE_VERBOSE | 193 #if DEBUG_COINCIDENCE_VERBOSE |
194 void debugRemoveCollapsed(const char* id, SkPathOpsDebug::GlitchLog* ) const
; | 194 void debugRemoveCollapsed(const char* id, SkPathOpsDebug::GlitchLog* ) const
; |
195 void debugReorder(const char* id, SkPathOpsDebug::GlitchLog* ) const; | 195 void debugReorder(const char* id, SkPathOpsDebug::GlitchLog* ) const; |
| 196 void debugRelease(const char* id, SkPathOpsDebug::GlitchLog* , const SkCoinc
identSpans* , |
| 197 const SkCoincidentSpans* ) const; |
196 void debugRelease(const char* id, SkPathOpsDebug::GlitchLog* , const SkOpSeg
ment* ) const; | 198 void debugRelease(const char* id, SkPathOpsDebug::GlitchLog* , const SkOpSeg
ment* ) const; |
197 #endif | 199 #endif |
198 void debugShowCoincidence() const; | 200 void debugShowCoincidence() const; |
199 | 201 |
200 const SkOpSpanBase* debugSpan(int id) const { | 202 const SkOpSpanBase* debugSpan(int id) const { |
201 return SkDEBUGRELEASE(fGlobalState->debugSpan(id), nullptr); | 203 return SkDEBUGRELEASE(fGlobalState->debugSpan(id), nullptr); |
202 } | 204 } |
203 | 205 |
204 void debugValidate() const; | 206 void debugValidate() const; |
205 void dump() const; | 207 void dump() const; |
(...skipping 14 matching lines...) Expand all Loading... |
220 | 222 |
221 bool mark(); | 223 bool mark(); |
222 void markCollapsed(SkOpPtT* ); | 224 void markCollapsed(SkOpPtT* ); |
223 | 225 |
224 static bool Ordered(const SkOpPtT* coinPtTStart, const SkOpPtT* oppPtTStart)
{ | 226 static bool Ordered(const SkOpPtT* coinPtTStart, const SkOpPtT* oppPtTStart)
{ |
225 return Ordered(coinPtTStart->segment(), oppPtTStart->segment()); | 227 return Ordered(coinPtTStart->segment(), oppPtTStart->segment()); |
226 } | 228 } |
227 | 229 |
228 static bool Ordered(const SkOpSegment* coin, const SkOpSegment* opp); | 230 static bool Ordered(const SkOpSegment* coin, const SkOpSegment* opp); |
229 void release(const SkOpSegment* ); | 231 void release(const SkOpSegment* ); |
| 232 void releaseDeleted(); |
230 bool removeCollapsed(); | 233 bool removeCollapsed(); |
231 bool reorder(); | 234 bool reorder(); |
232 | 235 |
233 private: | 236 private: |
234 void add(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, const SkOpP
tT* oppPtTStart, | 237 void add(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, const SkOpP
tT* oppPtTStart, |
235 const SkOpPtT* oppPtTEnd) { | 238 const SkOpPtT* oppPtTEnd) { |
236 this->add(const_cast<SkOpPtT*>(coinPtTStart), const_cast<SkOpPtT*>(coinP
tTEnd), | 239 this->add(const_cast<SkOpPtT*>(coinPtTStart), const_cast<SkOpPtT*>(coinP
tTEnd), |
237 const_cast<SkOpPtT*>(oppPtTStart), const_cast<SkOpPtT*>(oppPtTEnd)); | 240 const_cast<SkOpPtT*>(oppPtTStart), const_cast<SkOpPtT*>(oppPtTEnd)); |
238 } | 241 } |
239 | 242 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEn
d, | 290 const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEn
d, |
288 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd, | 291 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd, |
289 const char* id, SkPathOpsDebug::GlitchLog*) const; | 292 const char* id, SkPathOpsDebug::GlitchLog*) const; |
290 #endif | 293 #endif |
291 void fixUp(SkCoincidentSpans* coin, SkOpPtT* deleted, const SkOpPtT* kept); | 294 void fixUp(SkCoincidentSpans* coin, SkOpPtT* deleted, const SkOpPtT* kept); |
292 void markCollapsed(SkCoincidentSpans* head, SkOpPtT* test); | 295 void markCollapsed(SkCoincidentSpans* head, SkOpPtT* test); |
293 bool overlap(const SkOpPtT* coinStart1, const SkOpPtT* coinEnd1, | 296 bool overlap(const SkOpPtT* coinStart1, const SkOpPtT* coinEnd1, |
294 const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2, | 297 const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2, |
295 double* overS, double* overE) const; | 298 double* overS, double* overE) const; |
296 bool release(SkCoincidentSpans* coin, SkCoincidentSpans* ); | 299 bool release(SkCoincidentSpans* coin, SkCoincidentSpans* ); |
| 300 void releaseDeleted(SkCoincidentSpans* ); |
297 void restoreHead(); | 301 void restoreHead(); |
298 bool testForCoincidence(const SkCoincidentSpans* outer, const SkOpPtT* testS
, | 302 bool testForCoincidence(const SkCoincidentSpans* outer, const SkOpPtT* testS
, |
299 const SkOpPtT* testE) const; | 303 const SkOpPtT* testE) const; |
300 static void TRange(const SkOpPtT* overS, const SkOpPtT* overE, double tStart
, | 304 static void TRange(const SkOpPtT* overS, const SkOpPtT* overE, double tStart
, |
301 double tEnd, const SkOpPtT* coinPtTStart, const SkOpPtT*
coinPtTEnd, | 305 double tEnd, const SkOpPtT* coinPtTStart, const SkOpPtT*
coinPtTEnd, |
302 double* coinTs, double* coinTe); | 306 double* coinTs, double* coinTe); |
303 | 307 |
304 SkCoincidentSpans* fHead; | 308 SkCoincidentSpans* fHead; |
305 SkCoincidentSpans* fTop; | 309 SkCoincidentSpans* fTop; |
306 SkOpGlobalState* fGlobalState; | 310 SkOpGlobalState* fGlobalState; |
307 bool fContinue; | 311 bool fContinue; |
308 bool fSpanDeleted; | 312 bool fSpanDeleted; |
309 bool fPtAllocated; | 313 bool fPtAllocated; |
310 bool fCoinExtended; | 314 bool fCoinExtended; |
311 bool fSpanMerged; | 315 bool fSpanMerged; |
312 }; | 316 }; |
313 | 317 |
314 #endif | 318 #endif |
OLD | NEW |