From 6a56c14e17f6ba113ec0d4d40e75bffd61b293cc Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 9 Jan 2008 23:48:26 +0000 Subject: Greyscale library: Changed the internal data format once more (separated pixel values and phases), allowing for further optimisation of drawing, scrolling etc. * Optimised grey phase blitting in the core reduces CPU load on all architectures, most significantly on coldfire. Previous version was too slow to keep up at 45MHz, leading to unwanted graininess (update frequency was halved). Also fixed screendump on 2bpp targets with vertical pixel packing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16043 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/lib/grey_draw.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'apps/plugins/lib/grey_draw.c') diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c index e243b5fbce..ccb8deae7b 100644 --- a/apps/plugins/lib/grey_draw.c +++ b/apps/plugins/lib/grey_draw.c @@ -601,17 +601,10 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, void grey_ub_clear_display(void) { int value = (_grey_info.drawmode & DRMODE_INVERSEVID) ? - _grey_info.fg_val : _grey_info.bg_val; - unsigned char *dst = &_grey_info.data[0].value; - unsigned char *dst_end = dst + sizeof(struct grey_data) - * _GREY_MULUQ(_grey_info.width, _grey_info.height); - - do - { - *dst = value; - dst += sizeof(struct grey_data); - } - while (dst < dst_end); + _grey_info.fg_val : _grey_info.bg_val; + + _grey_rb->memset(_grey_info.values, value, + _GREY_MULUQ(_grey_info.width, _grey_info.height)); } /* Draw a partial greyscale bitmap, canonical format */ @@ -654,7 +647,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y, int idx = _GREY_MULUQ(_grey_info.width, y & ~3) + (x << 2) + (~y & 3); #endif #endif /* LCD_PIXELFORMAT */ - unsigned char *dst_row = &_grey_info.data[idx].value; + unsigned char *dst_row = _grey_info.values + idx; const unsigned char *src_row = src; const unsigned char *src_end = src + width; -- cgit v1.2.3