From 576908d36a58d51ee880791418a32cef25b49aba Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 29 Jun 2005 01:39:50 +0000 Subject: Third part of graphics api rework. Some small but effective optimisations. Ported remote lcd driver to new api. Preparations for including the low-level functions in the plugin api. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6907 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/lcd-remote.h | 33 +++++++++++++++++++-------------- firmware/export/lcd.h | 10 +++++++--- 2 files changed, 26 insertions(+), 17 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index c5793eda93..17025a7421 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -26,9 +26,9 @@ #ifdef HAVE_REMOTE_LCD -#define REMOTE_DRAW_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] |= (1<<((y)&7)) -#define REMOTE_CLEAR_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7)) -#define REMOTE_INVERT_PIXEL(x,y) lcd_remote_framebuffer[(y)/8][(x)] ^= (1<<((y)&7)) +#define REMOTE_DRAW_PIXEL(x,y) lcd_remote_framebuffer[(y)>>3][(x)] |= (1<<((y)&7)) +#define REMOTE_CLEAR_PIXEL(x,y) lcd_remote_framebuffer[(y)>>3][(x)] &= ~(1<<((y)&7)) +#define REMOTE_INVERT_PIXEL(x,y) lcd_remote_framebuffer[(y)>>3][(x)] ^= (1<<((y)&7)) #define STYLE_DEFAULT 0 #define STYLE_INVERT 1 @@ -48,11 +48,11 @@ extern void lcd_remote_stop_scroll(void); extern void lcd_remote_scroll_speed(int speed); extern void lcd_remote_scroll_delay(int ms); extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); -extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char* string, - int style); +extern void lcd_remote_puts_scroll_style(int x, int y, + const unsigned char* string, int style); extern void lcd_remote_update(void); -extern void lcd_remote_update_rect(int x_start, int y, int width, int height); +extern void lcd_remote_update_rect(int x, int y, int width, int height); /* Memory copy of display bitmap */ extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]; @@ -60,23 +60,28 @@ extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDT extern void lcd_remote_set_invert_display(bool yesno); extern void lcd_remote_set_flip(bool yesno); extern void lcd_remote_roll(int pixels); + +extern void lcd_remote_set_drawmode(int mode); +extern int lcd_remote_get_drawmode(void); extern void lcd_remote_setmargins(int xmargin, int ymargin); extern int lcd_remote_getxmargin(void); extern int lcd_remote_getymargin(void); extern void lcd_remote_setfont(int font); extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); + extern void lcd_remote_drawpixel(int x, int y); -extern void lcd_remote_clearpixel(int x, int y); -extern void lcd_remote_invertpixel(int x, int y); extern void lcd_remote_drawline(int x1, int y1, int x2, int y2); -extern void lcd_remote_clearline(int x1, int y1, int x2, int y2); -extern void lcd_remote_drawrect(int x, int y, int nx, int ny); -extern void lcd_remote_clearrect(int x, int y, int nx, int ny); -extern void lcd_remote_fillrect(int x, int y, int nx, int ny); -extern void lcd_remote_invertrect(int x, int y, int nx, int ny); +extern void lcd_remote_hline(int x1, int x2, int y); +extern void lcd_remote_vline(int x, int y1, int y2); +extern void lcd_remote_drawrect(int x, int y, int width, int height); +extern void lcd_remote_fillrect(int x, int y, int width, int height); +extern void lcd_remote_bitmap_part(const unsigned char *src, int src_x, + int src_y, int stride, int x, int y, + int width, int height); extern void lcd_remote_bitmap(const unsigned char *src, int x, int y, - int nx, int ny, bool clear); + int width, int height); extern void lcd_remote_putsxy(int x, int y, const unsigned char *string); + extern void lcd_remote_invertscroll(int x, int y); extern void lcd_remote_bidir_scroll(int threshold); extern void lcd_remote_scroll_step(int pixels); diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 6a6a8e8697..77e79799f8 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -122,9 +122,9 @@ extern void lcd_jump_scroll_delay(int ms); #define DRMODE_SOLID 3 #define DRMODE_INVERSEVID 4 /* used as bit modifier for basic modes */ -#define DRAW_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] |= (1<<((y)&7)) -#define CLEAR_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] &= ~(1<<((y)&7)) -#define INVERT_PIXEL(x,y) lcd_framebuffer[(y)/8][(x)] ^= (1<<((y)&7)) +#define DRAW_PIXEL(x,y) lcd_framebuffer[(y)>>3][(x)] |= (1<<((y)&7)) +#define CLEAR_PIXEL(x,y) lcd_framebuffer[(y)>>3][(x)] &= ~(1<<((y)&7)) +#define INVERT_PIXEL(x,y) lcd_framebuffer[(y)>>3][(x)] ^= (1<<((y)&7)) typedef void lcd_pixelfunc_type(int x, int y); /* for b&w */ typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits); @@ -144,6 +144,10 @@ extern int lcd_getymargin(void); extern void lcd_setfont(int font); extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); +/* low level drawing function pointer arrays */ +extern lcd_pixelfunc_type* lcd_pixelfuncs[8]; +extern lcd_blockfunc_type* lcd_blockfuncs[8]; + extern void lcd_drawpixel(int x, int y); extern void lcd_drawline(int x1, int y1, int x2, int y2); extern void lcd_hline(int x1, int x2, int y); -- cgit v1.2.3