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
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index 9a0223d..64c2728 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -1187,6 +1187,7 @@
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 194b926..4f3f759 100644
--- a/tests/AAClipTest.cpp
+++ b/tests/AAClipTest.cpp
@@ -313,12 +313,27 @@
}
}
+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"