1
0
Fork 0
forked from len0rd/rockbox

Slight optimisation for 1bit and 2bit (vp) LCD drivers.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8772 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-02-22 00:20:28 +00:00
parent 18e097c8ff
commit a875703e6e
3 changed files with 53 additions and 19 deletions

View file

@ -916,9 +916,9 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
int ny; int ny;
unsigned char *dst, *dst_end; unsigned char *dst, *dst_end;
unsigned mask, mask_bottom; unsigned mask, mask_bottom;
unsigned bits = 0xFFu; unsigned bits = 0;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
bool fillopt; bool fillopt = false;
/* nothing to draw? */ /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_REMOTE_WIDTH) 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)
if (y + height > LCD_REMOTE_HEIGHT) if (y + height > LCD_REMOTE_HEIGHT)
height = LCD_REMOTE_HEIGHT - y; height = LCD_REMOTE_HEIGHT - y;
fillopt = (drawmode & DRMODE_INVERSEVID) ? if (drawmode & DRMODE_INVERSEVID)
(drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); {
if (fillopt &&(drawmode & DRMODE_INVERSEVID)) if (drawmode & DRMODE_BG)
bits = 0; {
fillopt = true;
}
}
else
{
if (drawmode & DRMODE_FG)
{
fillopt = true;
bits = 0xFFu;
}
}
bfunc = lcd_remote_blockfuncs[drawmode]; bfunc = lcd_remote_blockfuncs[drawmode];
dst = &lcd_remote_framebuffer[y>>3][x]; dst = &lcd_remote_framebuffer[y>>3][x];
ny = height - 1 + (y & 7); ny = height - 1 + (y & 7);

View file

@ -658,9 +658,9 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny; int ny;
unsigned char *dst, *dst_end; unsigned char *dst, *dst_end;
unsigned mask, mask_bottom; unsigned mask, mask_bottom;
unsigned bits = fg_pattern; unsigned bits = 0;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
bool fillopt; bool fillopt = false;
/* nothing to draw? */ /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 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) if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y; height = LCD_HEIGHT - y;
fillopt = (drawmode & DRMODE_INVERSEVID) ? if (drawmode & DRMODE_INVERSEVID)
(drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); {
if (fillopt &&(drawmode & DRMODE_INVERSEVID)) if (drawmode & DRMODE_BG)
bits = bg_pattern; {
fillopt = true;
bits = bg_pattern;
}
}
else
{
if (drawmode & DRMODE_FG)
{
fillopt = true;
bits = fg_pattern;
}
}
bfunc = lcd_blockfuncs[drawmode]; bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>2][x]; dst = &lcd_framebuffer[y>>2][x];
ny = height - 1 + (y & 3); ny = height - 1 + (y & 3);

View file

@ -677,9 +677,9 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny; int ny;
unsigned char *dst, *dst_end; unsigned char *dst, *dst_end;
unsigned mask, mask_bottom; unsigned mask, mask_bottom;
unsigned bits = 0xFFu; unsigned bits = 0;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
bool fillopt; bool fillopt = false;
/* nothing to draw? */ /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) 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)
width = LCD_WIDTH - x; width = LCD_WIDTH - x;
if (y + height > LCD_HEIGHT) if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y; height = LCD_HEIGHT - y;
fillopt = (drawmode & DRMODE_INVERSEVID) ? if (drawmode & DRMODE_INVERSEVID)
(drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); {
if (fillopt &&(drawmode & DRMODE_INVERSEVID)) if (drawmode & DRMODE_BG)
bits = 0; {
fillopt = true;
}
}
else
{
if (drawmode & DRMODE_FG)
{
fillopt = true;
bits = 0xFFu;
}
}
bfunc = lcd_blockfuncs[drawmode]; bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>3][x]; dst = &lcd_framebuffer[y>>3][x];
ny = height - 1 + (y & 7); ny = height - 1 + (y & 7);