summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-16bit-vert.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-16bit-vert.c')
-rw-r--r--firmware/drivers/lcd-16bit-vert.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index 4422fdea50..166af02791 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -93,20 +93,6 @@ void lcd_hline(int x1, int x2, int y)
93 x2 += lcd_current_viewport->x; 93 x2 += lcd_current_viewport->x;
94 y += lcd_current_viewport->y; 94 y += lcd_current_viewport->y;
95 95
96#if defined(HAVE_VIEWPORT_CLIP)
97 /********************* Viewport on screen clipping ********************/
98 /* nothing to draw? */
99 if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH)
100 || (x2 < 0))
101 return;
102
103 /* clipping */
104 if (x1 < 0)
105 x1 = 0;
106 if (x2 >= LCD_WIDTH)
107 x2 = LCD_WIDTH-1;
108#endif
109
110 dst = FBADDR(x1 , y ); 96 dst = FBADDR(x1 , y );
111 stride_dst = lcd_current_viewport->buffer->stride; 97 stride_dst = lcd_current_viewport->buffer->stride;
112 dst_end = dst + (x2 - x1) * stride_dst; 98 dst_end = dst + (x2 - x1) * stride_dst;
@@ -152,20 +138,6 @@ void lcd_vline(int x, int y1, int y2)
152 y1 += lcd_current_viewport->y; 138 y1 += lcd_current_viewport->y;
153 y2 += lcd_current_viewport->y; 139 y2 += lcd_current_viewport->y;
154 140
155#if defined(HAVE_VIEWPORT_CLIP)
156 /********************* Viewport on screen clipping ********************/
157 /* nothing to draw? */
158 if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT)
159 || (y2 < 0))
160 return;
161
162 /* clipping */
163 if (y1 < 0)
164 y1 = 0;
165 if (y2 >= LCD_HEIGHT)
166 y2 = LCD_HEIGHT-1;
167#endif
168
169 height = y2 - y1 + 1; 141 height = y2 - y1 + 1;
170 142
171 /* drawmode and optimisation */ 143 /* drawmode and optimisation */
@@ -250,32 +222,6 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
250 x += lcd_current_viewport->x; 222 x += lcd_current_viewport->x;
251 y += lcd_current_viewport->y; 223 y += lcd_current_viewport->y;
252 224
253#if defined(HAVE_VIEWPORT_CLIP)
254 /********************* Viewport on screen clipping ********************/
255 /* nothing to draw? */
256 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
257 || (x + width <= 0) || (y + height <= 0))
258 return;
259
260 /* clip image in viewport in screen */
261 if (x < 0)
262 {
263 width += x;
264 src_x -= x;
265 x = 0;
266 }
267 if (y < 0)
268 {
269 height += y;
270 src_y -= y;
271 y = 0;
272 }
273 if (x + width > LCD_WIDTH)
274 width = LCD_WIDTH - x;
275 if (y + height > LCD_HEIGHT)
276 height = LCD_HEIGHT - y;
277#endif
278
279 src += stride * src_x + src_y; /* move starting point */ 225 src += stride * src_x + src_y; /* move starting point */
280 dst = FBADDR(x, y); 226 dst = FBADDR(x, y);
281 stride_dst = lcd_current_viewport->buffer->stride; 227 stride_dst = lcd_current_viewport->buffer->stride;
@@ -326,32 +272,6 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
326 x += lcd_current_viewport->x; 272 x += lcd_current_viewport->x;
327 y += lcd_current_viewport->y; 273 y += lcd_current_viewport->y;
328 274
329#if defined(HAVE_VIEWPORT_CLIP)
330 /********************* Viewport on screen clipping ********************/
331 /* nothing to draw? */
332 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
333 || (x + width <= 0) || (y + height <= 0))
334 return;
335
336 /* clip image in viewport in screen */
337 if (x < 0)
338 {
339 width += x;
340 src_x -= x;
341 x = 0;
342 }
343 if (y < 0)
344 {
345 height += y;
346 src_y -= y;
347 y = 0;
348 }
349 if (x + width > LCD_WIDTH)
350 width = LCD_WIDTH - x;
351 if (y + height > LCD_HEIGHT)
352 height = LCD_HEIGHT - y;
353#endif
354
355 src += stride * src_x + src_y; /* move starting point */ 275 src += stride * src_x + src_y; /* move starting point */
356 dst = FBADDR(x, y); 276 dst = FBADDR(x, y);
357 stride_dst = lcd_current_viewport->buffer->stride; 277 stride_dst = lcd_current_viewport->buffer->stride;