|
When solving the cubic line intersection directly fails, use binary search as a fallback.
The cubic line intersection math empirically works 99.99% of the time (fails 3100 out of 1B random tests) but when it fails, an intersection may be missed altogether.
The binary search is may not find a solution if the cubic line failed to find any solutions at all, but so far that case hasn't arisen.
BUG= skia:2504
TBR=reed@google.com
Committed: http://code.google.com/p/skia/source/detail?r=14614
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+538 lines, -37 lines) |
Patch |
|
M |
gyp/pathops_unittest.gyp
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/pathops/SkDCubicLineIntersection.cpp
|
View
|
1
|
5 chunks |
+58 lines, -20 lines |
0 comments
|
Download
|
|
M |
src/pathops/SkPathOpsCubic.h
|
View
|
1
|
4 chunks |
+22 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/pathops/SkPathOpsCubic.cpp
|
View
|
1
|
3 chunks |
+71 lines, -1 line |
0 comments
|
Download
|
|
M |
src/pathops/SkPathOpsDebug.h
|
View
|
1
2
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/pathops/SkPathOpsTypes.h
|
View
|
1
|
1 chunk |
+1 line, -3 lines |
0 comments
|
Download
|
|
M |
src/pathops/SkPathOpsTypes.cpp
|
View
|
1
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
tests/PathOpsCubicLineIntersectionIdeas.cpp
|
View
|
1
2
|
1 chunk |
+283 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/PathOpsCubicLineIntersectionTest.cpp
|
View
|
2
|
3 chunks |
+34 lines, -1 line |
0 comments
|
Download
|
|
M |
tests/PathOpsOpTest.cpp
|
View
|
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
|
M |
tools/pathops_sorter.htm
|
View
|
1
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
Total messages: 3 (0 generated)
|