Fix off-by-one error in assertion; improve coverage_to_exact_alpha()
implementation. http://codereview.appspot.com/5504116/ git-svn-id: http://skia.googlecode.com/svn/trunk@2947 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
abf00aaaa0
commit
31bab3934c
@ -487,7 +487,7 @@ void SkRgnClipBlitter::blitAntiRect(int x, int y, int width, int height,
|
||||
const SkIRect& r = iter.rect();
|
||||
SkASSERT(bounds.contains(r));
|
||||
SkASSERT(r.fLeft >= x);
|
||||
SkASSERT(r.fRight < x + width + 2);
|
||||
SkASSERT(r.fRight <= x + width + 2);
|
||||
|
||||
SkAlpha effectiveLeftAlpha = (r.fLeft == x) ? leftAlpha : 255;
|
||||
SkAlpha effectiveRightAlpha = (r.fRight == x + width + 2) ?
|
||||
|
@ -157,9 +157,9 @@ static inline int coverage_to_alpha(int aa) {
|
||||
}
|
||||
|
||||
static inline int coverage_to_exact_alpha(int aa) {
|
||||
static int map [] = { 0, 64, 128, 192, 255 };
|
||||
SkASSERT(SHIFT == 2);
|
||||
return map[aa];
|
||||
int alpha = (256 >> SHIFT) * aa;
|
||||
// clamp 256->255
|
||||
return alpha - (alpha >> 8);
|
||||
}
|
||||
|
||||
void SuperBlitter::blitH(int x, int y, int width) {
|
||||
|
Loading…
Reference in New Issue
Block a user