diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2006-02-22 00:20:28 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2006-02-22 00:20:28 +0000 |
| commit | a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5 (patch) | |
| tree | 3c5117c9923a5cf19fb5f6209b8bbea5fd624db6 /firmware/drivers/lcd-h100.c | |
| parent | 18e097c8ffcc0fd98e4faa9bd536a319ba5ce536 (diff) | |
| download | rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.zip rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.tar.gz rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.tar.bz2 rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.tar.xz | |
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/drivers/lcd-h100.c')
| -rw-r--r-- | firmware/drivers/lcd-h100.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index 3af6ffe..78b1e33 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); |