Fix bug in cubic-clipper (SkEdgeClipper). When we chop the cubic on Top/Bottom
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 15 Jan 2013 15:51:59 +0000 (15:51 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 15 Jan 2013 15:51:59 +0000 (15:51 +0000)
commit848148ec109172f9eef9a26fa23a520cf9072b5c
tree71324822a4ba84ae4d1106d9c6e8bf191a4d9235
parent96b17aa461068bc9c222cb4b235231ed9c2d275c
Fix bug in cubic-clipper (SkEdgeClipper). When we chop the cubic on Top/Bottom
of the cliprect, we (correctly) clamp the Y coordinate of the control-point
right next to the on-curve point that was chopped (this ensures we don't go
slightly outside of the clip-rect due to imperfect T value calculation). However,
the code was also clamping the other control-point as well, resulting in warping
the cubic, which could sometimes force it outside of the clip.

The fix is to just remove the line of code that clampped the 2nd control-point.

unittest added to reproduce a test cubic that triggered an assert, due to the
cubic being outside of the cliprect. The test (w/o the fix) will assert in
a SK_DEBUG build.
Review URL: https://codereview.appspot.com/7100056

git-svn-id: http://skia.googlecode.com/svn/trunk@7184 2bbb7eff-a529-9590-31e7-b0007b416f81
src/core/SkEdgeClipper.cpp
tests/PathTest.cpp