From 5365cbe0a5af0ef357e7fc70e793141ccd38f23e Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 26 Oct 2009 01:35:31 +0000 Subject: Color targets: Ported assembler optimised transparent bitmap drawing from Gigabeat S/F/X to all ARM targets (~23..40% speedup). * C optimised transparent bitmap drawing for non-ARM targets and sims. * Use the more compact boundary checking for non-transparent native bitmap drawing as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23353 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c | 63 ------------------------ 1 file changed, 63 deletions(-) (limited to 'firmware/target/arm/imx31') diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c index fa1aed0fd6..ea3bfaf519 100644 --- a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c @@ -146,69 +146,6 @@ void lcd_update(void) LCD_WIDTH*LCD_HEIGHT, 1); } -void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y, - int stride, int x, int y, int width, - int height) -{ - int w, px; - fb_data *dst; - - if (x + width > current_vp->width) - width = current_vp->width - x; /* Clip right */ - - if (x < 0) /* Clip left */ - { - width += x; - src_x -= x; - x = 0; - } - - if (width <= 0) - return; /* nothing left to do */ - - if (y + height > current_vp->height) - height = current_vp->height - y; /* Clip bottom */ - - if (y < 0) /* Clip top */ - { - height += y; - src_y -= y; - y = 0; - } - - if (height <= 0) - return; /* nothing left to do */ - - src += stride * src_y + src_x; /* move starting point */ - dst = &lcd_framebuffer[current_vp->y+y][current_vp->x+x]; - - asm volatile ( - ".rowstart: \r\n" - "mov %[w], %[width] \r\n" /* Load width for inner loop */ - ".nextpixel: \r\n" - "ldrh %[px], [%[s]], #2 \r\n" /* Load src pixel */ - "add %[d], %[d], #2 \r\n" /* Uncoditionally increment dst */ - "cmp %[px], %[fgcolor] \r\n" /* Compare to foreground color */ - "streqh %[fgpat], [%[d], #-2] \r\n" /* Store foregroud if match */ - "cmpne %[px], %[transcolor] \r\n" /* Compare to transparent color */ - "strneh %[px], [%[d], #-2] \r\n" /* Store dst if not transparent */ - "subs %[w], %[w], #1 \r\n" /* Width counter has run down? */ - "bgt .nextpixel \r\n" /* More in this row? */ - "add %[s], %[s], %[sstp], lsl #1 \r\n" /* Skip over to start of next line */ - "add %[d], %[d], %[dstp], lsl #1 \r\n" - "subs %[h], %[h], #1 \r\n" /* Height counter has run down? */ - "bgt .rowstart \r\n" /* More rows? */ - : [w]"=&r"(w), [h]"+&r"(height), [px]"=&r"(px), - [s]"+&r"(src), [d]"+&r"(dst) - : [width]"r"(width), - [sstp]"r"(stride - width), - [dstp]"r"(LCD_WIDTH - width), - [transcolor]"r"(TRANSPARENT_COLOR), - [fgcolor]"r"(REPLACEWITHFG_COLOR), - [fgpat]"r"(current_vp->fg_pattern) - ); -} - void lcd_yuv_set_options(unsigned options) { lcd_yuv_options = options; -- cgit v1.2.3