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

Unified Diff: src/pathops/SkDCubicLineIntersection.cpp

Issue 265453009: remove inverse_paths from ignored tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: experiment with 128 bit floats Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/pathops_unittest.gyp ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkDCubicLineIntersection.cpp
diff --git a/src/pathops/SkDCubicLineIntersection.cpp b/src/pathops/SkDCubicLineIntersection.cpp
index da4b983d457049b4a82f7975187acbf30881d910..aadc15a5ba55877a3f3946c56dfad9bca9a3f467 100644
--- a/src/pathops/SkDCubicLineIntersection.cpp
+++ b/src/pathops/SkDCubicLineIntersection.cpp
@@ -146,11 +146,22 @@ public:
return fIntersections->used();
}
- int horizontalIntersect(double axisIntercept, double roots[3]) {
+ int horizontalIntersect(double axisIntercept, double validRoots[3]) {
double A, B, C, D;
SkDCubic::Coefficients(&fCubic[0].fY, &A, &B, &C, &D);
D -= axisIntercept;
- return SkDCubic::RootsValidT(A, B, C, D, roots);
+ int realCount;
+ double allRoots[3];
+ int validCount = SkDCubic::RootsValidT(A, B, C, D, allRoots, &realCount, validRoots);
+ if (validCount >= 0) {
+ return validCount;
+ }
+ SkDPoint calcPt = fCubic.ptAtT(validRoots[0]);
+ if (approximately_equal(calcPt.fY, axisIntercept)) {
+ return 1;
+ }
+ fCubic.searchRoots(allRoots, realCount, &validRoots[0], axisIntercept, false);
+ return 1;
}
int horizontalIntersect(double axisIntercept, double left, double right, bool flipped) {
« no previous file with comments | « gyp/pathops_unittest.gyp ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698