From 13f3d8d4bc6863c7d890781021555fb6f65936e0 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Fri, 22 Jun 2018 10:19:20 -0400 Subject: GrTessellator: avoid split with zero primary and out-of-range secondary. Sometimes the intersector will return an intersection which is on the same primary sort criterion (eg., Y coordinate), but out-of-range on the secondary. We shouldn't do splits in this case. The only case we really care about is if it's less than one epsilon and greater than zero, and thus numerically unsplittable. Bug: 851914 Change-Id: Ia772763b6a66a14ca159cf409a832835244e83bc Reviewed-on: https://skia-review.googlesource.com/136803 Reviewed-by: Robert Phillips Commit-Queue: Stephen White --- tests/TessellatingPathRendererTests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/TessellatingPathRendererTests.cpp') diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp index 6f2d8963dc..0b30feecc0 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -546,6 +546,20 @@ static SkPath create_path_37() { return path; } +// Reduction from crbug.com/851914. +static SkPath create_path_38() { + SkPath path; + path.moveTo(14.400531768798828125, 17.711114883422851562); + path.lineTo(14.621990203857421875, 171563104293879808); + path.lineTo(14.027951240539550781, 872585759381520384); + path.lineTo( 14.0216827392578125, 872665817571917824); + path.lineTo(7.699314117431640625, -3417320793833472); + path.moveTo(11.606547355651855469, 17.40966796875); + path.lineTo( 7642114886926860288, 21.08358001708984375); + path.lineTo(11.606547355651855469, 21.08358001708984375); + return path; +} + static std::unique_ptr create_linear_gradient_processor(GrContext* ctx) { SkPoint pts[2] = { {0, 0}, {1, 1} }; @@ -643,4 +657,5 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { test_path(ctx, rtc.get(), create_path_35()); test_path(ctx, rtc.get(), create_path_36()); test_path(ctx, rtc.get(), create_path_37()); + test_path(ctx, rtc.get(), create_path_38(), SkMatrix(), GrAAType::kCoverage); } -- cgit v1.2.3