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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 return true; | 845 return true; |
846 } | 846 } |
847 } | 847 } |
848 return false; | 848 return false; |
849 } | 849 } |
850 | 850 |
851 bool SkOpSegment::isXor() const { | 851 bool SkOpSegment::isXor() const { |
852 return fContour->isXor(); | 852 return fContour->isXor(); |
853 } | 853 } |
854 | 854 |
| 855 void SkOpSegment::markAllDone() { |
| 856 SkOpSpan* span = this->head(); |
| 857 do { |
| 858 this->markDone(span); |
| 859 } while ((span = span->next()->upCastable())); |
| 860 } |
| 861 |
855 SkOpSpanBase* SkOpSegment::markAndChaseDone(SkOpSpanBase* start, SkOpSpanBase* e
nd) { | 862 SkOpSpanBase* SkOpSegment::markAndChaseDone(SkOpSpanBase* start, SkOpSpanBase* e
nd) { |
856 int step = start->step(end); | 863 int step = start->step(end); |
857 SkOpSpan* minSpan = start->starter(end); | 864 SkOpSpan* minSpan = start->starter(end); |
858 markDone(minSpan); | 865 markDone(minSpan); |
859 SkOpSpanBase* last = NULL; | 866 SkOpSpanBase* last = NULL; |
860 SkOpSegment* other = this; | 867 SkOpSegment* other = this; |
861 while ((other = other->nextChase(&start, &step, &minSpan, &last))) { | 868 while ((other = other->nextChase(&start, &step, &minSpan, &last))) { |
862 if (other->done()) { | 869 if (other->done()) { |
863 SkASSERT(!last); | 870 SkASSERT(!last); |
864 break; | 871 break; |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 int absOut = abs(outerWinding); | 1680 int absOut = abs(outerWinding); |
1674 int absIn = abs(innerWinding); | 1681 int absIn = abs(innerWinding); |
1675 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; | 1682 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; |
1676 return result; | 1683 return result; |
1677 } | 1684 } |
1678 | 1685 |
1679 int SkOpSegment::windSum(const SkOpAngle* angle) const { | 1686 int SkOpSegment::windSum(const SkOpAngle* angle) const { |
1680 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); | 1687 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); |
1681 return minSpan->windSum(); | 1688 return minSpan->windSum(); |
1682 } | 1689 } |
OLD | NEW |