Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: src/pathops/SkOpAngle.cpp

Issue 2427253005: fix more fuzz, carsvg (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698