summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-2bit-vi.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-04-12 07:53:33 +0000
committerJens Arnold <amiconn@rockbox.org>2008-04-12 07:53:33 +0000
commit00ac809cc71e3747c81bf01be95d5cf21d93d9a0 (patch)
tree4d79755bdc07bdad65e9a524ac8fab572564494d /firmware/drivers/lcd-2bit-vi.c
parent02eb1d83a79c265b0273e18630553efcf8b9196c (diff)
downloadrockbox-00ac809cc71e3747c81bf01be95d5cf21d93d9a0.tar.gz
rockbox-00ac809cc71e3747c81bf01be95d5cf21d93d9a0.zip
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-2bit-vi.c')
-rw-r--r--firmware/drivers/lcd-2bit-vi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index 0878258e84..7d97f19174 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -39,6 +39,7 @@
39#define LCDFN(fn) lcd_ ## fn 39#define LCDFN(fn) lcd_ ## fn
40#define FBFN(fn) fb_ ## fn 40#define FBFN(fn) fb_ ## fn
41#define LCDM(ma) LCD_ ## ma 41#define LCDM(ma) LCD_ ## ma
42#define LCDNAME "lcd_"
42#define MAIN_LCD 43#define MAIN_LCD
43#endif 44#endif
44 45
@@ -476,7 +477,19 @@ void LCDFN(drawline)(int x1, int y1, int x2, int y2)
476 LCDFN(pixelfunc_type) *pfunc = LCDFN(pixelfuncs)[current_vp->drawmode]; 477 LCDFN(pixelfunc_type) *pfunc = LCDFN(pixelfuncs)[current_vp->drawmode];
477 478
478 deltax = abs(x2 - x1); 479 deltax = abs(x2 - x1);
480 if (deltax == 0)
481 {
482 DEBUGF(LCDNAME "drawline() called for vertical line - optimisation.\n");
483 LCDFN(vline)(x1, y1, y2);
484 return;
485 }
479 deltay = abs(y2 - y1); 486 deltay = abs(y2 - y1);
487 if (deltay == 0)
488 {
489 DEBUGF(LCDNAME "drawline() called for horizontal line - optimisation.\n");
490 LCDFN(hline)(x1, x2, y1);
491 return;
492 }
480 xinc2 = 1; 493 xinc2 = 1;
481 yinc2 = 1; 494 yinc2 = 1;
482 495