OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "SkOpCoincidence.h" | 7 #include "SkOpCoincidence.h" |
8 #include "SkOpSegment.h" | 8 #include "SkOpSegment.h" |
9 #include "SkPathOpsTSect.h" | 9 #include "SkPathOpsTSect.h" |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 if (coinTs > coinTe) { | 199 if (coinTs > coinTe) { |
200 SkTSwap(coinTs, coinTe); | 200 SkTSwap(coinTs, coinTe); |
201 SkTSwap(oppTs, oppTe); | 201 SkTSwap(oppTs, oppTe); |
202 } | 202 } |
203 SkOpPtT* cs = coinSeg->addMissing(coinTs, oppSeg, allocator); | 203 SkOpPtT* cs = coinSeg->addMissing(coinTs, oppSeg, allocator); |
204 SkOpPtT* ce = coinSeg->addMissing(coinTe, oppSeg, allocator); | 204 SkOpPtT* ce = coinSeg->addMissing(coinTe, oppSeg, allocator); |
205 SkASSERT(cs != ce); | 205 SkASSERT(cs != ce); |
206 SkOpPtT* os = oppSeg->addMissing(oppTs, coinSeg, allocator); | 206 SkOpPtT* os = oppSeg->addMissing(oppTs, coinSeg, allocator); |
207 SkOpPtT* oe = oppSeg->addMissing(oppTe, coinSeg, allocator); | 207 SkOpPtT* oe = oppSeg->addMissing(oppTe, coinSeg, allocator); |
208 SkASSERT(os != oe); | 208 // SkASSERT(os != oe); |
209 cs->addOpp(os); | 209 cs->addOpp(os); |
210 ce->addOpp(oe); | 210 ce->addOpp(oe); |
211 this->add(cs, ce, os, oe, allocator); | 211 this->add(cs, ce, os, oe, allocator); |
212 return true; | 212 return true; |
213 } | 213 } |
214 | 214 |
215 /* detects overlaps of different coincident runs on same segment */ | 215 /* detects overlaps of different coincident runs on same segment */ |
216 /* does not detect overlaps for pairs without any segments in common */ | 216 /* does not detect overlaps for pairs without any segments in common */ |
217 bool SkOpCoincidence::addMissing(SkChunkAlloc* allocator) { | 217 bool SkOpCoincidence::addMissing(SkChunkAlloc* allocator) { |
218 SkCoincidentSpans* outer = fHead; | 218 SkCoincidentSpans* outer = fHead; |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f
T)); | 658 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f
T)); |
659 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f
T)); | 659 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f
T)); |
660 return *overS < *overE; | 660 return *overS < *overE; |
661 } | 661 } |
662 | 662 |
663 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, | 663 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, |
664 const SkOpPtT* testE) const { | 664 const SkOpPtT* testE) const { |
665 return testS->segment()->testForCoincidence(testS, testE, testS->span(), | 665 return testS->segment()->testForCoincidence(testS, testE, testS->span(), |
666 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME:
replace with tuned | 666 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME:
replace with tuned |
667 } | 667 } |
OLD | NEW |