aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlitter.cpp
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-28 17:58:07 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-28 17:58:07 +0000
commit4714359ec091b34a4f88eb9708868a58a22177d3 (patch)
tree540246da2514658a244eed3bf6c7d53fd2a628b5 /src/core/SkBlitter.cpp
parent6fc7cc23a9c33960b879f69d92d6fb0e1373e556 (diff)
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
Diffstat (limited to 'src/core/SkBlitter.cpp')
-rw-r--r--src/core/SkBlitter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 6d2d51201c..265ae6b6ef 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -47,6 +47,7 @@ void SkBlitter::blitV(int x, int y, int height, SkAlpha alpha) {
}
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 @@ void SkBlitter::blitRect(int x, int y, int width, int height) {
/// 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);
}
//////////////////////////////////////////////////////////////////////////////