aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TessellatingPathRendererTests.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2017-08-22 13:41:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-22 18:38:37 +0000
commit620cc248517a509040d3f94f29710edf3a151c5b (patch)
tree78885264aa06b5524d7ec67087a5c713d9063480 /tests/TessellatingPathRendererTests.cpp
parent0b52510dafcdbb34458f106c66eb9d78f611b48f (diff)
GrTessellator: when sanitizing contours, remove non-finite points.
NaNs can't be correctly sorted. Bug: 757650 Change-Id: Id1ca2fe1d1de7884da2a64ceef9491b1da7e8e77 Reviewed-on: https://skia-review.googlesource.com/37220 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.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index dbb328e3e3..786978118b 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -362,6 +362,17 @@ static SkPath create_path_23() {
return path;
}
+// A path which results in infs and nans when conics are converted to quads.
+static SkPath create_path_24() {
+ SkPath path;
+ path.moveTo(-2.20883e+37f, -1.02892e+37f);
+ path.conicTo(-2.00958e+38f, -9.36107e+37f, -1.7887e+38f, -8.33215e+37f, 0.707107f);
+ path.conicTo(-1.56782e+38f, -7.30323e+37f, 2.20883e+37f, 1.02892e+37f, 0.707107f);
+ path.conicTo(2.00958e+38f, 9.36107e+37f, 1.7887e+38f, 8.33215e+37f, 0.707107f);
+ path.conicTo(1.56782e+38f, 7.30323e+37f, -2.20883e+37f, -1.02892e+37f, 0.707107f);
+ return path;
+}
+
static std::unique_ptr<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ctx) {
SkPoint pts[2] = { {0, 0}, {1, 1} };
SkColor colors[2] = { SK_ColorGREEN, SK_ColorBLUE };
@@ -443,5 +454,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
test_path(ctx, rtc.get(), create_path_21(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_22());
test_path(ctx, rtc.get(), create_path_23());
+ test_path(ctx, rtc.get(), create_path_24());
}
#endif