From 32326ef10d92ffcbf3167bddb0c67e02ed0bd591 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 2 Feb 2006 19:35:51 +0000 Subject: * Changed implementation of inverse bar: Instead of complementing all pixels after drawing the text, the text is drawn in inversevid mode. This is faster, and will be more readable when backdrop image support gets added. Appearance on non-colour targets doesn't change. * Speedup of the scroll thread. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8532 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-recorder.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'firmware/drivers/lcd-recorder.c') diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index b7bcd02cec..f69bf21fd5 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c @@ -950,14 +950,11 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, lcd_getstringsize(str, &w, &h); xpos = xmargin + x*w / utf8length(str); ypos = ymargin + y*h; + drawmode = (style & STYLE_INVERT) ? + (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, offset, str); - drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); + drawmode ^= DRMODE_INVERSEVID; lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); - if (style & STYLE_INVERT) - { - drawmode = DRMODE_COMPLEMENT; - lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h); - } drawmode = lastmode; } @@ -1127,15 +1124,9 @@ static void scroll_thread(void) } lastmode = drawmode; - drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); - lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); - drawmode = DRMODE_SOLID; + drawmode = s->invert ? + (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, s->offset, s->line); - if (s->invert) - { - drawmode = DRMODE_COMPLEMENT; - lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); - } drawmode = lastmode; lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); } -- cgit v1.2.3