diff options
author | Stephen White <senorblanco@chromium.org> | 2017-05-03 16:00:38 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-04 05:10:48 +0000 |
commit | 64dbb89efc9daba9f62b4a385354a77aaa54861e (patch) | |
tree | 5c2dd79f543b09b066d48c9bc085f4fededc8470 /tests | |
parent | 0356714916c3279c88013e5bc6064f6b81d5fe5f (diff) |
GrTessellator: fix for vertex coincident with enclosing edge.
If a previously-enclosing edge coincides exactly with the current
vertex, there are no two adjacent edges which enclose the vertex.
Since find_enclosing_edges() ensures that the left enclosing edge
is to the left of the vertex, the fix is to split the right
enclosing edge on the current vertex and restart intersection
tests.
Bug: 716720
Change-Id: Id26c5b92a6d6139f348e99554638cded37e81a8e
Reviewed-on: https://skia-review.googlesource.com/15261
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TessellatingPathRendererTests.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp index 162dd7ea80..79385af956 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -261,6 +261,19 @@ static SkPath create_path_17() { return path; } +// A shape with a vertex collinear to the right hand edge. +// This messes up find_enclosing_edges. +static SkPath create_path_18() { + SkPath path; + path.moveTo(80, 20); + path.lineTo(80, 60); + path.lineTo(20, 60); + path.moveTo(80, 50); + path.lineTo(80, 80); + path.lineTo(20, 80); + return path; +} + static sk_sp<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ctx) { SkPoint pts[2] = { {0, 0}, {1, 1} }; SkColor colors[2] = { SK_ColorGREEN, SK_ColorBLUE }; @@ -335,5 +348,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { SkMatrix nonInvertibleMatrix = SkMatrix::MakeScale(0, 0); sk_sp<GrFragmentProcessor> fp(create_linear_gradient_processor(ctx)); test_path(ctx, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp); + test_path(ctx, rtc.get(), create_path_18()); } #endif |