aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2018-05-29 11:50:41 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-29 17:10:16 +0000
commitbfb2a05af105f452a0f369e39dae05f9224dfa19 (patch)
tree9e78935c2c58d962eb473fef5aa1ddbd47c48071 /tests
parent36be574e7bd5eb8bb41e2a0a15085e27b340cf4d (diff)
GrTessellator: fix for ping-pong split fuzzer hang.
Change 3b5a3fa8b1c11d4bd4499b040311f4c3553ebf8c introduced support for splitting on out-of-range intersections. However, this is only necessary for correctness when the edge is nearly-flat (the top and bottom points only differ by 1/2 machine epsilon in the primary sort criterion). In other cases, it can cause repeated splitting and re-merging of edges, as the intersection code (being approximate and not exact) may produce a ping-pong set of intersections. The fix is to support out-of-range intersections only if they differ by 1/2 machine epsilon. This also generalizes the out_of_range_and_collinear() check, so it was removed. Bug: 838978 Change-Id: I134f7eff3f15707e0d68de11c55f7fadce4ff8e7 Reviewed-on: https://skia-review.googlesource.com/130448 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/TessellatingPathRendererTests.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index 00f43985dd..a2dc95986e 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -502,6 +502,16 @@ static SkPath create_path_33() {
return path;
}
+// From crbug.com/844873. Hangs repeatedly splitting alternate vertices.
+static SkPath create_path_34() {
+ SkPath path;
+ path.moveTo(10, -1e+20f);
+ path.lineTo(11, 25000);
+ path.lineTo(10, 25000);
+ path.lineTo(11, 25010);
+ return path;
+}
+
static std::unique_ptr<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ctx) {
SkPoint pts[2] = { {0, 0}, {1, 1} };
@@ -595,5 +605,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
test_path(ctx, rtc.get(), create_path_31(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_32());
test_path(ctx, rtc.get(), create_path_33());
+ test_path(ctx, rtc.get(), create_path_34());
}
#endif