From f7398c3ab61053597541fa0b3cfc710006a3e62b Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Thu, 5 May 2011 14:24:47 +0000 Subject: [PATCH] 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 --- src/core/SkScan_Antihair.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/core/SkScan_Antihair.cpp b/src/core/SkScan_Antihair.cpp index 99bd2c85bf..b84c576c15 100644 --- a/src/core/SkScan_Antihair.cpp +++ b/src/core/SkScan_Antihair.cpp @@ -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); + } } }