Bugfixes to antialiased blitting.
More details of blitter contracts in function headers.
New precautionary assert in one high-level default blitter.
git-svn-id: http://skia.googlecode.com/svn/trunk@2928 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 6d2d512..265ae6b 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -47,6 +47,7 @@
}
void SkBlitter::blitRect(int x, int y, int width, int height) {
+ SkASSERT(width >= 0);
while (--height >= 0) {
this->blitH(x, y++, width);
}
@@ -57,9 +58,12 @@
/// may not support.
void SkBlitter::blitAntiRect(int x, int y, int width, int height,
SkAlpha leftAlpha, SkAlpha rightAlpha) {
- this->blitV(x, y, height, leftAlpha);
- this->blitRect(x + 1, y, width, height);
- this->blitV(x + width + 1, y, height, rightAlpha);
+ this->blitV(x++, y, height, leftAlpha);
+ if (width >= 0) {
+ this->blitRect(x, y, width, height);
+ x += width;
+ }
+ this->blitV(x, y, height, rightAlpha);
}
//////////////////////////////////////////////////////////////////////////////