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 "SkOpAngle.h" | 7 #include "SkOpAngle.h" |
8 #include "SkOpSegment.h" | 8 #include "SkOpSegment.h" |
9 #include "SkPathOpsCurve.h" | 9 #include "SkPathOpsCurve.h" |
10 #include "SkTSort.h" | 10 #include "SkTSort.h" |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 SkDVector oppSide = oppMid.pt(oppOutside) - dStartPt; | 802 SkDVector oppSide = oppMid.pt(oppOutside) - dStartPt; |
803 double dir = iSide.crossCheck(oppSide); | 803 double dir = iSide.crossCheck(oppSide); |
804 if (!dir) { | 804 if (!dir) { |
805 return false; | 805 return false; |
806 } | 806 } |
807 *inside = dir < 0; | 807 *inside = dir < 0; |
808 return true; | 808 return true; |
809 } | 809 } |
810 | 810 |
811 bool SkOpAngle::oppositePlanes(const SkOpAngle* rh) const { | 811 bool SkOpAngle::oppositePlanes(const SkOpAngle* rh) const { |
812 int startSpan = abs(rh->fSectorStart - fSectorStart); | 812 int startSpan = SkTAbs(rh->fSectorStart - fSectorStart); |
813 return startSpan >= 8; | 813 return startSpan >= 8; |
814 } | 814 } |
815 | 815 |
816 bool SkOpAngle::orderable(SkOpAngle* rh) { | 816 bool SkOpAngle::orderable(SkOpAngle* rh) { |
817 int result; | 817 int result; |
818 if (!fIsCurve) { | 818 if (!fIsCurve) { |
819 if (!rh->fIsCurve) { | 819 if (!rh->fIsCurve) { |
820 double leftX = fTangentHalf.dx(); | 820 double leftX = fTangentHalf.dx(); |
821 double leftY = fTangentHalf.dy(); | 821 double leftY = fTangentHalf.dy(); |
822 double rightX = rh->fTangentHalf.dx(); | 822 double rightX = rh->fTangentHalf.dx(); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 return true; | 1091 return true; |
1092 } | 1092 } |
1093 SkASSERT(s0dt0 != 0); | 1093 SkASSERT(s0dt0 != 0); |
1094 double m = s0xt0 / s0dt0; | 1094 double m = s0xt0 / s0dt0; |
1095 double sDist = sweep[0].length() * m; | 1095 double sDist = sweep[0].length() * m; |
1096 double tDist = tweep[0].length() * m; | 1096 double tDist = tweep[0].length() * m; |
1097 bool useS = fabs(sDist) < fabs(tDist); | 1097 bool useS = fabs(sDist) < fabs(tDist); |
1098 double mFactor = fabs(useS ? this->distEndRatio(sDist) : rh->distEndRatio(tD
ist)); | 1098 double mFactor = fabs(useS ? this->distEndRatio(sDist) : rh->distEndRatio(tD
ist)); |
1099 return mFactor < 2400; // empirically found limit | 1099 return mFactor < 2400; // empirically found limit |
1100 } | 1100 } |
OLD | NEW |