From df5c3e15e8d04d519b7870fe809c15053783c14c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 10 Jan 2008 22:51:33 +0000 Subject: Greyscale library: * Introduced some extra macros dealing with block size, allowing to write some parts with less #ifdefing. * Optimised grey_update_rect() for horizontally packed LCDs, and unbuffered scrolling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16050 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lib/grey.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/plugins/lib/grey.h') diff --git a/apps/plugins/lib/grey.h b/apps/plugins/lib/grey.h index 9a3bd7d3f8..5bef88a89a 100644 --- a/apps/plugins/lib/grey.h +++ b/apps/plugins/lib/grey.h @@ -121,15 +121,18 @@ void grey_ub_scroll_down(int count); #endif #if LCD_PIXELFORMAT == HORIZONTAL_PACKING -#define _GREY_X_ADVANCE 1 +#define _GREY_BSHIFT 0 #else #if LCD_DEPTH == 1 -#define _GREY_X_ADVANCE 8 +#define _GREY_BSHIFT 3 #elif LCD_DEPTH == 2 -#define _GREY_X_ADVANCE 4 +#define _GREY_BSHIFT 2 #endif #endif /* LCD_PIXELFORMAT */ +#define _GREY_BSIZE (1<<_GREY_BSHIFT) +#define _GREY_BMASK (_GREY_BSIZE-1) + /* The greyscale buffer management structure */ struct _grey_info { -- cgit v1.2.3