From 3815ef805010486c091c1c38221dcbf898590a8d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 4 Oct 2022 14:23:04 +0100 Subject: 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 --- apps/gui/skin_engine/skin_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'apps/gui/skin_engine/skin_display.c') 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) #ifdef HAVE_ALBUMART /* now draw the AA */ struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart); - if (aa && SKINOFFSETTOPTR(get_skin_buffer(data), aa->vp) == vp - && aa->draw_handle >= 0) + if (aa && aa->draw_handle >= 0) { draw_album_art(gwps, aa->draw_handle, false); aa->draw_handle = -1; -- cgit v1.2.3