Fix for out-of-bounds intersection (found by fuzzer).
authorsenorblanco <senorblanco@chromium.org>
Mon, 2 Mar 2015 17:34:13 +0000 (09:34 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 2 Mar 2015 17:34:13 +0000 (09:34 -0800)
commita2b6d28755916cbb4817cd9d1cd1b0e237de9a50
treef801855466786da0e0100752e4aadd8caa619c07
parentb3310c222104d9234970c684d2b88b13038db7f0
Fix for out-of-bounds intersection (found by fuzzer).

Sometimes, the intersection returned by check_intersection() is
out-of-bounds for both edges (above both tops or below both bottoms)
due to floating-point inaccuracy. This causes split_edge() to create a
tiny negative-length edge on one side (which would then assert).
Although we could safely remove this assert and allow the negative
length edge to be removed, it's faster/safer to simply avoid its
creation in the first place by adjusting one edge to the other edge's
endpoint.

Added a new unit test to exercise this case.

Review URL: https://codereview.chromium.org/968993002
src/gpu/GrTessellatingPathRenderer.cpp
tests/TessellatingPathRendererTests.cpp