diff options
author | Jens Arnold <amiconn@rockbox.org> | 2009-10-26 01:35:31 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2009-10-26 01:35:31 +0000 |
commit | 5365cbe0a5af0ef357e7fc70e793141ccd38f23e (patch) | |
tree | 9682db5ae001f4fee09f9ba9bea4e650fdc96d97 /firmware/target/arm/imx31 | |
parent | dd0afc5aa28ab5117056dda3cb19a283ece56ef4 (diff) | |
download | rockbox-5365cbe0a5af0ef357e7fc70e793141ccd38f23e.tar.gz rockbox-5365cbe0a5af0ef357e7fc70e793141ccd38f23e.zip |
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
Diffstat (limited to 'firmware/target/arm/imx31')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c | 63 |
1 files changed, 0 insertions, 63 deletions
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) | |||
146 | LCD_WIDTH*LCD_HEIGHT, 1); | 146 | LCD_WIDTH*LCD_HEIGHT, 1); |
147 | } | 147 | } |
148 | 148 | ||
149 | void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y, | ||
150 | int stride, int x, int y, int width, | ||
151 | int height) | ||
152 | { | ||
153 | int w, px; | ||
154 | fb_data *dst; | ||
155 | |||
156 | if (x + width > current_vp->width) | ||
157 | width = current_vp->width - x; /* Clip right */ | ||
158 | |||
159 | if (x < 0) /* Clip left */ | ||
160 | { | ||
161 | width += x; | ||
162 | src_x -= x; | ||
163 | x = 0; | ||
164 | } | ||
165 | |||
166 | if (width <= 0) | ||
167 | return; /* nothing left to do */ | ||
168 | |||
169 | if (y + height > current_vp->height) | ||
170 | height = current_vp->height - y; /* Clip bottom */ | ||
171 | |||
172 | if (y < 0) /* Clip top */ | ||
173 | { | ||
174 | height += y; | ||
175 | src_y -= y; | ||
176 | y = 0; | ||
177 | } | ||
178 | |||
179 | if (height <= 0) | ||
180 | return; /* nothing left to do */ | ||
181 | |||
182 | src += stride * src_y + src_x; /* move starting point */ | ||
183 | dst = &lcd_framebuffer[current_vp->y+y][current_vp->x+x]; | ||
184 | |||
185 | asm volatile ( | ||
186 | ".rowstart: \r\n" | ||
187 | "mov %[w], %[width] \r\n" /* Load width for inner loop */ | ||
188 | ".nextpixel: \r\n" | ||
189 | "ldrh %[px], [%[s]], #2 \r\n" /* Load src pixel */ | ||
190 | "add %[d], %[d], #2 \r\n" /* Uncoditionally increment dst */ | ||
191 | "cmp %[px], %[fgcolor] \r\n" /* Compare to foreground color */ | ||
192 | "streqh %[fgpat], [%[d], #-2] \r\n" /* Store foregroud if match */ | ||
193 | "cmpne %[px], %[transcolor] \r\n" /* Compare to transparent color */ | ||
194 | "strneh %[px], [%[d], #-2] \r\n" /* Store dst if not transparent */ | ||
195 | "subs %[w], %[w], #1 \r\n" /* Width counter has run down? */ | ||
196 | "bgt .nextpixel \r\n" /* More in this row? */ | ||
197 | "add %[s], %[s], %[sstp], lsl #1 \r\n" /* Skip over to start of next line */ | ||
198 | "add %[d], %[d], %[dstp], lsl #1 \r\n" | ||
199 | "subs %[h], %[h], #1 \r\n" /* Height counter has run down? */ | ||
200 | "bgt .rowstart \r\n" /* More rows? */ | ||
201 | : [w]"=&r"(w), [h]"+&r"(height), [px]"=&r"(px), | ||
202 | [s]"+&r"(src), [d]"+&r"(dst) | ||
203 | : [width]"r"(width), | ||
204 | [sstp]"r"(stride - width), | ||
205 | [dstp]"r"(LCD_WIDTH - width), | ||
206 | [transcolor]"r"(TRANSPARENT_COLOR), | ||
207 | [fgcolor]"r"(REPLACEWITHFG_COLOR), | ||
208 | [fgpat]"r"(current_vp->fg_pattern) | ||
209 | ); | ||
210 | } | ||
211 | |||
212 | void lcd_yuv_set_options(unsigned options) | 149 | void lcd_yuv_set_options(unsigned options) |
213 | { | 150 | { |
214 | lcd_yuv_options = options; | 151 | lcd_yuv_options = options; |