| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 continue; | 608 continue; |
| 609 } | 609 } |
| 610 double testDistSq = testPt.distanceSquared(i.pt(index)); | 610 double testDistSq = testPt.distanceSquared(i.pt(index)); |
| 611 if (closestDistSq > testDistSq) { | 611 if (closestDistSq > testDistSq) { |
| 612 closestDistSq = testDistSq; | 612 closestDistSq = testDistSq; |
| 613 } | 613 } |
| 614 } | 614 } |
| 615 return closestDistSq; | 615 return closestDistSq; |
| 616 } | 616 } |
| 617 | 617 |
| 618 void SkOpSegment::findCollapsed() { |
| 619 if (fHead.contains(&fTail)) { |
| 620 markAllDone(); |
| 621 // move start and end to the same point |
| 622 fHead.alignEnd(0, fHead.pt()); |
| 623 fTail.setAligned(); |
| 624 } |
| 625 } |
| 626 |
| 618 /* | 627 /* |
| 619 The M and S variable name parts stand for the operators. | 628 The M and S variable name parts stand for the operators. |
| 620 Mi stands for Minuend (see wiki subtraction, analogous to difference) | 629 Mi stands for Minuend (see wiki subtraction, analogous to difference) |
| 621 Su stands for Subtrahend | 630 Su stands for Subtrahend |
| 622 The Opp variable name part designates that the value is for the Opposite operat
or. | 631 The Opp variable name part designates that the value is for the Opposite operat
or. |
| 623 Opposite values result from combining coincident spans. | 632 Opposite values result from combining coincident spans. |
| 624 */ | 633 */ |
| 625 SkOpSegment* SkOpSegment::findNextOp(SkTDArray<SkOpSpanBase*>* chase, SkOpSpanBa
se** nextStart, | 634 SkOpSegment* SkOpSegment::findNextOp(SkTDArray<SkOpSpanBase*>* chase, SkOpSpanBa
se** nextStart, |
| 626 SkOpSpanBase** nextEnd, bool* unsortable, SkPathOp op, int xorMiMask, in
t xorSuMask) { | 635 SkOpSpanBase** nextEnd, bool* unsortable, SkPathOp op, int xorMiMask, in
t xorSuMask) { |
| 627 SkOpSpanBase* start = *nextStart; | 636 SkOpSpanBase* start = *nextStart; |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 int absOut = abs(outerWinding); | 1777 int absOut = abs(outerWinding); |
| 1769 int absIn = abs(innerWinding); | 1778 int absIn = abs(innerWinding); |
| 1770 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; | 1779 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; |
| 1771 return result; | 1780 return result; |
| 1772 } | 1781 } |
| 1773 | 1782 |
| 1774 int SkOpSegment::windSum(const SkOpAngle* angle) const { | 1783 int SkOpSegment::windSum(const SkOpAngle* angle) const { |
| 1775 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); | 1784 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); |
| 1776 return minSpan->windSum(); | 1785 return minSpan->windSum(); |
| 1777 } | 1786 } |
| OLD | NEW |