Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: tests/PathTest.cpp

Issue 14086002: fix bug introduced with SK_IGNORE_CUBIC_STROKE_FIX where we no longer respected (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkStroke.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathTest.cpp
===================================================================
--- tests/PathTest.cpp (revision 8581)
+++ tests/PathTest.cpp (working copy)
@@ -31,6 +31,28 @@
return SkSurface::NewRaster(info);
}
+static void test_bad_cubic_crbug229478() {
+ const SkPoint pts[] = {
+ { 4595.91064f, -11596.9873f },
+ { 4597.2168f, -11595.9414f },
+ { 4598.52344f, -11594.8955f },
+ { 4599.83008f, -11593.8496f },
+ };
+
+ SkPath path;
+ path.moveTo(pts[0]);
+ path.cubicTo(pts[1], pts[2], pts[3]);
+
+ SkPaint paint;
+ paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStrokeWidth(20);
+
+ SkPath dst;
+ // Before the fix, this would infinite-recurse, and run out of stack
+ // because we would keep trying to subdivide a degenerate cubic segment.
+ paint.getFillPath(path, &dst, NULL);
+}
+
static void build_path_170666(SkPath& path) {
path.moveTo(17.9459f, 21.6344f);
path.lineTo(139.545f, -47.8105f);
@@ -2353,6 +2375,7 @@
test_tricky_cubic();
test_clipped_cubic();
test_crbug_170666();
+ test_bad_cubic_crbug229478();
}
#include "TestClassDef.h"
« no previous file with comments | « src/core/SkStroke.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698