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

Unified Diff: trunk/src/core/SkStroke.cpp

Issue 12567006: fix handling of stroked cubics when we exhaust our recursion limit. (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 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 | « trunk/gm/cubicpaths.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/core/SkStroke.cpp
===================================================================
--- trunk/src/core/SkStroke.cpp (revision 8043)
+++ trunk/src/core/SkStroke.cpp (working copy)
@@ -303,13 +303,23 @@
SkAssertResult(set_normal_unitnormal(cd, fRadius, normalCD, unitNormalCD));
bool degenerateBC = !set_normal_unitnormal(pts[1], pts[2], fRadius,
&normalBC, &unitNormalBC);
-
+#ifndef SK_IGNORE_CUBIC_STROKE_FIX
+ if (subDivide <= 0) {
+ if (degenerateBC) {
+ goto DRAW_LINE;
+ } else {
+ goto DRAW_CUBIC;
+ }
+ }
+#endif
if (degenerateBC || normals_too_curvy(unitNormalAB, unitNormalBC) ||
normals_too_curvy(unitNormalBC, *unitNormalCD)) {
+#ifdef SK_IGNORE_CUBIC_STROKE_FIX
// subdivide if we can
if (--subDivide < 0) {
goto DRAW_LINE;
}
+#endif
SkPoint tmp[7];
SkVector norm, unit, dummy, unitDummy;
@@ -320,6 +330,9 @@
// normals for CD
this->cubic_to(&tmp[3], norm, unit, &dummy, &unitDummy, subDivide);
} else {
+#ifndef SK_IGNORE_CUBIC_STROKE_FIX
+ DRAW_CUBIC:
+#endif
SkVector normalB, normalC;
// need normals to inset/outset the off-curve pts B and C
« no previous file with comments | « trunk/gm/cubicpaths.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698