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 #include "SkOpCoincidence.h" | 7 #include "SkOpCoincidence.h" |
8 #include "SkOpContour.h" | 8 #include "SkOpContour.h" |
9 #include "SkOpSegment.h" | 9 #include "SkOpSegment.h" |
10 #include "SkPathWriter.h" | 10 #include "SkPathWriter.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 242 } |
243 compare = nextC; | 243 compare = nextC; |
244 } | 244 } |
245 spanPtT->insert(remainder); | 245 spanPtT->insert(remainder); |
246 tryNextRemainder: | 246 tryNextRemainder: |
247 remainder = next; | 247 remainder = next; |
248 } | 248 } |
249 fSpanAdds += span->fSpanAdds; | 249 fSpanAdds += span->fSpanAdds; |
250 } | 250 } |
251 | 251 |
| 252 int SkOpSpan::computeWindSum() { |
| 253 SkOpGlobalState* globals = this->globalState(); |
| 254 SkOpContour* contourHead = globals->contourHead(); |
| 255 int windTry = 0; |
| 256 while (!this->sortableTop(contourHead) && ++windTry < SkOpGlobalState::kMaxW
indingTries) { |
| 257 ; |
| 258 } |
| 259 return this->windSum(); |
| 260 } |
| 261 |
252 bool SkOpSpan::containsCoincidence(const SkOpSegment* segment) const { | 262 bool SkOpSpan::containsCoincidence(const SkOpSegment* segment) const { |
253 SkASSERT(this->segment() != segment); | 263 SkASSERT(this->segment() != segment); |
254 const SkOpSpan* next = fCoincident; | 264 const SkOpSpan* next = fCoincident; |
255 do { | 265 do { |
256 if (next->segment() == segment) { | 266 if (next->segment() == segment) { |
257 return true; | 267 return true; |
258 } | 268 } |
259 } while ((next = next->fCoincident) != this); | 269 } while ((next = next->fCoincident) != this); |
260 return false; | 270 return false; |
261 } | 271 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 308 |
299 void SkOpSpan::setWindSum(int windSum) { | 309 void SkOpSpan::setWindSum(int windSum) { |
300 SkASSERT(!final()); | 310 SkASSERT(!final()); |
301 if (fWindSum != SK_MinS32 && fWindSum != windSum) { | 311 if (fWindSum != SK_MinS32 && fWindSum != windSum) { |
302 this->globalState()->setWindingFailed(); | 312 this->globalState()->setWindingFailed(); |
303 return; | 313 return; |
304 } | 314 } |
305 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM); | 315 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM); |
306 fWindSum = windSum; | 316 fWindSum = windSum; |
307 } | 317 } |
OLD | NEW |