OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkPathOpsTSect_DEFINED | 7 #ifndef SkPathOpsTSect_DEFINED |
8 #define SkPathOpsTSect_DEFINED | 8 #define SkPathOpsTSect_DEFINED |
9 | 9 |
10 #include "SkChunkAlloc.h" | 10 #include "SkChunkAlloc.h" |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 this->removeSpan(test); | 1152 this->removeSpan(test); |
1153 } | 1153 } |
1154 } | 1154 } |
1155 } | 1155 } |
1156 | 1156 |
1157 template<typename TCurve, typename OppCurve> | 1157 template<typename TCurve, typename OppCurve> |
1158 SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::extractCoincident( | 1158 SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::extractCoincident( |
1159 SkTSect<OppCurve, TCurve>* sect2, | 1159 SkTSect<OppCurve, TCurve>* sect2, |
1160 SkTSpan<TCurve, OppCurve>* first, SkTSpan<TCurve, OppCurve>* last) { | 1160 SkTSpan<TCurve, OppCurve>* first, SkTSpan<TCurve, OppCurve>* last) { |
1161 first = findCoincidentRun(first, &last); | 1161 first = findCoincidentRun(first, &last); |
1162 if (!first) { | 1162 if (!first || !last) { |
1163 return nullptr; | 1163 return nullptr; |
1164 } | 1164 } |
1165 // march outwards to find limit of coincidence from here to previous and nex
t spans | 1165 // march outwards to find limit of coincidence from here to previous and nex
t spans |
1166 double startT = first->fStartT; | 1166 double startT = first->fStartT; |
1167 double oppStartT SK_INIT_TO_AVOID_WARNING; | 1167 double oppStartT SK_INIT_TO_AVOID_WARNING; |
1168 double oppEndT SK_INIT_TO_AVOID_WARNING; | 1168 double oppEndT SK_INIT_TO_AVOID_WARNING; |
1169 SkTSpan<TCurve, OppCurve>* prev = first->fPrev; | 1169 SkTSpan<TCurve, OppCurve>* prev = first->fPrev; |
1170 SkASSERT(first->fCoinStart.isCoincident()); | 1170 SkASSERT(first->fCoinStart.isCoincident()); |
1171 SkTSpan<OppCurve, TCurve>* oppFirst = first->findOppT(first->fCoinStart.perp
T()); | 1171 SkTSpan<OppCurve, TCurve>* oppFirst = first->findOppT(first->fCoinStart.perp
T()); |
1172 SkOPASSERT(last->fCoinEnd.isCoincident()); | 1172 SkOPASSERT(last->fCoinEnd.isCoincident()); |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 --last; | 2295 --last; |
2296 } else { | 2296 } else { |
2297 intersections->setCoincident(index++); | 2297 intersections->setCoincident(index++); |
2298 } | 2298 } |
2299 intersections->setCoincident(index); | 2299 intersections->setCoincident(index); |
2300 } | 2300 } |
2301 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); | 2301 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); |
2302 } | 2302 } |
2303 | 2303 |
2304 #endif | 2304 #endif |
OLD | NEW |