diff options
author | 2012-02-29 13:59:15 +0000 | |
---|---|---|
committer | 2012-02-29 13:59:15 +0000 | |
commit | 9b0da23f0af145ffd9795b4b55b9527ac050d0b0 (patch) | |
tree | 907ac9de578f466d103ba0688cb909b7727daa6a | |
parent | aefdd062717dd6182e0f87d727c807af4314d445 (diff) |
fix bug and add test for aaclip when blitV is called
git-svn-id: http://skia.googlecode.com/svn/trunk@3281 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/core/SkAAClip.cpp | 1 | ||||
-rw-r--r-- | tests/AAClipTest.cpp | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp index 9a0223d231..64c27284a4 100644 --- a/src/core/SkAAClip.cpp +++ b/src/core/SkAAClip.cpp @@ -1187,6 +1187,7 @@ public: virtual void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE { this->recordMinY(y); fBuilder->addColumn(x, y, alpha, height); + fLastY = y + height - 1; } virtual void blitRect(int x, int y, int width, int height) SK_OVERRIDE { diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp index 194b92680c..4f3f7597f9 100644 --- a/tests/AAClipTest.cpp +++ b/tests/AAClipTest.cpp @@ -313,12 +313,27 @@ static void test_path_with_hole(skiatest::Reporter* reporter) { } } +static void test_regressions(skiatest::Reporter* reporter) { + // these should not assert in the debug build + // bug was introduced in rev. 3209 + { + SkAAClip clip; + SkRect r; + r.fLeft = SkFloatToScalar(129.892181); + r.fTop = SkFloatToScalar(10.3999996); + r.fRight = SkFloatToScalar(130.892181); + r.fBottom = SkFloatToScalar(20.3999996); + clip.setRect(r, true); + } +} + static void TestAAClip(skiatest::Reporter* reporter) { test_empty(reporter); test_path_bounds(reporter); test_irect(reporter); test_rgn(reporter); test_path_with_hole(reporter); + test_regressions(reporter); } #include "TestClassDef.h" |