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.tar.gz
rockbox-df5c3e15e8d04d519b7870fe809c15053783c14c.zip
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 ccb8deae7b..683793129e 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,
634 if (y + height > _grey_info.height) 634 if (y + height > _grey_info.height)
635 height = _grey_info.height - y; 635 height = _grey_info.height - y;
636 636
637 src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */ 637 src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */
638 638
639 do 639 do
640 { 640 {
641#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 641#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
642 int idx = _GREY_MULUQ(_grey_info.width, y) + x; 642 int idx = _GREY_MULUQ(_grey_info.width, y) + x;
643#else 643#else
644#if LCD_DEPTH == 1 644 int idx = _GREY_MULUQ(_grey_info.width, y & ~_GREY_BMASK)
645 int idx = _GREY_MULUQ(_grey_info.width, y & ~7) + (x << 3) + (~y & 7); 645 + (x << _GREY_BSHIFT) + (~y & _GREY_BMASK);
646#elif LCD_DEPTH == 2
647 int idx = _GREY_MULUQ(_grey_info.width, y & ~3) + (x << 2) + (~y & 3);
648#endif
649#endif /* LCD_PIXELFORMAT */ 646#endif /* LCD_PIXELFORMAT */
650 unsigned char *dst_row = _grey_info.values + idx; 647 unsigned char *dst_row = _grey_info.values + idx;
651 const unsigned char *src_row = src; 648 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,
654 do 651 do
655 { 652 {
656 *dst_row = _grey_info.gvalue[*src_row++]; 653 *dst_row = _grey_info.gvalue[*src_row++];
657 dst_row += _GREY_X_ADVANCE; 654 dst_row += _GREY_BSIZE;
658 } 655 }
659 while (src_row < src_end); 656 while (src_row < src_end);
660 657