OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkIntersections.h" | 7 #include "SkIntersections.h" |
8 #include "SkOpContour.h" | 8 #include "SkOpContour.h" |
9 #include "SkPathWriter.h" | 9 #include "SkPathWriter.h" |
10 #include "SkTSort.h" | 10 #include "SkTSort.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 addTo2->addTPair(missingT2, addOther2, otherT2, false, missingPt2); | 445 addTo2->addTPair(missingT2, addOther2, otherT2, false, missingPt2); |
446 } else { | 446 } else { |
447 SkASSERT(minTIndex >= 0); | 447 SkASSERT(minTIndex >= 0); |
448 missingPt2 = refSegment->span(maxTIndex).fPt; | 448 missingPt2 = refSegment->span(maxTIndex).fPt; |
449 } | 449 } |
450 if (!partial) { | 450 if (!partial) { |
451 return; | 451 return; |
452 } | 452 } |
453 if (cancelers) { | 453 if (cancelers) { |
454 if (missingT1 >= 0) { | 454 if (missingT1 >= 0) { |
| 455 if (addTo1->reversePoints(missingPt1, missingPt2)) { |
| 456 SkTSwap(missingPt1, missingPt2); |
| 457 } |
455 addTo1->addTCancel(missingPt1, missingPt2, addOther1); | 458 addTo1->addTCancel(missingPt1, missingPt2, addOther1); |
456 } else { | 459 } else { |
| 460 if (addTo2->reversePoints(missingPt1, missingPt2)) { |
| 461 SkTSwap(missingPt1, missingPt2); |
| 462 } |
457 addTo2->addTCancel(missingPt1, missingPt2, addOther2); | 463 addTo2->addTCancel(missingPt1, missingPt2, addOther2); |
458 } | 464 } |
459 } else if (missingT1 >= 0) { | 465 } else if (missingT1 >= 0) { |
460 addTo1->addTCoincident(missingPt1, missingPt2, addTo1 == addTo2 ? missin
gT2 : otherT2, | 466 addTo1->addTCoincident(missingPt1, missingPt2, addTo1 == addTo2 ? missin
gT2 : otherT2, |
461 addOther1); | 467 addOther1); |
462 } else { | 468 } else { |
463 addTo2->addTCoincident(missingPt2, missingPt1, addTo2 == addTo1 ? missin
gT1 : otherT1, | 469 addTo2->addTCoincident(missingPt2, missingPt1, addTo2 == addTo1 ? missin
gT1 : otherT1, |
464 addOther2); | 470 addOther2); |
465 } | 471 } |
466 } | 472 } |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 SkDebugf("%s empty contour\n", __FUNCTION__); | 747 SkDebugf("%s empty contour\n", __FUNCTION__); |
742 SkASSERT(0); | 748 SkASSERT(0); |
743 // FIXME: delete empty contour? | 749 // FIXME: delete empty contour? |
744 return; | 750 return; |
745 } | 751 } |
746 fBounds = fSegments.front().bounds(); | 752 fBounds = fSegments.front().bounds(); |
747 for (int index = 1; index < count; ++index) { | 753 for (int index = 1; index < count; ++index) { |
748 fBounds.add(fSegments[index].bounds()); | 754 fBounds.add(fSegments[index].bounds()); |
749 } | 755 } |
750 } | 756 } |
OLD | NEW |