From 8cae8358f78b81539f1006afe592a37f1604e67c Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 14 Sep 2012 15:18:41 +0000 Subject: fix fragile cubic stepper, where we want to assert that each tesselated segment is monotonically going down, but the finite math we use cannot ensure that... so we explicitly pin the y-value after it is calculated. add unittest that exercises the bug/assert that was found on an SVG site git-svn-id: http://skia.googlecode.com/svn/trunk@5544 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkEdge.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp index 8a6d1710c9..4c264c2eb9 100644 --- a/src/core/SkEdge.cpp +++ b/src/core/SkEdge.cpp @@ -476,6 +476,13 @@ int SkCubicEdge::updateCubic() newx = fCLastX; newy = fCLastY; } + + // we want to say SkASSERT(oldy <= newy), but our finite fixedpoint + // doesn't always achieve that, so we have to explicitly pin it here. + if (newy < oldy) { + newy = oldy; + } + success = this->updateLine(oldx, oldy, newx, newy); oldx = newx; oldy = newy; -- cgit v1.2.3