diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-04 14:23:04 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-11-23 10:07:29 -0500 |
commit | 3815ef805010486c091c1c38221dcbf898590a8d (patch) | |
tree | ed7e6f9aff20660999166b193b851063e0f28693 /apps/gui/skin_engine/skin_display.c | |
parent | 830436a282e49caea4bd15bfa8c133b4c5d422dd (diff) | |
download | rockbox-3815ef805010486c091c1c38221dcbf898590a8d.tar.gz rockbox-3815ef805010486c091c1c38221dcbf898590a8d.zip |
skin engine: Remove albumart viewport field
The viewport field in albumart is unnecessary, but for a different
reason than eg. the progressbar was. The skin engine draws images
by going over a global list of images shared between all viewports.
Prior to drawing a viewport, every image is marked "not displayed."
When an image display tag is encountered during rendering this mark
is set to the index of the subimage to be displayed.
The albumart is handled similarily, by setting a handle to -1 and
then updating it when the %Cd tag is encountered. The albumart is
not drawn unless the handle is set to >= 0 by the %Cd tag. So we
don't need to track or check viewports at all, because only the
viewport that contains the %Cd tag will ever draw the albumart.
Change-Id: Ibc0233d168012759325d3c16dc317de9ad3dcf6c
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 2affd23c87..43337049fd 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -413,8 +413,7 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp) | |||
413 | #ifdef HAVE_ALBUMART | 413 | #ifdef HAVE_ALBUMART |
414 | /* now draw the AA */ | 414 | /* now draw the AA */ |
415 | struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart); | 415 | struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart); |
416 | if (aa && SKINOFFSETTOPTR(get_skin_buffer(data), aa->vp) == vp | 416 | if (aa && aa->draw_handle >= 0) |
417 | && aa->draw_handle >= 0) | ||
418 | { | 417 | { |
419 | draw_album_art(gwps, aa->draw_handle, false); | 418 | draw_album_art(gwps, aa->draw_handle, false); |
420 | aa->draw_handle = -1; | 419 | aa->draw_handle = -1; |