aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TessellatingPathRendererTests.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2018-01-09 11:49:08 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 18:49:37 +0000
commite40c3610e4b713eb652491b8524dd1d4db117c5a (patch)
tree5fc5655ac783b249410d3b7da32bb489762db40f /tests/TessellatingPathRendererTests.cpp
parent9ff5dc9c9f222059a9e191b528fbb86999ecebf5 (diff)
GrTessellator: set a cap on quadratic linearization.
Some pathological cases don't converge to a reasonable number of points when using uniform linearization of quadratic points. Cap them to the maximum which GrPathUtils supports. Add reduced test case from crbug-762369. BUG=762369 Change-Id: Icc744018e5c01a0e0fe2ec00613bdb25e49614e9 Reviewed-on: https://skia-review.googlesource.com/92721 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 02db8d8a58..dfbb0045a6 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -428,6 +428,17 @@ static SkPath create_path_28() {
path.lineTo(-7.5952312625177475154e+21, -2.6819185100266674911e+24);
return path;
}
+
+// A quad which generates a huge number of points (>2B) when uniformly
+// linearized. This should not hang or OOM.
+static SkPath create_path_29() {
+ SkPath path;
+ path.moveTo(10, 0);
+ path.lineTo(0, 0);
+ path.quadTo(10, 0, 0, 8315084722602508288);
+ return path;
+}
+
static std::unique_ptr<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ctx) {
SkPoint pts[2] = { {0, 0}, {1, 1} };
@@ -519,5 +530,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
test_path(ctx, rtc.get(), create_path_26(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_27(), SkMatrix(), GrAAType::kCoverage);
test_path(ctx, rtc.get(), create_path_28(), SkMatrix(), GrAAType::kCoverage);
+ test_path(ctx, rtc.get(), create_path_29());
}
#endif