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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 // start over | 127 // start over |
128 test = start; | 128 test = start; |
129 oTest = oStart; | 129 oTest = oStart; |
130 } | 130 } |
131 if (test != end) { | 131 if (test != end) { |
132 test = test->upCast()->next(); | 132 test = test->upCast()->next(); |
133 } | 133 } |
134 if (oTest != oEnd) { | 134 if (oTest != oEnd) { |
135 oTest = coin->fFlipped ? oTest->prev() : oTest->upCast()->next()
; | 135 oTest = coin->fFlipped ? oTest->prev() : oTest->upCast()->next()
; |
| 136 if (!oTest) { |
| 137 return false; |
| 138 } |
136 } | 139 } |
137 } | 140 } |
138 } while ((coin = coin->fNext)); | 141 } while ((coin = coin->fNext)); |
139 #if DEBUG_VALIDATE | 142 #if DEBUG_VALIDATE |
140 globalState->setPhase(SkOpGlobalState::kWalking); | 143 globalState->setPhase(SkOpGlobalState::kWalking); |
141 #endif | 144 #endif |
142 return true; | 145 return true; |
143 } | 146 } |
144 | 147 |
145 bool SkOpCoincidence::addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over
1s, | 148 bool SkOpCoincidence::addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over
1s, |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f
T)); | 686 *overS = SkTMax(SkTMin(coin1s->fT, coin1e->fT), SkTMin(coin2s->fT, coin2e->f
T)); |
684 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f
T)); | 687 *overE = SkTMin(SkTMax(coin1s->fT, coin1e->fT), SkTMax(coin2s->fT, coin2e->f
T)); |
685 return *overS < *overE; | 688 return *overS < *overE; |
686 } | 689 } |
687 | 690 |
688 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, | 691 bool SkOpCoincidence::testForCoincidence(const SkCoincidentSpans* outer, const S
kOpPtT* testS, |
689 const SkOpPtT* testE) const { | 692 const SkOpPtT* testE) const { |
690 return testS->segment()->testForCoincidence(testS, testE, testS->span(), | 693 return testS->segment()->testForCoincidence(testS, testE, testS->span(), |
691 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME:
replace with tuned | 694 testE->span(), outer->fCoinPtTStart->segment(), 120000); // FIXME:
replace with tuned |
692 } | 695 } |
OLD | NEW |