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-recorder.c | |
parent | 18e097c8ffcc0fd98e4faa9bd536a319ba5ce536 (diff) | |
download | rockbox-a875703e6e0e26cfd4dfd74d56a7d28feb37bdc5.tar.gz 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/drivers/lcd-recorder.c')
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 25 |
1 files changed, 18 insertions, 7 deletions
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) | |||
677 | int ny; | 677 | int ny; |
678 | unsigned char *dst, *dst_end; | 678 | unsigned char *dst, *dst_end; |
679 | unsigned mask, mask_bottom; | 679 | unsigned mask, mask_bottom; |
680 | unsigned bits = 0xFFu; | 680 | unsigned bits = 0; |
681 | lcd_blockfunc_type *bfunc; | 681 | lcd_blockfunc_type *bfunc; |
682 | bool fillopt; | 682 | bool fillopt = false; |
683 | 683 | ||
684 | /* nothing to draw? */ | 684 | /* nothing to draw? */ |
685 | if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) | 685 | 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) | |||
701 | width = LCD_WIDTH - x; | 701 | width = LCD_WIDTH - x; |
702 | if (y + height > LCD_HEIGHT) | 702 | if (y + height > LCD_HEIGHT) |
703 | height = LCD_HEIGHT - y; | 703 | height = LCD_HEIGHT - y; |
704 | 704 | ||
705 | fillopt = (drawmode & DRMODE_INVERSEVID) ? | 705 | if (drawmode & DRMODE_INVERSEVID) |
706 | (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); | 706 | { |
707 | if (fillopt &&(drawmode & DRMODE_INVERSEVID)) | 707 | if (drawmode & DRMODE_BG) |
708 | bits = 0; | 708 | { |
709 | fillopt = true; | ||
710 | } | ||
711 | } | ||
712 | else | ||
713 | { | ||
714 | if (drawmode & DRMODE_FG) | ||
715 | { | ||
716 | fillopt = true; | ||
717 | bits = 0xFFu; | ||
718 | } | ||
719 | } | ||
709 | bfunc = lcd_blockfuncs[drawmode]; | 720 | bfunc = lcd_blockfuncs[drawmode]; |
710 | dst = &lcd_framebuffer[y>>3][x]; | 721 | dst = &lcd_framebuffer[y>>3][x]; |
711 | ny = height - 1 + (y & 7); | 722 | ny = height - 1 + (y & 7); |