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-vi.c | 113 ----------------------------------------- 1 file changed, 113 deletions(-) (limited to 'firmware/drivers/lcd-2bit-vi.c') diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c index 423f4536d4..b969c93216 100644 --- a/firmware/drivers/lcd-2bit-vi.c +++ b/firmware/drivers/lcd-2bit-vi.c @@ -455,10 +455,6 @@ void LCDFN(drawpixel)(int x, int y) { if ( ((unsigned)x < (unsigned)CURRENT_VP->width) && ((unsigned)y < (unsigned)CURRENT_VP->height) -#if defined(HAVE_VIEWPORT_CLIP) - && ((unsigned)x < (unsigned)LCDM(WIDTH)) - && ((unsigned)y < (unsigned)LCDM(HEIGHT)) -#endif ) LCDFN(pixelfuncs)[CURRENT_VP->drawmode](CURRENT_VP->x+x, CURRENT_VP->y+y); } @@ -530,10 +526,6 @@ void LCDFN(drawline)(int x1, int y1, int x2, int y2) { if ( ((unsigned)x < (unsigned)CURRENT_VP->width) && ((unsigned)y < (unsigned)CURRENT_VP->height) -#if defined(HAVE_VIEWPORT_CLIP) - && ((unsigned)x < (unsigned)LCDM(WIDTH)) - && ((unsigned)y < (unsigned)LCDM(HEIGHT)) -#endif ) pfunc(CURRENT_VP->x + x, CURRENT_VP->y + y); @@ -585,20 +577,6 @@ void LCDFN(hline)(int x1, int x2, int y) x2 += CURRENT_VP->x; y += CURRENT_VP->y; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if (((unsigned)y >= (unsigned) LCDM(HEIGHT)) || (x1 >= LCDM(WIDTH)) - || (x2 < 0)) - return; - - /* clipping */ - if (x1 < 0) - x1 = 0; - if (x2 >= LCDM(WIDTH)) - x2 = LCDM(WIDTH)-1; -#endif - width = x2 - x1 + 1; bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; @@ -644,20 +622,6 @@ void LCDFN(vline)(int x, int y1, int y2) y2 += CURRENT_VP->y; x += CURRENT_VP->x; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if (( (unsigned) x >= (unsigned)LCDM(WIDTH)) || (y1 >= LCDM(HEIGHT)) - || (y2 < 0)) - return; - - /* clipping */ - if (y1 < 0) - y1 = 0; - if (y2 >= LCDM(HEIGHT)) - y2 = LCDM(HEIGHT)-1; -#endif - bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; dst = LCDFB(x,y1>>3); stride_dst = CURRENT_VP->buffer->stride; @@ -728,31 +692,6 @@ void LCDFN(fillrect)(int x, int y, int width, int height) x += CURRENT_VP->x; y += CURRENT_VP->y; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if ((x >= LCDM(WIDTH)) || (y >= LCDM(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 > LCDM(WIDTH)) - width = LCDM(WIDTH) - x; - if (y + height > LCDM(HEIGHT)) - height = LCDM(HEIGHT) - y; -#endif - - if (CURRENT_VP->drawmode & DRMODE_INVERSEVID) { if ((CURRENT_VP->drawmode & DRMODE_BG) && !backdrop) @@ -857,32 +796,6 @@ void ICODE_ATTR LCDFN(mono_bitmap_part)(const unsigned char *src, int src_x, x += CURRENT_VP->x; y += CURRENT_VP->y; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if ((x >= LCDM(WIDTH)) || (y >= LCDM(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 > LCDM(WIDTH)) - width = LCDM(WIDTH) - x; - if (y + height > LCDM(HEIGHT)) - height = LCDM(HEIGHT) - y; -#endif - src += stride * (src_y >> 3) + src_x; /* move starting point */ src_y &= 7; y -= src_y; @@ -1027,32 +940,6 @@ void ICODE_ATTR LCDFN(bitmap_part)(const FBFN(data) *src, int src_x, x += CURRENT_VP->x; y += CURRENT_VP->y; -#if defined(HAVE_VIEWPORT_CLIP) - /********************* Viewport on screen clipping ********************/ - /* nothing to draw? */ - if ((x >= LCDM(WIDTH)) || (y >= LCDM(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 > LCDM(WIDTH)) - width = LCDM(WIDTH) - x; - if (y + height > LCDM(HEIGHT)) - height = LCDM(HEIGHT) - y; -#endif - src += stride * (src_y >> 3) + src_x; /* move starting point */ src_y &= 7; y -= src_y; -- cgit v1.2.3