diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-11-11 02:01:05 +0000 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-11-11 02:01:05 +0000 |
commit | a54c4ab7d42c9ef90a5cf10581d072f33968a6c5 (patch) | |
tree | 87814a0a7efcbd79698f1a4ca8dfd85cb7b85b90 /firmware/target/arm/imx233 | |
parent | 7bbdcc1c3bf87c24a5b52716471a7b6c97305813 (diff) | |
download | rockbox-a54c4ab7d42c9ef90a5cf10581d072f33968a6c5.tar.gz rockbox-a54c4ab7d42c9ef90a5cf10581d072f33968a6c5.zip |
zen/zenxfi: correctly implement partial redraw
Although there is no difference in the cost of a full or partial update,
it is preferable that the semantic of lcd_update_rect() be correct.
Change-Id: I8a168388b98e0dbd7237729b7fd8a62fa1885be1
Diffstat (limited to 'firmware/target/arm/imx233')
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/lcd-zen.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zen.c b/firmware/target/arm/imx233/creative-zen/lcd-zen.c index fd7d3e0205..22d643c778 100644 --- a/firmware/target/arm/imx233/creative-zen/lcd-zen.c +++ b/firmware/target/arm/imx233/creative-zen/lcd-zen.c | |||
@@ -339,13 +339,15 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
339 | if(!lcd_on) | 339 | if(!lcd_on) |
340 | return; | 340 | return; |
341 | #endif | 341 | #endif |
342 | uint8_t *p = FRAME; | 342 | for(int yy = y; yy < y + h; yy++) |
343 | for(int y = 0; y < LCD_HEIGHT; y++) | 343 | { |
344 | for(int x = 0; x < LCD_WIDTH; x++) | 344 | uint16_t *pix = FBADDR(x, yy); |
345 | uint8_t *p = 3 * (yy * LCD_WIDTH + x) + (uint8_t *)FRAME; | ||
346 | for(int xx = 0; xx < w; xx++, pix++) | ||
345 | { | 347 | { |
346 | uint16_t pix = *FBADDR(x,y); | 348 | *p++ = RGB_UNPACK_RED(*pix); |
347 | *p++ = RGB_UNPACK_RED(pix); | 349 | *p++ = RGB_UNPACK_GREEN(*pix); |
348 | *p++ = RGB_UNPACK_GREEN(pix); | 350 | *p++ = RGB_UNPACK_BLUE(*pix); |
349 | *p++ = RGB_UNPACK_BLUE(pix); | ||
350 | } | 351 | } |
352 | } | ||
351 | } | 353 | } |