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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 bool addEndMovedSpans(const SkOpSpan* base, const SkOpSpanBase* testSpan); | 243 bool addEndMovedSpans(const SkOpSpan* base, const SkOpSpanBase* testSpan); |
244 bool addEndMovedSpans(const SkOpPtT* ptT); | 244 bool addEndMovedSpans(const SkOpPtT* ptT); |
245 | 245 |
246 bool addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over1s, SkOpPtT*
over1e); | 246 bool addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over1s, SkOpPtT*
over1e); |
247 | 247 |
248 bool addIfMissing(const SkCoincidentSpans* outer, const SkOpPtT* over1s, | 248 bool addIfMissing(const SkCoincidentSpans* outer, const SkOpPtT* over1s, |
249 const SkOpPtT* over1e) { | 249 const SkOpPtT* over1e) { |
250 return addIfMissing(outer, const_cast<SkOpPtT*>(over1s), const_cast<SkOp
PtT*>(over1e)); | 250 return addIfMissing(outer, const_cast<SkOpPtT*>(over1s), const_cast<SkOp
PtT*>(over1e)); |
251 } | 251 } |
252 | 252 |
253 bool addIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e, | 253 bool addIfMissing(const SkOpPtT* over1s, const SkOpPtT* over2s, |
254 const SkOpPtT* over2s, const SkOpPtT* over2e, | 254 double tStart, double tEnd, SkOpSegment* coinSeg, SkOpSegm
ent* oppSeg |
255 double tStart, double tEnd, | 255 SkDEBUGPARAMS(const SkOpPtT* over1e) SkDEBUGPARAMS(const S
kOpPtT* over2e)); |
256 SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, | |
257 SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd); | |
258 | |
259 bool addIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e, | |
260 const SkOpPtT* over2s, const SkOpPtT* over2e, | |
261 double tStart, double tEnd, | |
262 const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, | |
263 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) { | |
264 return addIfMissing(over1s, over1e, over2s, over2e, tStart, tEnd, | |
265 const_cast<SkOpPtT*>(coinPtTStart), coinPtTEnd, | |
266 const_cast<SkOpPtT*>(oppPtTStart), oppPtTEnd); | |
267 } | |
268 | |
269 bool addOrOverlap(SkOpSegment* coinSeg, SkOpSegment* oppSeg, | 256 bool addOrOverlap(SkOpSegment* coinSeg, SkOpSegment* oppSeg, |
270 double coinTs, double coinTe, double oppTs, double oppTe | 257 double coinTs, double coinTe, double oppTs, double oppTe |
271 SkDEBUGPARAMS(bool callerAborts)); | 258 SkDEBUGPARAMS(bool callerAborts)); |
272 bool addOverlap(const SkOpSegment* seg1, const SkOpSegment* seg1o, | 259 bool addOverlap(const SkOpSegment* seg1, const SkOpSegment* seg1o, |
273 const SkOpSegment* seg2, const SkOpSegment* seg2o, | 260 const SkOpSegment* seg2, const SkOpSegment* seg2o, |
274 const SkOpPtT* overS, const SkOpPtT* overE); | 261 const SkOpPtT* overS, const SkOpPtT* overE); |
275 bool alreadyAdded(const SkCoincidentSpans* check, const SkCoincidentSpans* o
uter, | 262 bool alreadyAdded(const SkCoincidentSpans* check, const SkCoincidentSpans* o
uter, |
276 const SkOpPtT* over1s, const SkOpPtT* over1e) const; | 263 const SkOpPtT* over1s, const SkOpPtT* over1e) const; |
277 bool checkOverlap(SkCoincidentSpans* check, | 264 bool checkOverlap(SkCoincidentSpans* check, |
278 const SkOpSegment* coinSeg, const SkOpSegment* oppSeg, | 265 const SkOpSegment* coinSeg, const SkOpSegment* oppSeg, |
279 double coinTs, double coinTe, double oppTs, double oppTe, | 266 double coinTs, double coinTe, double oppTs, double oppTe, |
280 SkTDArray<SkCoincidentSpans*>* overlaps) const; | 267 SkTDArray<SkCoincidentSpans*>* overlaps) const; |
281 bool contains(const SkOpSegment* seg, const SkOpSegment* opp, double oppT) c
onst; | 268 bool contains(const SkOpSegment* seg, const SkOpSegment* opp, double oppT) c
onst; |
282 bool contains(const SkCoincidentSpans* coin, const SkOpSegment* seg, | 269 bool contains(const SkCoincidentSpans* coin, const SkOpSegment* seg, |
283 const SkOpSegment* opp, double oppT) const; | 270 const SkOpSegment* opp, double oppT) const; |
284 #if DEBUG_COINCIDENCE_VERBOSE | 271 #if DEBUG_COINCIDENCE_VERBOSE |
285 void debugAddIfMissing(const SkCoincidentSpans* outer, const SkOpPtT* over1s
, | 272 void debugAddIfMissing(const char* id, SkPathOpsDebug::GlitchLog* , |
286 const SkOpPtT* over1e, const char* id, SkPathOpsDebug
::GlitchLog*) const; | 273 const SkCoincidentSpans* outer, const SkOpPtT* over1s
, |
287 void debugAddIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e, | 274 const SkOpPtT* over1e) const; |
288 const SkOpPtT* over2s, const SkOpPtT* over2e, | 275 void debugAddIfMissing(const char* id, SkPathOpsDebug::GlitchLog* , |
| 276 const SkOpPtT* over1s, const SkOpPtT* over2s, |
289 double tStart, double tEnd, | 277 double tStart, double tEnd, |
290 const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEn
d, | 278 const SkOpSegment* coinSeg, const SkOpSegment* oppSeg
, |
291 const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd, | 279 const SkOpPtT* over1e, const SkOpPtT* over2e) const; |
292 const char* id, SkPathOpsDebug::GlitchLog*) const; | |
293 #endif | 280 #endif |
294 void fixUp(SkCoincidentSpans* coin, SkOpPtT* deleted, const SkOpPtT* kept); | 281 void fixUp(SkCoincidentSpans* coin, SkOpPtT* deleted, const SkOpPtT* kept); |
295 void markCollapsed(SkCoincidentSpans* head, SkOpPtT* test); | 282 void markCollapsed(SkCoincidentSpans* head, SkOpPtT* test); |
296 bool overlap(const SkOpPtT* coinStart1, const SkOpPtT* coinEnd1, | 283 bool overlap(const SkOpPtT* coinStart1, const SkOpPtT* coinEnd1, |
297 const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2, | 284 const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2, |
298 double* overS, double* overE) const; | 285 double* overS, double* overE) const; |
299 bool release(SkCoincidentSpans* coin, SkCoincidentSpans* ); | 286 bool release(SkCoincidentSpans* coin, SkCoincidentSpans* ); |
300 void releaseDeleted(SkCoincidentSpans* ); | 287 void releaseDeleted(SkCoincidentSpans* ); |
301 void restoreHead(); | 288 void restoreHead(); |
302 bool testForCoincidence(const SkCoincidentSpans* outer, const SkOpPtT* testS
, | 289 bool testForCoincidence(const SkCoincidentSpans* outer, const SkOpPtT* testS
, |
303 const SkOpPtT* testE) const; | 290 const SkOpPtT* testE) const; |
304 static void TRange(const SkOpPtT* overS, const SkOpPtT* overE, double tStart
, | 291 // return coinPtT->segment()->t mapped from overS->fT <= t <= overE->fT |
305 double tEnd, const SkOpPtT* coinPtTStart, const SkOpPtT*
coinPtTEnd, | 292 static double TRange(const SkOpPtT* overS, double t, const SkOpSegment* coin
PtT |
306 double* coinTs, double* coinTe); | 293 SkDEBUGPARAMS(const SkOpPtT* overE)); |
307 | 294 |
308 SkCoincidentSpans* fHead; | 295 SkCoincidentSpans* fHead; |
309 SkCoincidentSpans* fTop; | 296 SkCoincidentSpans* fTop; |
310 SkOpGlobalState* fGlobalState; | 297 SkOpGlobalState* fGlobalState; |
311 bool fContinue; | 298 bool fContinue; |
312 bool fSpanDeleted; | 299 bool fSpanDeleted; |
313 bool fPtAllocated; | 300 bool fPtAllocated; |
314 bool fCoinExtended; | 301 bool fCoinExtended; |
315 bool fSpanMerged; | 302 bool fSpanMerged; |
316 }; | 303 }; |
317 | 304 |
318 #endif | 305 #endif |
OLD | NEW |