From 89042d5f13a56d6b663657aa58f17593123a344e Mon Sep 17 00:00:00 2001 From: Stephen White Date: Fri, 8 Jun 2018 12:18:22 -0400 Subject: GrTessellator: catch missing intersections. Sometimes the intersection check will miss an intersection (because floating point). This can leave the active edge list in an invalid state, where an edge pair is incorrectly ordered. The fix is to test for edge crossings after testing for intersections, and split the edges manually. This extra check may result in a performance hit, so we'll have to watch the perf bots carefully. Bug: 843135 Change-Id: If50320413026be503cdb2d33e6c97f620e4d51a9 Reviewed-on: https://skia-review.googlesource.com/133400 Reviewed-by: Robert Phillips Commit-Queue: Stephen White --- tests/TessellatingPathRendererTests.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/TessellatingPathRendererTests.cpp') diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp index 6ab76b0d88..6f2d8963dc 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -535,6 +535,17 @@ static SkPath create_path_36() { return path; } +// Reduction from crbug.com/843135. Exercises a case where an intersection is missed. +// This causes bad ordering in the active edge list. +static SkPath create_path_37() { + SkPath path; + path.moveTo(-1.0662557646016024569e+23, 9.9621425197286319718e+22); + path.lineTo( -121806400, 113805032); + path.lineTo( -120098872, 112209680); + path.lineTo( 6.2832999862817380468e-36, 2.9885697364807128906); + return path; +} + static std::unique_ptr create_linear_gradient_processor(GrContext* ctx) { SkPoint pts[2] = { {0, 0}, {1, 1} }; @@ -631,4 +642,5 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { test_path(ctx, rtc.get(), create_path_34()); test_path(ctx, rtc.get(), create_path_35()); test_path(ctx, rtc.get(), create_path_36()); + test_path(ctx, rtc.get(), create_path_37()); } -- cgit v1.2.3