1
0
Fork 0
forked from len0rd/rockbox

Greyscale library: * Introduced some extra macros dealing with block size, allowing to write some parts with less #ifdefing. * Optimised grey_update_rect() for horizontally packed LCDs, and unbuffered scrolling.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16050 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-01-10 22:51:33 +00:00
parent 12cc3cc47c
commit df5c3e15e8
4 changed files with 169 additions and 186 deletions

View file

@ -634,18 +634,15 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
if (y + height > _grey_info.height)
height = _grey_info.height - y;
src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */
src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */
do
{
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
int idx = _GREY_MULUQ(_grey_info.width, y) + x;
#else
#if LCD_DEPTH == 1
int idx = _GREY_MULUQ(_grey_info.width, y & ~7) + (x << 3) + (~y & 7);
#elif LCD_DEPTH == 2
int idx = _GREY_MULUQ(_grey_info.width, y & ~3) + (x << 2) + (~y & 3);
#endif
int idx = _GREY_MULUQ(_grey_info.width, y & ~_GREY_BMASK)
+ (x << _GREY_BSHIFT) + (~y & _GREY_BMASK);
#endif /* LCD_PIXELFORMAT */
unsigned char *dst_row = _grey_info.values + idx;
const unsigned char *src_row = src;
@ -654,7 +651,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
do
{
*dst_row = _grey_info.gvalue[*src_row++];
dst_row += _GREY_X_ADVANCE;
dst_row += _GREY_BSIZE;
}
while (src_row < src_end);