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

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

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm 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 | « src/pathops/SkIntersections.h ('k') | src/pathops/SkOpCoincidence.h » ('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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 | « src/pathops/SkIntersections.h ('k') | src/pathops/SkOpCoincidence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698