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 | 7 |
8 // given a prospective edge, compute its initial winding by projecting a ray | 8 // given a prospective edge, compute its initial winding by projecting a ray |
9 // if the ray hits another edge | 9 // if the ray hits another edge |
10 // if the edge doesn't have a winding yet, hop up to that edge and start ove
r | 10 // if the edge doesn't have a winding yet, hop up to that edge and start ove
r |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 hitSegment->contour()->setCcw(ccw); | 346 hitSegment->contour()->setCcw(ccw); |
347 } else { | 347 } else { |
348 (void) hitSegment->markAndChaseWinding(span, span->next(), windS
um, oppSum, NULL); | 348 (void) hitSegment->markAndChaseWinding(span, span->next(), windS
um, oppSum, NULL); |
349 (void) hitSegment->markAndChaseWinding(span->next(), span, windS
um, oppSum, NULL); | 349 (void) hitSegment->markAndChaseWinding(span->next(), span, windS
um, oppSum, NULL); |
350 } | 350 } |
351 } | 351 } |
352 if (operand) { | 352 if (operand) { |
353 SkTSwap(wind, oppWind); | 353 SkTSwap(wind, oppWind); |
354 } | 354 } |
355 last = &hit->fPt; | 355 last = &hit->fPt; |
| 356 this->globalState()->bumpNested(); |
356 } | 357 } |
357 return true; | 358 return true; |
358 } | 359 } |
359 | 360 |
360 SkOpSpan* SkOpSegment::findSortableTop(SkOpContour* contourHead) { | 361 SkOpSpan* SkOpSegment::findSortableTop(SkOpContour* contourHead) { |
361 SkOpSpan* span = &fHead; | 362 SkOpSpan* span = &fHead; |
362 SkOpSpanBase* next; | 363 SkOpSpanBase* next; |
363 do { | 364 do { |
364 next = span->next(); | 365 next = span->next(); |
365 if (span->done()) { | 366 if (span->done()) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 continue; | 398 continue; |
398 } | 399 } |
399 SkOpSpan* result = contour->findSortableTop(contourHead); | 400 SkOpSpan* result = contour->findSortableTop(contourHead); |
400 if (result) { | 401 if (result) { |
401 return result; | 402 return result; |
402 } | 403 } |
403 } while ((contour = contour->next())); | 404 } while ((contour = contour->next())); |
404 } | 405 } |
405 return NULL; | 406 return NULL; |
406 } | 407 } |
OLD | NEW |