aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TessellatingPathRendererTests.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2018-06-29 17:02:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-02 21:03:43 +0000
commit24289e05d55ccdc04ef239c7972d2b52e402ad0f (patch)
treefe43efa9e511fa7ef67355d929436761ab36b1d4 /tests/TessellatingPathRendererTests.cpp
parente886e80e8b204460a78dabf5c671b7f4146d71f7 (diff)
GrTessellator: handle three consecutive collinear edges.
In some cases, splitting may produce three consecutive edges which are collinear. The first one was being merged out, causing the third one to be missed. The fix is to switch the arguments to merge_edges_*, ensuring that the second parameter (the destination edge) is never merged out. Bug: 851409 Change-Id: I65be2e8222846c99f7bc8d17ea61ddead617cc31 Reviewed-on: https://skia-review.googlesource.com/138700 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.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index a9913769df..0c7a5ca4c5 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -560,7 +560,7 @@ static SkPath create_path_38() {
return path;
}
-// Reduction from crbug.com/851409.
+// Reduction from crbug.com/851409. Exercises collinear last vertex.
static SkPath create_path_39() {
SkPath path;
path.moveTo(2072553216, 0);
@@ -571,6 +571,18 @@ static SkPath create_path_39() {
return path;
}
+// Another reduction from crbug.com/851409. Exercises two sequential collinear edges.
+static SkPath create_path_40() {
+ SkPath path;
+ path.moveTo(2072553216, 0);
+ path.lineTo(2072553216, 1);
+ path.lineTo(2072553472, -13);
+ path.lineTo(2072553216, 0);
+ path.lineTo(2072553472, -6);
+ path.lineTo(2072553472, -13);
+ return path;
+}
+
static std::unique_ptr<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ctx) {
SkPoint pts[2] = { {0, 0}, {1, 1} };
@@ -670,4 +682,5 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
test_path(ctx, rtc.get(), create_path_37());
test_path(ctx, rtc.get(), create_path_38(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_39());
+ test_path(ctx, rtc.get(), create_path_40());
}