From 9b0da23f0af145ffd9795b4b55b9527ac050d0b0 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 29 Feb 2012 13:59:15 +0000 Subject: [PATCH] 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 --- src/core/SkAAClip.cpp | 1 + tests/AAClipTest.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) 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"