diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2008-04-12 07:53:33 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2008-04-12 07:53:33 +0000 |
| commit | 00ac809cc71e3747c81bf01be95d5cf21d93d9a0 (patch) | |
| tree | 4d79755bdc07bdad65e9a524ac8fab572564494d /firmware/drivers/lcd-1bit-vert.c | |
| parent | 02eb1d83a79c265b0273e18630553efcf8b9196c (diff) | |
| download | rockbox-00ac809cc71e3747c81bf01be95d5cf21d93d9a0.zip rockbox-00ac809cc71e3747c81bf01be95d5cf21d93d9a0.tar.gz rockbox-00ac809cc71e3747c81bf01be95d5cf21d93d9a0.tar.bz2 rockbox-00ac809cc71e3747c81bf01be95d5cf21d93d9a0.tar.xz | |
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
Diffstat (limited to 'firmware/drivers/lcd-1bit-vert.c')
| -rw-r--r-- | firmware/drivers/lcd-1bit-vert.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c index 3a6e59c..c6fe40c 100644 --- a/firmware/drivers/lcd-1bit-vert.c +++ b/firmware/drivers/lcd-1bit-vert.c @@ -36,6 +36,7 @@ #define LCDFN(fn) lcd_ ## fn #define FBFN(fn) fb_ ## fn #define LCDM(ma) LCD_ ## ma +#define LCDNAME "lcd_" #define MAIN_LCD #endif @@ -290,7 +291,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; |