summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-12-03 22:39:08 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-12-03 22:39:08 +0000
commit6b5dff4c7be02d159b7c267372f63155cc31dbb8 (patch)
treed38d1f11c4b79c5ac83f885e1aae5fa4073eb837
parent26851eaaa984ceecd9f9b50b082c0835f990c726 (diff)
downloadrockbox-6b5dff4c7be02d159b7c267372f63155cc31dbb8.tar.gz
rockbox-6b5dff4c7be02d159b7c267372f63155cc31dbb8.zip
lcd-16bit: move lcd_bitmap and lcd_bitmap_transparent to common code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31131 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/lcd-16bit-common.c13
-rw-r--r--firmware/drivers/lcd-16bit-vert.c18
-rw-r--r--firmware/drivers/lcd-16bit.c13
3 files changed, 15 insertions, 29 deletions
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c
index 7253524976..5f3997a5f6 100644
--- a/firmware/drivers/lcd-16bit-common.c
+++ b/firmware/drivers/lcd-16bit-common.c
@@ -910,6 +910,19 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
910 } while (--row); 910 } while (--row);
911} 911}
912 912
913/* Draw a full native bitmap */
914void lcd_bitmap(const fb_data *src, int x, int y, int width, int height)
915{
916 lcd_bitmap_part(src, 0, 0, STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
917}
918
919/* Draw a full native bitmap with a transparent color */
920void lcd_bitmap_transparent(const fb_data *src, int x, int y,
921 int width, int height)
922{
923 lcd_bitmap_transparent_part(src, 0, 0,
924 STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
925}
913 926
914/* draw alpha bitmap for anti-alias font */ 927/* draw alpha bitmap for anti-alias font */
915void ICODE_ATTR lcd_alpha_bitmap_part(const unsigned char *src, int src_x, 928void ICODE_ATTR lcd_alpha_bitmap_part(const unsigned char *src, int src_x,
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index 1d9e207bd9..f020d74757 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -369,7 +369,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
369 int stride, int x, int y, int width, 369 int stride, int x, int y, int width,
370 int height) 370 int height)
371{ 371{
372 fb_data *dst, *dst_end; 372 fb_data *dst;
373 373
374 /******************** Image in viewport clipping **********************/ 374 /******************** Image in viewport clipping **********************/
375 /* nothing to draw? */ 375 /* nothing to draw? */
@@ -427,7 +427,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
427 427
428 src += stride * src_x + src_y; /* move starting point */ 428 src += stride * src_x + src_y; /* move starting point */
429 dst = LCDADDR(x, y); 429 dst = LCDADDR(x, y);
430 dst_end = dst + width * LCD_HEIGHT; 430 fb_data *dst_end = dst + width * LCD_HEIGHT;
431 431
432 do 432 do
433 { 433 {
@@ -438,12 +438,6 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
438 while (dst < dst_end); 438 while (dst < dst_end);
439} 439}
440 440
441/* Draw a full native bitmap */
442void lcd_bitmap(const fb_data *src, int x, int y, int width, int height)
443{
444 lcd_bitmap_part(src, 0, 0, STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
445}
446
447/* Draw a partial native bitmap */ 441/* Draw a partial native bitmap */
448void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x, 442void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
449 int src_y, int stride, int x, 443 int src_y, int stride, int x,
@@ -524,11 +518,3 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
524 } 518 }
525 while (dst < dst_end); 519 while (dst < dst_end);
526} 520}
527
528/* Draw a full native bitmap with a transparent color */
529void lcd_bitmap_transparent(const fb_data *src, int x, int y,
530 int width, int height)
531{
532 lcd_bitmap_transparent_part(src, 0, 0,
533 STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
534}
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 60dfc7bcf2..f7d3cf22d4 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -437,12 +437,6 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
437 while (--height > 0); 437 while (--height > 0);
438} 438}
439 439
440/* Draw a full native bitmap */
441void lcd_bitmap(const fb_data *src, int x, int y, int width, int height)
442{
443 lcd_bitmap_part(src, 0, 0, width, x, y, width, height);
444}
445
446/* Draw a partial native bitmap with transparency and foreground colors */ 440/* Draw a partial native bitmap with transparency and foreground colors */
447void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x, 441void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
448 int src_y, int stride, int x, 442 int src_y, int stride, int x,
@@ -561,10 +555,3 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
561 while (--height > 0); 555 while (--height > 0);
562#endif 556#endif
563} 557}
564
565/* Draw a full native bitmap with transparent and foreground colors */
566void lcd_bitmap_transparent(const fb_data *src, int x, int y,
567 int width, int height)
568{
569 lcd_bitmap_transparent_part(src, 0, 0, width, x, y, width, height);
570}