summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/lcd-16bit-vert.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-03-20 23:04:05 +0100
committerThomas Martitz <kugel@rockbox.org>2012-03-20 23:04:43 +0100
commit1f83d2c6d2256e78a2940e52125ae44c57691904 (patch)
treeb9f5c15711b287e15bf1c37d0ac5b1748b755689 /firmware/drivers/lcd-16bit-vert.c
parentbae247075868986910dd426909370f2230b9331d (diff)
downloadrockbox-1f83d2c6d2256e78a2940e52125ae44c57691904.tar.gz
rockbox-1f83d2c6d2256e78a2940e52125ae44c57691904.tar.bz2
rockbox-1f83d2c6d2256e78a2940e52125ae44c57691904.zip
lcd_fillrect(): Unify 16bit implementations (move to 16bit-common.c)
Change-Id: I457ea9fcb67869fdac7f1201a059a362b087e908
Diffstat (limited to 'firmware/drivers/lcd-16bit-vert.c')
-rw-r--r--firmware/drivers/lcd-16bit-vert.c112
1 files changed, 0 insertions, 112 deletions
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index 2ebd6a366e..1222c12455 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -199,118 +199,6 @@ void lcd_vline(int x, int y1, int y2)
}
}
-/* Fill a rectangular area */
-void lcd_fillrect(int x, int y, int width, int height)
-{
- unsigned bits = 0;
- enum fill_opt fillopt = OPT_NONE;
- fb_data *dst, *dst_end;
-
- /******************** In viewport clipping **********************/
- /* nothing to draw? */
- if ((width <= 0) || (height <= 0) || (x >= current_vp->width) ||
- (y >= current_vp->height) || (x + width <= 0) || (y + height <= 0))
- return;
-
- if (x < 0)
- {
- width += x;
- x = 0;
- }
- if (y < 0)
- {
- height += y;
- y = 0;
- }
- if (x + width > current_vp->width)
- width = current_vp->width - x;
- if (y + height > current_vp->height)
- height = current_vp->height - y;
-
- /* adjust for viewport */
- x += current_vp->x;
- y += current_vp->y;
-
-#if defined(HAVE_VIEWPORT_CLIP)
- /********************* Viewport on screen clipping ********************/
- /* nothing to draw? */
- if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
- || (x + width <= 0) || (y + height <= 0))
- return;
-
- /* clip image in viewport in screen */
- if (x < 0)
- {
- width += x;
- x = 0;
- }
- if (y < 0)
- {
- height += y;
- y = 0;
- }
- if (x + width > LCD_WIDTH)
- width = LCD_WIDTH - x;
- if (y + height > LCD_HEIGHT)
- height = LCD_HEIGHT - y;
-#endif
-
- /* drawmode and optimisation */
- if (current_vp->drawmode & DRMODE_INVERSEVID)
- {
- if (current_vp->drawmode & DRMODE_BG)
- {
- if (!lcd_backdrop)
- {
- fillopt = OPT_SET;
- bits = current_vp->bg_pattern;
- }
- else
- fillopt = OPT_COPY;
- }
- }
- else
- {
- if (current_vp->drawmode & DRMODE_FG)
- {
- fillopt = OPT_SET;
- bits = current_vp->fg_pattern;
- }
- }
- if (fillopt == OPT_NONE && current_vp->drawmode != DRMODE_COMPLEMENT)
- return;
-
- dst = FBADDR(x, y);
- dst_end = dst + width * LCD_HEIGHT;
-
- do
- {
- fb_data *dst_col, *col_end;
-
- switch (fillopt)
- {
- case OPT_SET:
- memset16(dst, bits, height);
- break;
-
- case OPT_COPY:
- memcpy(dst, (void *)((long)dst + lcd_backdrop_offset),
- height * sizeof(fb_data));
- break;
-
- case OPT_NONE: /* DRMODE_COMPLEMENT */
- dst_col = dst;
- col_end = dst_col + height;
- do
- *dst_col = ~(*dst_col);
- while (++dst_col < col_end);
- break;
- }
- dst+=LCD_HEIGHT;
- }
- while (dst < dst_end);
-}
-
/* Draw a partial native bitmap */
void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
int stride, int x, int y, int width,