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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 if (oSpanSum == SK_MinS32) { | 335 if (oSpanSum == SK_MinS32) { |
336 span->setOppSum(oppSum); | 336 span->setOppSum(oppSum); |
337 } else { | 337 } else { |
338 #if 0 | 338 #if 0 |
339 SkASSERT(hitSegment->oppXor() ? (oppSum & 1) == (oSpanSum & 1) : opp
Sum == oSpanSum | 339 SkASSERT(hitSegment->oppXor() ? (oppSum & 1) == (oSpanSum & 1) : opp
Sum == oSpanSum |
340 || (abs(oppWind) == abs(lastOpp) | 340 || (abs(oppWind) == abs(lastOpp) |
341 && (oppSum ^ oppWind ^ lastOpp) == oSpanSum)); | 341 && (oppSum ^ oppWind ^ lastOpp) == oSpanSum)); |
342 #endif | 342 #endif |
343 } | 343 } |
344 if (sumSet) { | 344 if (sumSet) { |
345 (void) hitSegment->markAndChaseWinding(span, span->next(), windSum,
oppSum, NULL); | 345 if (this->globalState()->phase() == SkOpGlobalState::kFixWinding) { |
346 (void) hitSegment->markAndChaseWinding(span->next(), span, windSum,
oppSum, NULL); | 346 hitSegment->contour()->setCcw(ccw); |
| 347 } else { |
| 348 (void) hitSegment->markAndChaseWinding(span, span->next(), windS
um, oppSum, NULL); |
| 349 (void) hitSegment->markAndChaseWinding(span->next(), span, windS
um, oppSum, NULL); |
| 350 } |
347 } | 351 } |
348 if (operand) { | 352 if (operand) { |
349 SkTSwap(wind, oppWind); | 353 SkTSwap(wind, oppWind); |
350 } | 354 } |
351 last = &hit->fPt; | 355 last = &hit->fPt; |
352 } | 356 } |
353 return true; | 357 return true; |
354 } | 358 } |
355 | 359 |
356 SkOpSpan* SkOpSegment::findSortableTop(SkOpContour* contourHead) { | 360 SkOpSpan* SkOpSegment::findSortableTop(SkOpContour* contourHead) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 continue; | 397 continue; |
394 } | 398 } |
395 SkOpSpan* result = contour->findSortableTop(contourHead); | 399 SkOpSpan* result = contour->findSortableTop(contourHead); |
396 if (result) { | 400 if (result) { |
397 return result; | 401 return result; |
398 } | 402 } |
399 } while ((contour = contour->next())); | 403 } while ((contour = contour->next())); |
400 } | 404 } |
401 return NULL; | 405 return NULL; |
402 } | 406 } |
OLD | NEW |