diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-06-29 12:56:01 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-06-29 12:56:01 +0000 |
commit | 0884582228c6d00d48f2d47076aeb02b90574815 (patch) | |
tree | f957a995cfe4a36a390b8d2ec0c412f2ca39c3aa /firmware | |
parent | 0441afecd7ecb7024609224fc6ab39b7bedab273 (diff) | |
download | rockbox-0884582228c6d00d48f2d47076aeb02b90574815.tar.gz rockbox-0884582228c6d00d48f2d47076aeb02b90574815.zip |
Colour targets: Revert an optimisation from almost 18 months ago that actually turned out to slow down things. Speeds up mono bitmap drawing by ~15..60% depending on target and drawmode.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17876 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index 3cbade27ee..a7e89b0d6d 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -716,8 +716,7 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, | |||
716 | int width, int height) | 716 | int width, int height) |
717 | { | 717 | { |
718 | const unsigned char *src_end; | 718 | const unsigned char *src_end; |
719 | bool has_backdrop; | 719 | fb_data *dst, *dst_end; |
720 | fb_data *dst, *dst_end, *backdrop; | ||
721 | lcd_fastpixelfunc_type *fgfunc, *bgfunc; | 720 | lcd_fastpixelfunc_type *fgfunc, *bgfunc; |
722 | 721 | ||
723 | /* nothing to draw? */ | 722 | /* nothing to draw? */ |
@@ -748,47 +747,24 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, | |||
748 | src_end = src + width; | 747 | src_end = src + width; |
749 | 748 | ||
750 | dst = LCDADDR(current_vp->x + x, current_vp->y + y); | 749 | dst = LCDADDR(current_vp->x + x, current_vp->y + y); |
751 | has_backdrop = (lcd_backdrop != NULL); | ||
752 | backdrop = lcd_backdrop + (current_vp->y + y) * LCD_WIDTH + current_vp->x + x; | ||
753 | fgfunc = lcd_fastpixelfuncs[current_vp->drawmode]; | 750 | fgfunc = lcd_fastpixelfuncs[current_vp->drawmode]; |
754 | bgfunc = lcd_fastpixelfuncs[current_vp->drawmode ^ DRMODE_INVERSEVID]; | 751 | bgfunc = lcd_fastpixelfuncs[current_vp->drawmode ^ DRMODE_INVERSEVID]; |
755 | do | 752 | do |
756 | { | 753 | { |
757 | const unsigned char *src_col = src++; | 754 | const unsigned char *src_col = src++; |
758 | unsigned data = *src_col >> src_y; | 755 | unsigned data = *src_col >> src_y; |
759 | fb_data *dst_col = dst++; | 756 | fb_data *dst_col = dst++; |
760 | int numbits = 8 - src_y; | 757 | int numbits = 8 - src_y; |
761 | fb_data *backdrop_col = backdrop++; | ||
762 | dst_end = dst_col + height * LCD_WIDTH; | 758 | dst_end = dst_col + height * LCD_WIDTH; |
763 | do | 759 | do |
764 | { | 760 | { |
765 | switch (current_vp->drawmode) | 761 | if (data & 0x01) |
766 | { | 762 | fgfunc(dst_col); |
767 | case DRMODE_SOLID: | 763 | else |
768 | if (data & 0x01) | 764 | bgfunc(dst_col); |
769 | *dst_col = current_vp->fg_pattern; | 765 | |
770 | else | ||
771 | *dst_col = has_backdrop ? *backdrop_col : current_vp->bg_pattern; | ||
772 | break; | ||
773 | case DRMODE_FG: | ||
774 | if (data & 0x01) | ||
775 | *dst_col = current_vp->fg_pattern; | ||
776 | break; | ||
777 | case (DRMODE_SOLID|DRMODE_INVERSEVID): | ||
778 | if (data & 0x01) | ||
779 | *dst_col = has_backdrop ? *backdrop_col : current_vp->bg_pattern; | ||
780 | else | ||
781 | *dst_col = current_vp->fg_pattern; | ||
782 | break; | ||
783 | default: | ||
784 | if (data & 0x01) | ||
785 | fgfunc(dst_col); | ||
786 | else | ||
787 | bgfunc(dst_col); | ||
788 | break; | ||
789 | } | ||
790 | dst_col += LCD_WIDTH; | 766 | dst_col += LCD_WIDTH; |
791 | backdrop_col += LCD_WIDTH; | 767 | |
792 | data >>= 1; | 768 | data >>= 1; |
793 | if (--numbits == 0) | 769 | if (--numbits == 0) |
794 | { | 770 | { |