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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 SkOpSpan* oStart = (flipped ? coin->fOppPtTEnd : coin->fOppPtTStart)->sp
an()->upCast(); | 383 SkOpSpan* oStart = (flipped ? coin->fOppPtTEnd : coin->fOppPtTStart)->sp
an()->upCast(); |
384 if (oStart->deleted()) { | 384 if (oStart->deleted()) { |
385 continue; | 385 continue; |
386 } | 386 } |
387 SkOpSpanBase* oEnd = (flipped ? coin->fOppPtTStart : coin->fOppPtTEnd)->
span(); | 387 SkOpSpanBase* oEnd = (flipped ? coin->fOppPtTStart : coin->fOppPtTEnd)->
span(); |
388 SkASSERT(oStart == oStart->starter(oEnd)); | 388 SkASSERT(oStart == oStart->starter(oEnd)); |
389 SkOpSegment* segment = start->segment(); | 389 SkOpSegment* segment = start->segment(); |
390 SkOpSegment* oSegment = oStart->segment(); | 390 SkOpSegment* oSegment = oStart->segment(); |
391 bool operandSwap = segment->operand() != oSegment->operand(); | 391 bool operandSwap = segment->operand() != oSegment->operand(); |
392 if (flipped) { | 392 if (flipped) { |
| 393 if (oEnd->deleted()) { |
| 394 continue; |
| 395 } |
393 do { | 396 do { |
394 SkOpSpanBase* oNext = oStart->next(); | 397 SkOpSpanBase* oNext = oStart->next(); |
395 if (oNext == oEnd) { | 398 if (oNext == oEnd) { |
396 break; | 399 break; |
397 } | 400 } |
398 oStart = oNext->upCast(); | 401 oStart = oNext->upCast(); |
399 } while (true); | 402 } while (true); |
400 } | 403 } |
401 do { | 404 do { |
402 int windValue = start->windValue(); | 405 int windValue = start->windValue(); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f
T)); | 676 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f
T)); |
674 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f
T)); | 677 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f
T)); |
675 return *overS < *overE; | 678 return *overS < *overE; |
676 } | 679 } |
677 | 680 |
678 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, | 681 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, |
679 const SkOpPtT* testE) const { | 682 const SkOpPtT* testE) const { |
680 return testS->segment()->testForCoincidence(testS, testE, testS->span(), | 683 return testS->segment()->testForCoincidence(testS, testE, testS->span(), |
681 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME:
replace with tuned | 684 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME:
replace with tuned |
682 } | 685 } |
OLD | NEW |