summaryrefslogtreecommitdiff
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
parent18e097c8ffcc0fd98e4faa9bd536a319ba5ce536 (diff)
downloadrockbox-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
-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)
916 int ny; 916 int ny;
917 unsigned char *dst, *dst_end; 917 unsigned char *dst, *dst_end;
918 unsigned mask, mask_bottom; 918 unsigned mask, mask_bottom;
919 unsigned bits = 0xFFu; 919 unsigned bits = 0;
920 lcd_blockfunc_type *bfunc; 920 lcd_blockfunc_type *bfunc;
921 bool fillopt; 921 bool fillopt = false;
922 922
923 /* nothing to draw? */ 923 /* nothing to draw? */
924 if ((width <= 0) || (height <= 0) || (x >= LCD_REMOTE_WIDTH) 924 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)
941 if (y + height > LCD_REMOTE_HEIGHT) 941 if (y + height > LCD_REMOTE_HEIGHT)
942 height = LCD_REMOTE_HEIGHT - y; 942 height = LCD_REMOTE_HEIGHT - y;
943 943
944 fillopt = (drawmode & DRMODE_INVERSEVID) ? 944 if (drawmode & DRMODE_INVERSEVID)
945 (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); 945 {
946 if (fillopt &&(drawmode & DRMODE_INVERSEVID)) 946 if (drawmode & DRMODE_BG)
947 bits = 0; 947 {
948 fillopt = true;
949 }
950 }
951 else
952 {
953 if (drawmode & DRMODE_FG)
954 {
955 fillopt = true;
956 bits = 0xFFu;
957 }
958 }
948 bfunc = lcd_remote_blockfuncs[drawmode]; 959 bfunc = lcd_remote_blockfuncs[drawmode];
949 dst = &lcd_remote_framebuffer[y>>3][x]; 960 dst = &lcd_remote_framebuffer[y>>3][x];
950 ny = height - 1 + (y & 7); 961 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)
658 int ny; 658 int ny;
659 unsigned char *dst, *dst_end; 659 unsigned char *dst, *dst_end;
660 unsigned mask, mask_bottom; 660 unsigned mask, mask_bottom;
661 unsigned bits = fg_pattern; 661 unsigned bits = 0;
662 lcd_blockfunc_type *bfunc; 662 lcd_blockfunc_type *bfunc;
663 bool fillopt; 663 bool fillopt = false;
664 664
665 /* nothing to draw? */ 665 /* nothing to draw? */
666 if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 666 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)
683 if (y + height > LCD_HEIGHT) 683 if (y + height > LCD_HEIGHT)
684 height = LCD_HEIGHT - y; 684 height = LCD_HEIGHT - y;
685 685
686 fillopt = (drawmode & DRMODE_INVERSEVID) ? 686 if (drawmode & DRMODE_INVERSEVID)
687 (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); 687 {
688 if (fillopt &&(drawmode & DRMODE_INVERSEVID)) 688 if (drawmode & DRMODE_BG)
689 bits = bg_pattern; 689 {
690 fillopt = true;
691 bits = bg_pattern;
692 }
693 }
694 else
695 {
696 if (drawmode & DRMODE_FG)
697 {
698 fillopt = true;
699 bits = fg_pattern;
700 }
701 }
690 bfunc = lcd_blockfuncs[drawmode]; 702 bfunc = lcd_blockfuncs[drawmode];
691 dst = &lcd_framebuffer[y>>2][x]; 703 dst = &lcd_framebuffer[y>>2][x];
692 ny = height - 1 + (y & 3); 704 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)
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);