diff options
Diffstat (limited to 'firmware/drivers/lcd-16bit.c')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index d6bf5a500d..6dff6f3b50 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -92,20 +92,6 @@ void lcd_hline(int x1, int x2, int y) | |||
92 | x2 += lcd_current_viewport->x; | 92 | x2 += lcd_current_viewport->x; |
93 | y += lcd_current_viewport->y; | 93 | y += lcd_current_viewport->y; |
94 | 94 | ||
95 | #if defined(HAVE_VIEWPORT_CLIP) | ||
96 | /********************* Viewport on screen clipping ********************/ | ||
97 | /* nothing to draw? */ | ||
98 | if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH) | ||
99 | || (x2 < 0)) | ||
100 | return; | ||
101 | |||
102 | /* clipping */ | ||
103 | if (x1 < 0) | ||
104 | x1 = 0; | ||
105 | if (x2 >= LCD_WIDTH) | ||
106 | x2 = LCD_WIDTH-1; | ||
107 | #endif | ||
108 | |||
109 | width = x2 - x1 + 1; | 95 | width = x2 - x1 + 1; |
110 | 96 | ||
111 | /* drawmode and optimisation */ | 97 | /* drawmode and optimisation */ |
@@ -188,20 +174,6 @@ void lcd_vline(int x, int y1, int y2) | |||
188 | y1 += lcd_current_viewport->y; | 174 | y1 += lcd_current_viewport->y; |
189 | y2 += lcd_current_viewport->y; | 175 | y2 += lcd_current_viewport->y; |
190 | 176 | ||
191 | #if defined(HAVE_VIEWPORT_CLIP) | ||
192 | /********************* Viewport on screen clipping ********************/ | ||
193 | /* nothing to draw? */ | ||
194 | if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT) | ||
195 | || (y2 < 0)) | ||
196 | return; | ||
197 | |||
198 | /* clipping */ | ||
199 | if (y1 < 0) | ||
200 | y1 = 0; | ||
201 | if (y2 >= LCD_HEIGHT) | ||
202 | y2 = LCD_HEIGHT-1; | ||
203 | #endif | ||
204 | |||
205 | dst = FBADDR(x , y1); | 177 | dst = FBADDR(x , y1); |
206 | stride_dst = lcd_current_viewport->buffer->stride; | 178 | stride_dst = lcd_current_viewport->buffer->stride; |
207 | dst_end = dst + (y2 - y1) * stride_dst; | 179 | dst_end = dst + (y2 - y1) * stride_dst; |
@@ -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_y + src_x; /* move starting point */ | 225 | src += stride * src_y + src_x; /* 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_y + src_x; /* move starting point */ | 275 | src += stride * src_y + src_x; /* move starting point */ |
356 | dst = FBADDR(x, y); | 276 | dst = FBADDR(x, y); |
357 | 277 | ||