From f737e5025d6cb2d3a283aa336c072701d1adc83f Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 2 Oct 2022 00:54:31 +0100 Subject: lcd: Refactor viewport clipping functions There's no need to generate separate copies of these functions for main and remote LCDs; we can just pass the viewport directly. Change-Id: I20aa04a58d327b479a942708e161068bd6a3357b --- firmware/drivers/lcd-16bit-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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 a3a6dc6663..27e6c23885 100644 --- a/firmware/drivers/lcd-16bit-common.c +++ b/firmware/drivers/lcd-16bit-common.c @@ -135,7 +135,7 @@ void lcd_fillrect(int x, int y, int width, int height) fb_data *dst, *dst_end; int len, step; - if (!lcd_clip_viewport_rect(&x, &y, &width, &height, NULL, NULL)) + if (!clip_viewport_rect(vp, &x, &y, &width, &height, NULL, NULL)) return; /* drawmode and optimisation */ @@ -216,7 +216,7 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x, int width, int height) { struct viewport *vp = lcd_current_viewport; - if (!lcd_clip_viewport_rect(&x, &y, &width, &height, &src_x, &src_y)) + if (!clip_viewport_rect(vp, &x, &y, &width, &height, &src_x, &src_y)) return; /* move starting point */ @@ -424,7 +424,7 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image, unsigned dmask = 0x00000000; int drmode = vp->drawmode; - if (!lcd_clip_viewport_rect(&x, &y, &width, &height, &src_x, &src_y)) + if (!clip_viewport_rect(vp, &x, &y, &width, &height, &src_x, &src_y)) return; /* initialize blending */ -- cgit v1.2.3