diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-12 12:57:04 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-12 12:57:04 +0000 |
commit | 5687a3e93b53cc2240649a78034f406156cc3f4e (patch) | |
tree | 5a89d4f72dd66aedcdae8d29c7c68a570a76c276 | |
parent | ff6ea2663f76aa85ec55ddd0f00ca7906f1bc4e3 (diff) |
fix handling of stroked cubics when we exhaust our recursion limit.
Review URL: https://codereview.chromium.org/12567006
git-svn-id: http://skia.googlecode.com/svn/trunk@8093 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkStroke.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index dfd0bd2d1c..75c371f241 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -303,13 +303,23 @@ DRAW_LINE: 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 @@ DRAW_LINE: // 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 |