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-16bit-common.c | 103 ------------------------------------ 1 file changed, 103 deletions(-) (limited to 'firmware/drivers/lcd-16bit-common.c') diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c index 1b84847929..523354d5d2 100644 --- a/firmware/drivers/lcd-16bit-common.c +++ b/firmware/drivers/lcd-16bit-common.c @@ -40,30 +40,6 @@ void lcd_clear_viewport(void) width = lcd_current_viewport->width; height = lcd_current_viewport->height; -#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 - len = STRIDE_MAIN(width, height); step = STRIDE_MAIN(ROW_INC, COL_INC); @@ -182,30 +158,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 - /* drawmode and optimisation */ if (lcd_current_viewport->drawmode & DRMODE_INVERSEVID) { @@ -310,32 +262,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 - /* move starting point */ src += stride * (src_y >> 3) + src_x; src_y &= 7; @@ -568,35 +494,6 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image, 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)) - { - BLEND_FINISH; - 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 - /* the following drawmode combinations are possible: * 1) COMPLEMENT: just negates the framebuffer contents * 2) BG and BG+backdrop: draws _only_ background pixels with either -- cgit v1.2.3