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