Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+1 -11
+1 -2
apps/gui/skin_engine/skin_display.c
··· 413 413 #ifdef HAVE_ALBUMART 414 414 /* now draw the AA */ 415 415 struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart); 416 - if (aa && SKINOFFSETTOPTR(get_skin_buffer(data), aa->vp) == vp 417 - && aa->draw_handle >= 0) 416 + if (aa && aa->draw_handle >= 0) 418 417 { 419 418 draw_album_art(gwps, aa->draw_handle, false); 420 419 aa->draw_handle = -1;
-8
apps/gui/skin_engine/skin_parser.c
··· 1317 1317 if (!isdefault(param3) && param3->type == PERCENT) 1318 1318 aa->height = param3->data.number * curr_vp->vp.height / 1000; 1319 1319 1320 - aa->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp); 1321 1320 aa->draw_handle = -1; 1322 1321 1323 1322 /* if we got here, we parsed everything ok .. ! */ ··· 2405 2404 break; 2406 2405 #endif 2407 2406 #ifdef HAVE_ALBUMART 2408 - case SKIN_TOKEN_ALBUMART_DISPLAY: 2409 - if (SKINOFFSETTOPTR(skin_buffer, wps_data->albumart)) 2410 - { 2411 - struct skin_albumart *aa = SKINOFFSETTOPTR(skin_buffer, wps_data->albumart); 2412 - aa->vp = PTRTOSKINOFFSET(skin_buffer, &curr_vp->vp); 2413 - } 2414 - break; 2415 2407 case SKIN_TOKEN_ALBUMART_LOAD: 2416 2408 function = parse_albumart_load; 2417 2409 break;
-1
apps/gui/skin_engine/wps_internals.h
··· 272 272 unsigned char yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */ 273 273 unsigned char state; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */ 274 274 275 - OFFSETTYPE(struct viewport *) vp; 276 275 int draw_handle; 277 276 }; 278 277 #endif