summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-2bit-vert.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-05-30 23:35:44 +0000
committerJens Arnold <amiconn@rockbox.org>2009-05-30 23:35:44 +0000
commit72061047d1cbe2f9c8728d1cde302343bb8dd784 (patch)
tree548cd4fa407553680023940b59ef883377e5eac3 /firmware/drivers/lcd-2bit-vert.c
parent294ece8bd6189555b1a3164d216196d992982eab (diff)
downloadrockbox-72061047d1cbe2f9c8728d1cde302343bb8dd784.zip
rockbox-72061047d1cbe2f9c8728d1cde302343bb8dd784.tar.gz
rockbox-72061047d1cbe2f9c8728d1cde302343bb8dd784.tar.bz2
rockbox-72061047d1cbe2f9c8728d1cde302343bb8dd784.tar.xz
Two tiny optimisations for mono bitmap drawing on greyscale displays: (1) H1x0, M5: Manipulate destination masks directly for the aligned case - ~0.7% speedup. (2) Greyscale ipods: Use sentinel method for reloading data like the 16 bit driver does - ~1.5% speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21139 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-2bit-vert.c')
-rw-r--r--firmware/drivers/lcd-2bit-vert.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c
index d12ebbc..cff5eaf 100644
--- a/firmware/drivers/lcd-2bit-vert.c
+++ b/firmware/drivers/lcd-2bit-vert.c
@@ -719,7 +719,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
{
int shift, ny;
fb_data *dst, *dst_end;
- unsigned mask, mask_bottom;
lcd_blockfunc_type *bfunc;
/* nothing to draw? */
@@ -757,20 +756,21 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
ny = height - 1 + shift + src_y;
bfunc = lcd_blockfuncs[current_vp->drawmode];
- mask = 0xFFu << (shift + src_y);
- mask_bottom = 0xFFu >> (~ny & 7);
if (shift == 0)
{
- unsigned dmask1, dmask2, data;
+ unsigned dmask1, dmask2, dmask_bottom, data;
+
+ dmask1 = 0xFFFFu << (2 * (shift + src_y));
+ dmask2 = dmask1 >> 8;
+ dmask1 &= 0xFFu;
+ dmask_bottom = 0xFFFFu >> (2 * (~ny & 7));
for (; ny >= 8; ny -= 8)
{
const unsigned char *src_row = src;
fb_data *dst_row = dst + LCD_WIDTH;
- dmask1 = lcd_dibits[mask&0x0F];
- dmask2 = lcd_dibits[(mask>>4)&0x0F];
dst_end = dst_row + width;
if (dmask1 != 0)
@@ -791,11 +791,11 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
}
src += stride;
dst += 2*LCD_WIDTH;
- mask = 0xFFu;
+ dmask1 = dmask2 = 0xFFu;
}
- mask &= mask_bottom;
- dmask1 = lcd_dibits[mask&0x0F];
- dmask2 = lcd_dibits[(mask>>4)&0x0F];
+ dmask1 &= dmask_bottom;
+ /* & 0xFFu is unnecessary here - dmask1 can't exceed that*/
+ dmask2 &= (dmask_bottom >> 8);
dst_end = dst + width;
if (dmask1 != 0)
@@ -826,6 +826,9 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
}
else
{
+ unsigned mask = 0xFFu << (shift + src_y);
+ unsigned mask_bottom = 0xFFu >> (~ny & 7);
+
dst_end = dst + width;
do
{