forked from len0rd/rockbox
LCD drivers: * Automatically optimise horizontal and vertical lines drawn via _drawline(), with debug message to show possible optimisations in the caller. * Get rid of the extra ICODE function declarations by putting the attribute into the definition.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17081 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
02eb1d83a7
commit
00ac809cc7
7 changed files with 140 additions and 120 deletions
|
@ -39,6 +39,7 @@
|
|||
#define LCDFN(fn) lcd_ ## fn
|
||||
#define FBFN(fn) fb_ ## fn
|
||||
#define LCDM(ma) LCD_ ## ma
|
||||
#define LCDNAME "lcd_"
|
||||
#define MAIN_LCD
|
||||
#endif
|
||||
|
||||
|
@ -476,7 +477,19 @@ void LCDFN(drawline)(int x1, int y1, int x2, int y2)
|
|||
LCDFN(pixelfunc_type) *pfunc = LCDFN(pixelfuncs)[current_vp->drawmode];
|
||||
|
||||
deltax = abs(x2 - x1);
|
||||
if (deltax == 0)
|
||||
{
|
||||
DEBUGF(LCDNAME "drawline() called for vertical line - optimisation.\n");
|
||||
LCDFN(vline)(x1, y1, y2);
|
||||
return;
|
||||
}
|
||||
deltay = abs(y2 - y1);
|
||||
if (deltay == 0)
|
||||
{
|
||||
DEBUGF(LCDNAME "drawline() called for horizontal line - optimisation.\n");
|
||||
LCDFN(hline)(x1, x2, y1);
|
||||
return;
|
||||
}
|
||||
xinc2 = 1;
|
||||
yinc2 = 1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue