diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-02 12:52:49 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-12 08:06:12 -0400 |
commit | c607bfac6feb6bb915f3133a5c70ba871f5112ed (patch) | |
tree | 923d5b79b688c9e16864c11bf9c990faaa05fded /firmware/drivers/lcd-bitmap-common.c | |
parent | 9549ddabba292f904769437098817dd158c76f49 (diff) | |
download | rockbox-c607bfac6feb6bb915f3133a5c70ba871f5112ed.tar.gz rockbox-c607bfac6feb6bb915f3133a5c70ba871f5112ed.zip |
lcd: Fix update_viewport() for non-default stride viewports
Simplify update_viewport() by calling update_viewport_rect().
The resulting LCD driver calls are the same either way and
for some reason, update_viewport() didn't handle non-default
stride viewports correctly.
Change-Id: Ic34d3d40e4f758db897cb3944d9d7475bbdb4d2c
Diffstat (limited to 'firmware/drivers/lcd-bitmap-common.c')
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index a8ecbd370d..bb98ceed8a 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c | |||
@@ -342,27 +342,8 @@ struct viewport* LCDFN(set_viewport)(struct viewport* vp) | |||
342 | 342 | ||
343 | void LCDFN(update_viewport)(void) | 343 | void LCDFN(update_viewport)(void) |
344 | { | 344 | { |
345 | |||
346 | struct viewport* vp = LCDFN(current_viewport); | 345 | struct viewport* vp = LCDFN(current_viewport); |
347 | if ((vp->flags & VP_FLAG_OWNER_UPDATE) == VP_FLAG_OWNER_UPDATE) | 346 | LCDFN(update_viewport_rect)(0, 0, vp->width, vp->height); |
348 | { | ||
349 | #ifdef LOGF_ENABLE | ||
350 | logf("%s ignored - owner update", __func__); | ||
351 | #endif | ||
352 | return; | ||
353 | } | ||
354 | int x, y; | ||
355 | if (vp->buffer->stride != LCDFN(framebuffer_default.stride)) | ||
356 | { | ||
357 | x = 0; | ||
358 | y = 0; | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | x = vp->x; | ||
363 | y = vp->y; | ||
364 | } | ||
365 | LCDFN(update_rect)(x, y, vp->width, vp->height); | ||
366 | } | 347 | } |
367 | 348 | ||
368 | void LCDFN(update_viewport_rect)(int x, int y, int width, int height) | 349 | void LCDFN(update_viewport_rect)(int x, int y, int width, int height) |