aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-17 19:21:01 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-17 19:21:01 +0000
commit0ea42c1d2c35cc05564800f5006d5ae55ef28f6f (patch)
treecfef2b09d7a89207e1cae4e80cd46b8ae71e041b /src/core
parentad687ceae225a8bd5af2acbca5382b6147af29d7 (diff)
fallback to drawing a line if the cubic is still too curvy, even if we've
exhausted our recursive attempts to subdivide. Fixes trying to stroke this cubic (width==1.0) path.moveTo(460.2881309415525, 303.250847066498); path.cubicTo(463.36378422175284, 302.1169735073363, 456.32239330810046, 304.720354932878, 453.15255460013304, 305.788586869862); git-svn-id: http://skia.googlecode.com/svn/trunk@219 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkStroke.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index 30d524ed9b..45ad0efd78 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -302,9 +302,13 @@ DRAW_LINE:
bool degenerateBC = !set_normal_unitnormal(pts[1], pts[2], fRadius,
&normalBC, &unitNormalBC);
- if (--subDivide >= 0 &&
- (degenerateBC || normals_too_curvy(unitNormalAB, unitNormalBC) ||
- normals_too_curvy(unitNormalBC, *unitNormalCD))) {
+
+ if (degenerateBC || normals_too_curvy(unitNormalAB, unitNormalBC) ||
+ normals_too_curvy(unitNormalBC, *unitNormalCD)) {
+ // subdivide if we can
+ if (--subDivide < 0) {
+ goto DRAW_LINE;
+ }
SkPoint tmp[7];
SkVector norm, unit, dummy, unitDummy;