summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey_draw.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-01-10 22:51:33 +0000
committerJens Arnold <amiconn@rockbox.org>2008-01-10 22:51:33 +0000
commitdf5c3e15e8d04d519b7870fe809c15053783c14c (patch)
tree984d43fcc9756a39b693976a91f3b3e657cef361 /apps/plugins/lib/grey_draw.c
parent12cc3cc47cf4820a323fabf9815076705b9dd8fb (diff)
downloadrockbox-df5c3e15e8d04d519b7870fe809c15053783c14c.zip
rockbox-df5c3e15e8d04d519b7870fe809c15053783c14c.tar.gz
rockbox-df5c3e15e8d04d519b7870fe809c15053783c14c.tar.bz2
rockbox-df5c3e15e8d04d519b7870fe809c15053783c14c.tar.xz
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
Diffstat (limited to 'apps/plugins/lib/grey_draw.c')
-rw-r--r--apps/plugins/lib/grey_draw.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c
index ccb8dea..6837931 100644
--- a/apps/plugins/lib/grey_draw.c
+++ b/apps/plugins/lib/grey_draw.c
@@ -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);