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

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

Issue 18527003: use else instead of else-if -- fixes 'possibly unused' warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Another approach is to start with the implicit form of one curve and solve 1 // Another approach is to start with the implicit form of one curve and solve
2 // (seek implicit coefficients in QuadraticParameter.cpp 2 // (seek implicit coefficients in QuadraticParameter.cpp
3 // by substituting in the parametric form of the other. 3 // by substituting in the parametric form of the other.
4 // The downside of this approach is that early rejects are difficult to come by. 4 // The downside of this approach is that early rejects are difficult to come by.
5 // http://planetmath.org/encyclopedia/GaloisTheoreticDerivationOfTheQuarticFormu la.html#step 5 // http://planetmath.org/encyclopedia/GaloisTheoreticDerivationOfTheQuarticFormu la.html#step
6 6
7 7
8 #include "SkDQuadImplicit.h" 8 #include "SkDQuadImplicit.h"
9 #include "SkIntersections.h" 9 #include "SkIntersections.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 tsFound.push_back(rootTs[0][idx2]); 168 tsFound.push_back(rootTs[0][idx2]);
169 } 169 }
170 } 170 }
171 int tCount = tsFound.count(); 171 int tCount = tsFound.count();
172 if (tCount <= 0) { 172 if (tCount <= 0) {
173 return true; 173 return true;
174 } 174 }
175 double tMin, tMax; 175 double tMin, tMax;
176 if (tCount == 1) { 176 if (tCount == 1) {
177 tMin = tMax = tsFound[0]; 177 tMin = tMax = tsFound[0];
178 } else if (tCount > 1) { 178 } else {
179 SkASSERT(tCount > 1);
179 SkTQSort<double>(tsFound.begin(), tsFound.end() - 1); 180 SkTQSort<double>(tsFound.begin(), tsFound.end() - 1);
180 tMin = tsFound[0]; 181 tMin = tsFound[0];
181 tMax = tsFound[tsFound.count() - 1]; 182 tMax = tsFound[tsFound.count() - 1];
182 } 183 }
183 SkDPoint end = q2.xyAtT(t2s); 184 SkDPoint end = q2.xyAtT(t2s);
184 bool startInTriangle = hull.pointInHull(end); 185 bool startInTriangle = hull.pointInHull(end);
185 if (startInTriangle) { 186 if (startInTriangle) {
186 tMin = t2s; 187 tMin = t2s;
187 } 188 }
188 end = q2.xyAtT(t2e); 189 end = q2.xyAtT(t2e);
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 499 }
499 if (lowestIndex < 0) { 500 if (lowestIndex < 0) {
500 break; 501 break;
501 } 502 }
502 insert(roots1Copy[lowestIndex], roots2Copy[closest[lowestIndex]], 503 insert(roots1Copy[lowestIndex], roots2Copy[closest[lowestIndex]],
503 pts1[lowestIndex]); 504 pts1[lowestIndex]);
504 closest[lowestIndex] = -1; 505 closest[lowestIndex] = -1;
505 } while (++used < r1Count); 506 } while (++used < r1Count);
506 return fUsed; 507 return fUsed;
507 } 508 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698