diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-21 16:13:38 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-27 14:13:15 +0100 |
commit | 09cb3c7843d1bfe24f8259a73441c6398d2c0339 (patch) | |
tree | 2eebb6c411b93e29661bf3287a8f0bb597032181 /firmware/drivers/lcd-2bit-horz.c | |
parent | 24daa265985756122e0cb551c57af621ddee4b60 (diff) | |
download | rockbox-09cb3c7843d1bfe24f8259a73441c6398d2c0339.tar.gz rockbox-09cb3c7843d1bfe24f8259a73441c6398d2c0339.zip |
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
Diffstat (limited to 'firmware/drivers/lcd-2bit-horz.c')
-rw-r--r-- | firmware/drivers/lcd-2bit-horz.c | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c index 85918a735c..66313d624b 100644 --- a/firmware/drivers/lcd-2bit-horz.c +++ b/firmware/drivers/lcd-2bit-horz.c | |||
@@ -420,10 +420,6 @@ void lcd_drawpixel(int x, int y) | |||
420 | { | 420 | { |
421 | if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) | 421 | if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) |
422 | && ((unsigned)y < (unsigned)lcd_current_viewport->height) | 422 | && ((unsigned)y < (unsigned)lcd_current_viewport->height) |
423 | #if defined(HAVE_VIEWPORT_CLIP) | ||
424 | && ((unsigned)x < (unsigned)LCD_WIDTH) | ||
425 | && ((unsigned)y < (unsigned)LCD_HEIGHT) | ||
426 | #endif | ||
427 | ) | 423 | ) |
428 | lcd_pixelfuncs[lcd_current_viewport->drawmode](lcd_current_viewport->x + x, lcd_current_viewport->y + y); | 424 | lcd_pixelfuncs[lcd_current_viewport->drawmode](lcd_current_viewport->x + x, lcd_current_viewport->y + y); |
429 | } | 425 | } |
@@ -495,10 +491,6 @@ void lcd_drawline(int x1, int y1, int x2, int y2) | |||
495 | { | 491 | { |
496 | if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) | 492 | if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) |
497 | && ((unsigned)y < (unsigned)lcd_current_viewport->height) | 493 | && ((unsigned)y < (unsigned)lcd_current_viewport->height) |
498 | #if defined(HAVE_VIEWPORT_CLIP) | ||
499 | && ((unsigned)x < (unsigned)LCD_WIDTH) | ||
500 | && ((unsigned)y < (unsigned)LCD_HEIGHT) | ||
501 | #endif | ||
502 | ) | 494 | ) |
503 | pfunc(lcd_current_viewport->x + x, lcd_current_viewport->y + y); | 495 | pfunc(lcd_current_viewport->x + x, lcd_current_viewport->y + y); |
504 | 496 | ||
@@ -549,20 +541,6 @@ void lcd_hline(int x1, int x2, int y) | |||
549 | x2 += lcd_current_viewport->x; | 541 | x2 += lcd_current_viewport->x; |
550 | y += lcd_current_viewport->y; | 542 | y += lcd_current_viewport->y; |
551 | 543 | ||
552 | #if defined(HAVE_VIEWPORT_CLIP) | ||
553 | /********************* Viewport on screen clipping ********************/ | ||
554 | /* nothing to draw? */ | ||
555 | if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH) | ||
556 | || (x2 < 0)) | ||
557 | return; | ||
558 | |||
559 | /* clipping */ | ||
560 | if (x1 < 0) | ||
561 | x1 = 0; | ||
562 | if (x2 >= LCD_WIDTH) | ||
563 | x2 = LCD_WIDTH-1; | ||
564 | #endif | ||
565 | |||
566 | bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; | 544 | bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; |
567 | dst = FBADDR(x1>>2,y); | 545 | dst = FBADDR(x1>>2,y); |
568 | nx = x2 - (x1 & ~3); | 546 | nx = x2 - (x1 & ~3); |
@@ -611,20 +589,6 @@ void lcd_vline(int x, int y1, int y2) | |||
611 | y2 += lcd_current_viewport->y; | 589 | y2 += lcd_current_viewport->y; |
612 | x += lcd_current_viewport->x; | 590 | x += lcd_current_viewport->x; |
613 | 591 | ||
614 | #if defined(HAVE_VIEWPORT_CLIP) | ||
615 | /********************* Viewport on screen clipping ********************/ | ||
616 | /* nothing to draw? */ | ||
617 | if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT) | ||
618 | || (y2 < 0)) | ||
619 | return; | ||
620 | |||
621 | /* clipping */ | ||
622 | if (y1 < 0) | ||
623 | y1 = 0; | ||
624 | if (y2 >= LCD_HEIGHT) | ||
625 | y2 = LCD_HEIGHT-1; | ||
626 | #endif | ||
627 | |||
628 | bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; | 592 | bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; |
629 | dst = FBADDR(x>>2,y1); | 593 | dst = FBADDR(x>>2,y1); |
630 | stride_dst = LCD_FBSTRIDE(lcd_current_viewport->buffer->stride, 0); | 594 | stride_dst = LCD_FBSTRIDE(lcd_current_viewport->buffer->stride, 0); |
@@ -688,30 +652,6 @@ void lcd_fillrect(int x, int y, int width, int height) | |||
688 | x += lcd_current_viewport->x; | 652 | x += lcd_current_viewport->x; |
689 | y += lcd_current_viewport->y; | 653 | y += lcd_current_viewport->y; |
690 | 654 | ||
691 | #if defined(HAVE_VIEWPORT_CLIP) | ||
692 | /********************* Viewport on screen clipping ********************/ | ||
693 | /* nothing to draw? */ | ||
694 | if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT) | ||
695 | || (x + width <= 0) || (y + height <= 0)) | ||
696 | return; | ||
697 | |||
698 | /* clip image in viewport in screen */ | ||
699 | if (x < 0) | ||
700 | { | ||
701 | width += x; | ||
702 | x = 0; | ||
703 | } | ||
704 | if (y < 0) | ||
705 | { | ||
706 | height += y; | ||
707 | y = 0; | ||
708 | } | ||
709 | if (x + width > LCD_WIDTH) | ||
710 | width = LCD_WIDTH - x; | ||
711 | if (y + height > LCD_HEIGHT) | ||
712 | height = LCD_HEIGHT - y; | ||
713 | #endif | ||
714 | |||
715 | bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; | 655 | bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; |
716 | dst = FBADDR(x>>2,y); | 656 | dst = FBADDR(x>>2,y); |
717 | stride_dst = LCD_FBSTRIDE(lcd_current_viewport->buffer->stride, 0); | 657 | stride_dst = LCD_FBSTRIDE(lcd_current_viewport->buffer->stride, 0); |
@@ -792,32 +732,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, | |||
792 | x += lcd_current_viewport->x; /* adjust for viewport */ | 732 | x += lcd_current_viewport->x; /* adjust for viewport */ |
793 | y += lcd_current_viewport->y; /* adjust for viewport */ | 733 | y += lcd_current_viewport->y; /* adjust for viewport */ |
794 | 734 | ||
795 | #if defined(HAVE_VIEWPORT_CLIP) | ||
796 | /********************* Viewport on screen clipping ********************/ | ||
797 | /* nothing to draw? */ | ||
798 | if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT) | ||
799 | || (x + width <= 0) || (y + height <= 0)) | ||
800 | return; | ||
801 | |||
802 | /* clip image in viewport in screen */ | ||
803 | if (x < 0) | ||
804 | { | ||
805 | width += x; | ||
806 | src_x -= x; | ||
807 | x = 0; | ||
808 | } | ||
809 | if (y < 0) | ||
810 | { | ||
811 | height += y; | ||
812 | src_y -= y; | ||
813 | y = 0; | ||
814 | } | ||
815 | if (x + width > LCD_WIDTH) | ||
816 | width = LCD_WIDTH - x; | ||
817 | if (y + height > LCD_HEIGHT) | ||
818 | height = LCD_HEIGHT - y; | ||
819 | #endif | ||
820 | |||
821 | src += stride * (src_y >> 3) + src_x; /* move starting point */ | 735 | src += stride * (src_y >> 3) + src_x; /* move starting point */ |
822 | src_y &= 7; | 736 | src_y &= 7; |
823 | src_end = src + width; | 737 | src_end = src + width; |
@@ -1007,32 +921,6 @@ void ICODE_ATTR lcd_bitmap_part(const unsigned char *src, int src_x, | |||
1007 | x += lcd_current_viewport->x; | 921 | x += lcd_current_viewport->x; |
1008 | y += lcd_current_viewport->y; | 922 | y += lcd_current_viewport->y; |
1009 | 923 | ||
1010 | #if defined(HAVE_VIEWPORT_CLIP) | ||
1011 | /********************* Viewport on screen clipping ********************/ | ||
1012 | /* nothing to draw? */ | ||
1013 | if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT) | ||
1014 | || (x + width <= 0) || (y + height <= 0)) | ||
1015 | return; | ||
1016 | |||
1017 | /* clip image in viewport in screen */ | ||
1018 | if (x < 0) | ||
1019 | { | ||
1020 | width += x; | ||
1021 | src_x -= x; | ||
1022 | x = 0; | ||
1023 | } | ||
1024 | if (y < 0) | ||
1025 | { | ||
1026 | height += y; | ||
1027 | src_y -= y; | ||
1028 | y = 0; | ||
1029 | } | ||
1030 | if (x + width > LCD_WIDTH) | ||
1031 | width = LCD_WIDTH - x; | ||
1032 | if (y + height > LCD_HEIGHT) | ||
1033 | height = LCD_HEIGHT - y; | ||
1034 | #endif | ||
1035 | |||
1036 | stride = LCD_FBSTRIDE(stride, 0); /* convert to no. of bytes */ | 924 | stride = LCD_FBSTRIDE(stride, 0); /* convert to no. of bytes */ |
1037 | 925 | ||
1038 | src += stride * src_y + (src_x >> 2); /* move starting point */ | 926 | src += stride * src_y + (src_x >> 2); /* move starting point */ |