From 09cb3c7843d1bfe24f8259a73441c6398d2c0339 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 21 Sep 2022 16:13:38 +0100 Subject: lcd: Remove HAVE_VIEWPORT_CLIP This was only enabled for the mrobe500 and sansaconnect targets. Most targets are therefore running without this "safety" measure, and presumably we'd have noticed long ago if there was a problem. So in all likelihood this is just a bunch of dead code that we don't need to carry around. Change-Id: I7d27701a38b1c2a985ee73fa6f277ad215d8d385 --- firmware/drivers/lcd-2bit-vert.c | 111 --------------------------------------- 1 file changed, 111 deletions(-) (limited to 'firmware/drivers/lcd-2bit-vert.c') diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c index a059e3b512..4ce9960419 100644 --- a/firmware/drivers/lcd-2bit-vert.c +++ b/firmware/drivers/lcd-2bit-vert.c @@ -422,10 +422,6 @@ void lcd_drawpixel(int x, int y) { if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) && ((unsigned)y < (unsigned)lcd_current_viewport->height) -#if defined(HAVE_VIEWPORT_CLIP) - && ((unsigned)x < (unsigned)LCD_WIDTH) - && ((unsigned)y < (unsigned)LCD_HEIGHT) -#endif ) lcd_pixelfuncs[lcd_current_viewport->drawmode](lcd_current_viewport->x + x, lcd_current_viewport->y + y); } @@ -497,10 +493,6 @@ void lcd_drawline(int x1, int y1, int x2, int y2) { if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) && ((unsigned)y < (unsigned)lcd_current_viewport->height) -#if defined(HAVE_VIEWPORT_CLIP) - && ((unsigned)x < (unsigned)LCD_WIDTH) - && ((unsigned)y < (unsigned)LCD_HEIGHT) -#endif ) pfunc(lcd_current_viewport->x + x, lcd_current_viewport->y + y); @@ -552,20 +544,6 @@ void lcd_hline(int x1, int x2, int y) x2 += lcd_current_viewport->x; y += lcd_current_viewport->y; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH) - || (x2 < 0)) - return; - - /* clipping */ - if (x1 < 0) - x1 = 0; - if (x2 >= LCD_WIDTH) - x2 = LCD_WIDTH-1; -#endif - width = x2 - x1 + 1; bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; @@ -611,20 +589,6 @@ void lcd_vline(int x, int y1, int y2) y2 += lcd_current_viewport->y; x += lcd_current_viewport->x; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT) - || (y2 < 0)) - return; - - /* clipping */ - if (y1 < 0) - y1 = 0; - if (y2 >= LCD_HEIGHT) - y2 = LCD_HEIGHT-1; -#endif - bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; dst = FBADDR(x,y1>>2); stride_dst = lcd_current_viewport->buffer->stride; @@ -693,30 +657,6 @@ void lcd_fillrect(int x, int y, int width, int height) x += lcd_current_viewport->x; y += lcd_current_viewport->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 - if (lcd_current_viewport->drawmode & DRMODE_INVERSEVID) { if ((lcd_current_viewport->drawmode & DRMODE_BG) && !lcd_backdrop) @@ -819,32 +759,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, x += lcd_current_viewport->x; y += lcd_current_viewport->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; - src_x -= x; - x = 0; - } - if (y < 0) - { - height += y; - src_y -= y; - y = 0; - } - if (x + width > LCD_WIDTH) - width = LCD_WIDTH - x; - if (y + height > LCD_HEIGHT) - height = LCD_HEIGHT - y; -#endif - src += stride * (src_y >> 3) + src_x; /* move starting point */ src_y &= 7; y -= src_y; @@ -1018,31 +932,6 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y, x += lcd_current_viewport->x; y += lcd_current_viewport->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; - src_x -= x; - x = 0; - } - if (y < 0) - { - height += y; - src_y -= y; - y = 0; - } - if (x + width > LCD_WIDTH) - width = LCD_WIDTH - x; - if (y + height > LCD_HEIGHT) - height = LCD_HEIGHT - y; -#endif src += stride * (src_y >> 2) + src_x; /* move starting point */ src_y &= 3; y -= src_y; -- cgit v1.2.3