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

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

Issue 272153002: fix bugs found by computing flat clips in 800K skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix maybe-uninitialized error in unbuntu Created 6 years, 6 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/SkDLineIntersection.cpp ('k') | src/pathops/SkDQuadLineIntersection.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 // 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 #include "SkDQuadImplicit.h" 7 #include "SkDQuadImplicit.h"
8 #include "SkIntersections.h" 8 #include "SkIntersections.h"
9 #include "SkPathOpsLine.h" 9 #include "SkPathOpsLine.h"
10 #include "SkQuarticRoot.h" 10 #include "SkQuarticRoot.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 // see if either quad is really a line 416 // see if either quad is really a line
417 // FIXME: figure out why reduce step didn't find this earlier 417 // FIXME: figure out why reduce step didn't find this earlier
418 if (is_linear(q1, q2, this)) { 418 if (is_linear(q1, q2, this)) {
419 return fUsed; 419 return fUsed;
420 } 420 }
421 SkIntersections swapped; 421 SkIntersections swapped;
422 swapped.setMax(fMax); 422 swapped.setMax(fMax);
423 if (is_linear(q2, q1, &swapped)) { 423 if (is_linear(q2, q1, &swapped)) {
424 swapped.swapPts(); 424 swapped.swapPts();
425 set(swapped); 425 *this = swapped;
426 return fUsed; 426 return fUsed;
427 } 427 }
428 SkIntersections copyI(*this); 428 SkIntersections copyI(*this);
429 lookNearEnd(q1, q2, 0, *this, false, &copyI); 429 lookNearEnd(q1, q2, 0, *this, false, &copyI);
430 lookNearEnd(q1, q2, 1, *this, false, &copyI); 430 lookNearEnd(q1, q2, 1, *this, false, &copyI);
431 lookNearEnd(q2, q1, 0, *this, true, &copyI); 431 lookNearEnd(q2, q1, 0, *this, true, &copyI);
432 lookNearEnd(q2, q1, 1, *this, true, &copyI); 432 lookNearEnd(q2, q1, 1, *this, true, &copyI);
433 int innerEqual = 0; 433 int innerEqual = 0;
434 if (copyI.fUsed >= 2) { 434 if (copyI.fUsed >= 2) {
435 SkASSERT(copyI.fUsed <= 4); 435 SkASSERT(copyI.fUsed <= 4);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 if (lowestIndex < 0) { 547 if (lowestIndex < 0) {
548 break; 548 break;
549 } 549 }
550 insert(roots1Copy[lowestIndex], roots2Copy[closest[lowestIndex]], 550 insert(roots1Copy[lowestIndex], roots2Copy[closest[lowestIndex]],
551 pts1[lowestIndex]); 551 pts1[lowestIndex]);
552 closest[lowestIndex] = -1; 552 closest[lowestIndex] = -1;
553 } while (++used < r1Count); 553 } while (++used < r1Count);
554 return fUsed; 554 return fUsed;
555 } 555 }
OLDNEW
« no previous file with comments | « src/pathops/SkDLineIntersection.cpp ('k') | src/pathops/SkDQuadLineIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698