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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 SkDEBUGCODE(bool lrOpposite = lh->oppositePlanes(rh)); | 153 SkDEBUGCODE(bool lrOpposite = lh->oppositePlanes(rh)); |
154 bool ltOpposite = lh->oppositePlanes(this); | 154 bool ltOpposite = lh->oppositePlanes(this); |
155 SkOPASSERT(lrOpposite != ltOpposite); | 155 SkOPASSERT(lrOpposite != ltOpposite); |
156 return COMPARE_RESULT(8, ltOpposite); | 156 return COMPARE_RESULT(8, ltOpposite); |
157 } else if (ltOrder == 1 && trOrder == 0) { | 157 } else if (ltOrder == 1 && trOrder == 0) { |
158 SkASSERT(lrOrder < 0); | 158 SkASSERT(lrOrder < 0); |
159 bool trOpposite = oppositePlanes(rh); | 159 bool trOpposite = oppositePlanes(rh); |
160 return COMPARE_RESULT(9, trOpposite); | 160 return COMPARE_RESULT(9, trOpposite); |
161 } else if (lrOrder == 1 && trOrder == 1) { | 161 } else if (lrOrder == 1 && trOrder == 1) { |
162 SkASSERT(ltOrder < 0); | 162 SkASSERT(ltOrder < 0); |
163 SkDEBUGCODE(bool trOpposite = oppositePlanes(rh)); | 163 // SkDEBUGCODE(bool trOpposite = oppositePlanes(rh)); |
164 bool lrOpposite = lh->oppositePlanes(rh); | 164 bool lrOpposite = lh->oppositePlanes(rh); |
165 SkASSERT(lrOpposite != trOpposite); | 165 // SkASSERT(lrOpposite != trOpposite); |
166 return COMPARE_RESULT(10, lrOpposite); | 166 return COMPARE_RESULT(10, lrOpposite); |
167 } | 167 } |
168 if (lrOrder < 0) { | 168 if (lrOrder < 0) { |
169 if (ltOrder < 0) { | 169 if (ltOrder < 0) { |
170 return COMPARE_RESULT(11, trOrder); | 170 return COMPARE_RESULT(11, trOrder); |
171 } | 171 } |
172 return COMPARE_RESULT(12, ltOrder); | 172 return COMPARE_RESULT(12, ltOrder); |
173 } | 173 } |
174 return COMPARE_RESULT(13, !lrOrder); | 174 return COMPARE_RESULT(13, !lrOrder); |
175 } | 175 } |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 } | 994 } |
995 SkASSERT(s0dt0 != 0); | 995 SkASSERT(s0dt0 != 0); |
996 double m = s0xt0 / s0dt0; | 996 double m = s0xt0 / s0dt0; |
997 double sDist = sweep[0].length() * m; | 997 double sDist = sweep[0].length() * m; |
998 double tDist = tweep[0].length() * m; | 998 double tDist = tweep[0].length() * m; |
999 bool useS = fabs(sDist) < fabs(tDist); | 999 bool useS = fabs(sDist) < fabs(tDist); |
1000 double mFactor = fabs(useS ? this->distEndRatio(sDist) : rh->distEndRatio(tD
ist)); | 1000 double mFactor = fabs(useS ? this->distEndRatio(sDist) : rh->distEndRatio(tD
ist)); |
1001 fTangentsAmbiguous = mFactor >= 50 && mFactor < 200; | 1001 fTangentsAmbiguous = mFactor >= 50 && mFactor < 200; |
1002 return mFactor < 50; // empirically found limit | 1002 return mFactor < 50; // empirically found limit |
1003 } | 1003 } |
OLD | NEW |