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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 SkASSERT(lrOrder >= 0 || ltOrder >= 0 || trOrder >= 0); | 146 SkASSERT(lrOrder >= 0 || ltOrder >= 0 || trOrder >= 0); |
147 // There's not enough information to sort. Get the pairs of angles in opposite p
lanes. | 147 // There's not enough information to sort. Get the pairs of angles in opposite p
lanes. |
148 // If an order is < 0, the pair is already in an opposite plane. Check the remai
ning pairs. | 148 // If an order is < 0, the pair is already in an opposite plane. Check the remai
ning pairs. |
149 // FIXME : once all variants are understood, rewrite this more simply | 149 // FIXME : once all variants are understood, rewrite this more simply |
150 if (ltOrder == 0 && lrOrder == 0) { | 150 if (ltOrder == 0 && lrOrder == 0) { |
151 SkASSERT(trOrder < 0); | 151 SkASSERT(trOrder < 0); |
152 // FIXME : once this is verified to work, remove one opposite angle call | 152 // FIXME : once this is verified to work, remove one opposite angle call |
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 SkASSERT(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); |
(...skipping 828 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 |