summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-02-22 00:20:28 +0000
committerJens Arnold <amiconn@rockbox.org>2006-02-22 00:20:28 +0000
commita875703e6e0e26cfd4dfd74d56a7d28feb37bdc5 (patch)
tree3c5117c9923a5cf19fb5f6209b8bbea5fd624db6 /firmware
parent18e097c8ffcc0fd98e4faa9bd536a319ba5ce536 (diff)
downloadrockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.tar.gz
rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.tar.bz2
rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.zip
Slight optimisation for 1bit and 2bit (vp) LCD drivers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8772 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-h100-remote.c23
-rw-r--r--firmware/drivers/lcd-h100.c24
-rw-r--r--firmware/drivers/lcd-recorder.c25
3 files changed, 53 insertions, 19 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 6bbe01a4c9..df735ca40d 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -916,9 +916,9 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
int ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
- unsigned bits = 0xFFu;
+ unsigned bits = 0;
lcd_blockfunc_type *bfunc;
- bool fillopt;
+ bool fillopt = false;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_REMOTE_WIDTH)
@@ -941,10 +941,21 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
if (y + height > LCD_REMOTE_HEIGHT)
height = LCD_REMOTE_HEIGHT - y;
- fillopt = (drawmode & DRMODE_INVERSEVID) ?
- (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
- if (fillopt &&(drawmode & DRMODE_INVERSEVID))
- bits = 0;
+ if (drawmode & DRMODE_INVERSEVID)
+ {
+ if (drawmode & DRMODE_BG)
+ {
+ fillopt = true;
+ }
+ }
+ else
+ {
+ if (drawmode & DRMODE_FG)
+ {
+ fillopt = true;
+ bits = 0xFFu;
+ }
+ }
bfunc = lcd_remote_blockfuncs[drawmode];
dst = &lcd_remote_framebuffer[y>>3][x];
ny = height - 1 + (y & 7);
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index 3af6ffef6a..78b1e33dc8 100644
--- a/firmware/drivers/lcd-h100.c
+++ b/firmware/drivers/lcd-h100.c
@@ -658,9 +658,9 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
- unsigned bits = fg_pattern;
+ unsigned bits = 0;
lcd_blockfunc_type *bfunc;
- bool fillopt;
+ bool fillopt = false;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
@@ -683,10 +683,22 @@ void lcd_fillrect(int x, int y, int width, int height)
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
- fillopt = (drawmode & DRMODE_INVERSEVID) ?
- (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
- if (fillopt &&(drawmode & DRMODE_INVERSEVID))
- bits = bg_pattern;
+ if (drawmode & DRMODE_INVERSEVID)
+ {
+ if (drawmode & DRMODE_BG)
+ {
+ fillopt = true;
+ bits = bg_pattern;
+ }
+ }
+ else
+ {
+ if (drawmode & DRMODE_FG)
+ {
+ fillopt = true;
+ bits = fg_pattern;
+ }
+ }
bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>2][x];
ny = height - 1 + (y & 3);
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index f69bf21fd5..22388815ae 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -677,9 +677,9 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
- unsigned bits = 0xFFu;
+ unsigned bits = 0;
lcd_blockfunc_type *bfunc;
- bool fillopt;
+ bool fillopt = false;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
@@ -701,11 +701,22 @@ void lcd_fillrect(int x, int y, int width, int height)
width = LCD_WIDTH - x;
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
-
- fillopt = (drawmode & DRMODE_INVERSEVID) ?
- (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
- if (fillopt &&(drawmode & DRMODE_INVERSEVID))
- bits = 0;
+
+ if (drawmode & DRMODE_INVERSEVID)
+ {
+ if (drawmode & DRMODE_BG)
+ {
+ fillopt = true;
+ }
+ }
+ else
+ {
+ if (drawmode & DRMODE_FG)
+ {
+ fillopt = true;
+ bits = 0xFFu;
+ }
+ }
bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>3][x];
ny = height - 1 + (y & 7);