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
This commit is contained in:
Aidan MacDonald 2022-09-21 16:13:38 +01:00
parent 24daa26598
commit 09cb3c7843
12 changed files with 0 additions and 883 deletions

View file

@ -274,10 +274,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);
}
@ -349,10 +345,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);
@ -403,20 +395,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];
@ -462,20 +440,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);
ny = y2 - (y1 & ~7);
@ -544,30 +508,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)
@ -670,32 +610,6 @@ void ICODE_ATTR LCDFN(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;