aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TessellatingPathRendererTests.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2017-06-08 14:41:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-08 20:07:04 +0000
commit0cb31675f3aa9cc878aa3a9e1a7ad09efdb350fc (patch)
treea1bb8cd30663f1972731a6a4ec6b622daac8a684 /tests/TessellatingPathRendererTests.cpp
parentdc792701012a99d3b7499952df1e55031fa4b795 (diff)
GrTessellator: fix intersection above the first vertex.
Handle the case where the an intersection falls not only above both edge endpoints, but above the first vertex in the mesh. This requires passing the mesh into check_for_intersection(), in order to modify the head. We also need to rewind the mesh after insertion, since we need to rewind to the newly-inserted vertex. This also cleans up vertex ID computation a little (for logging), so that vertices before the first vertex or after the last have a reasonable ID. It also cleans up the intersection-on-endpoint special cases by refactoring the calls to split_edge(). BUG=730687 Change-Id: Idea736eca7b7c3c5d8a470b1373a16ad8e649e80 Reviewed-on: https://skia-review.googlesource.com/19069 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
Diffstat (limited to 'tests/TessellatingPathRendererTests.cpp')
-rw-r--r--tests/TessellatingPathRendererTests.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index 7871193942..dd3b07ad99 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -314,6 +314,19 @@ static SkPath create_path_19() {
return path;
}
+// From clusterfuzz-testcase-minimized-6735316361936896
+// FIXME: [add description here]
+
+static SkPath create_path_20() {
+ SkPath path;
+ path.moveTo( 2822128.5, 235.026336669921875);
+ path.lineTo( 2819349.25, 235.3623504638671875);
+ path.lineTo( -340558688, 23.83478546142578125);
+ path.lineTo( -340558752, 25.510419845581054688);
+ path.lineTo( -340558720, 27.18605804443359375);
+ 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 };
@@ -390,5 +403,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
test_path(ctx, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp);
test_path(ctx, rtc.get(), create_path_18());
test_path(ctx, rtc.get(), create_path_19());
+ test_path(ctx, rtc.get(), create_path_20(), SkMatrix(), GrAAType::kCoverage);
}
#endif