Improve _soft16_scanline_fill_transp_solid(), with bugfix.

Author: Gustavo Sverzut Barbieri <barbieri@gmail.com>


SVN revision: 30407
This commit is contained in:
Gustavo Sverzut Barbieri 2007-06-19 22:51:39 +00:00
parent 219b036d37
commit 4f1b4fb1aa
1 changed files with 22 additions and 23 deletions

View File

@ -1106,33 +1106,32 @@ _soft16_scanline_fill_solid_solid(DATA16 *dst, int size, DATA16 rgb565)
static inline void
_soft16_scanline_fill_transp_solid(DATA16 *dst, int size, DATA32 rgb565_unpack, char alpha)
{
DATA16 *start, *end;
DATA32 a;
DATA16 *start, *end;
DATA32 a;
start = dst;
pld(start, 0);
end = start + (size & ~7);
start = dst;
pld(start, 0);
end = start + (size & ~7);
while (start < end) {
pld(start, 32);
UNROLL8({
DATA32 b;
b = RGB_565_UNPACK(*start);
b = RGB_565_UNPACKED_BLEND(rgb565_unpack, b, alpha);
*start = RGB_565_PACK(b);
start++;
});
}
#define BLEND(dst) \
{ DATA32 b; \
b = RGB_565_UNPACK(dst); \
b = RGB_565_UNPACKED_BLEND(rgb565_unpack, b, alpha); \
dst = RGB_565_PACK(b); }
size &= 7;
while (start < end)
{
pld(start, 32);
UNROLL8({
BLEND(*start);
start++;
});
}
while (size--) {
DATA32 b;
b = RGB_565_UNPACK(*start);
b = RGB_565_UNPACKED_BLEND(rgb565_unpack, b, alpha);
*start = RGB_565_PACK(b);
start++;
}
end = start + (size & 7);
for (; start < end; start++)
BLEND(*start);
#undef BLEND
}
/***********************************************************************