diff options
author | Stephen White <senorblanco@chromium.org> | 2018-03-28 14:41:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-28 19:55:34 +0000 |
commit | 050c86768a2c24c62655f53ef9b685d40477eccb (patch) | |
tree | 60e89b1c28d62bee2b7d1498bfffcc46963b2e23 /tests/TessellatingPathRendererTests.cpp | |
parent | 6eba063b63efbf824aff8ec6b32af05e4d54c38b (diff) |
GrTessellator: hang fix.
Some edges are not coincident with their own endpoints (because floating
point). If this happens for an edge which is a right-enclosing-edge
during the Bentley-Ottman simplify() pass, we end up an infinite loop
attempting to split the edge, since the edge is never to the right of its
endpoint.
The easiest fix is to simply remove the right-enclosing-edge splitting
code. This code was originally added before we had proper
active-edge-list rewinding, and should no longer be necessary.
BUG=802896
Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827
Reviewed-on: https://skia-review.googlesource.com/116920
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'tests/TessellatingPathRendererTests.cpp')
-rw-r--r-- | tests/TessellatingPathRendererTests.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp index 451391762d..035b3fe323 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -439,6 +439,27 @@ static SkPath create_path_29() { return path; } +// A path which hangs during simplification. It produces an edge which is +// to the left of its own endpoints, which causes an infinte loop in the +// right-enclosing-edge splitting. +static SkPath create_path_30() { + SkPath path; + path.moveTo(0.75001740455627441406, 23.051967620849609375); + path.lineTo(5.8471612930297851562, 22.731662750244140625); + path.lineTo(10.749670028686523438, 22.253145217895507812); + path.lineTo(13.115868568420410156, 22.180681228637695312); + path.lineTo(15.418928146362304688, 22.340015411376953125); + path.lineTo( 17.654022216796875, 22.82159423828125); + path.lineTo(19.81632232666015625, 23.715869903564453125); + path.lineTo(40, 0); + path.lineTo(5.5635203441547955577e-15, 0); + path.lineTo(5.5635203441547955577e-15, 47); + path.lineTo(-1.4210854715202003717e-14, 21.713298797607421875); + path.lineTo(0.75001740455627441406, 21.694292068481445312); + path.lineTo(0.75001740455627441406, 23.051967620849609375); + return path; +} + static std::unique_ptr<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ctx) { SkPoint pts[2] = { {0, 0}, {1, 1} }; @@ -529,5 +550,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { test_path(ctx, rtc.get(), create_path_27(), SkMatrix(), GrAAType::kCoverage); test_path(ctx, rtc.get(), create_path_28(), SkMatrix(), GrAAType::kCoverage); test_path(ctx, rtc.get(), create_path_29()); + test_path(ctx, rtc.get(), create_path_30()); } #endif |