summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_backdrops.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_backdrops.c')
-rw-r--r--apps/gui/skin_engine/skin_backdrops.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c
index 243fc30a3a..caf705af54 100644
--- a/apps/gui/skin_engine/skin_backdrops.c
+++ b/apps/gui/skin_engine/skin_backdrops.c
@@ -204,11 +204,28 @@ bool skin_backdrops_preload(void)
return retval;
}
-void* skin_backdrop_get_buffer(int backdrop_id)
+void skin_backdrop_set_buffer(int backdrop_id, struct skin_viewport *svp)
{
- if (backdrop_id < 0)
- return NULL;
- return backdrops[backdrop_id].buffer;
+ if (UNLIKELY(!svp))
+ return;
+ else if (backdrop_id < 0)
+ {
+ svp->vp.buffer = NULL; /*Default*/
+ return;
+ }
+
+ enum screen_type screen = backdrops[backdrop_id].screen;
+ svp->framebuf.ch_ptr = backdrops[backdrop_id].buffer;
+#if defined(HAVE_REMOTE_LCD)
+ if (screen == SCREEN_REMOTE)
+ svp->framebuf.elems = REMOTE_LCD_BACKDROP_BYTES / sizeof(fb_remote_data);
+ else
+#endif
+ {
+ svp->framebuf.elems = LCD_BACKDROP_BYTES / sizeof(fb_data);
+ }
+ svp->framebuf.get_address_fn = NULL; /*Default iterator*/
+ screens[screen].viewport_set_buffer(&svp->vp, &svp->framebuf);
}
void skin_backdrop_show(int backdrop_id)