correctly compute coverage when an antialiased rect covers only 1 column of pixels

git-svn-id: http://skia.googlecode.com/svn/trunk@1256 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-05-05 14:24:47 +00:00
parent 70b6125ed2
commit f7398c3ab6

View File

@ -533,17 +533,21 @@ static void antifilldot8(FDot8 L, FDot8 T, FDot8 R, FDot8 B, SkBlitter* blitter,
int height = bot - top;
if (height > 0) {
int left = L >> 8;
if (L & 0xFF) {
blitter->blitV(left, top, height, 256 - (L & 0xFF));
left += 1;
}
int rite = R >> 8;
int width = rite - left;
if (width > 0 && fillInner) {
blitter->blitRect(left, top, width, height);
}
if (R & 0xFF) {
blitter->blitV(rite, top, height, R & 0xFF);
if (left == ((R - 1) >> 8)) { // just 1-pixel wide
blitter->blitV(left, top, height, R - L - 1);
} else {
if (L & 0xFF) {
blitter->blitV(left, top, height, 256 - (L & 0xFF));
left += 1;
}
int rite = R >> 8;
int width = rite - left;
if (width > 0 && fillInner) {
blitter->blitRect(left, top, width, height);
}
if (R & 0xFF) {
blitter->blitV(rite, top, height, R & 0xFF);
}
}
}