summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-11-04 10:15:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-11-04 10:15:33 +0000
commit97857324c32f929c396814ba268e39a865a6fa42 (patch)
treeffb911b3fac2e01f95956e540807583b92e65134 /apps/gui/skin_engine
parent72964f2571cce19524c45254d3b71639dd07def3 (diff)
RaaA: Use the host's malloc() for the skin engine.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28480 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_engine.c14
-rw-r--r--apps/gui/skin_engine/skin_parser.c6
2 files changed, 19 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 8bf165812a..960bbdb313 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -38,11 +38,23 @@
#include "skin_buffer.h"
#include "statusbar-skinned.h"
+static bool skins_initialising = true;
+
+/* Hosted platforms use the host malloc to manage the buffer */
+#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0)
static char *skin_buffer = NULL;
void theme_init_buffer(void)
{
skin_buffer = buffer_alloc(SKIN_BUFFER_SIZE);
+ skins_initialising = false;
}
+#else
+#define skin_buffer NULL
+void theme_init_buffer(void)
+{
+ skins_initialising = false;
+}
+#endif
void settings_apply_skins(void)
{
@@ -149,7 +161,7 @@ struct gui_wps *skin_get_gwps(enum skinnable_screens skin, enum screen_type scre
{
case CUSTOM_STATUSBAR:
#ifdef HAVE_LCD_BITMAP
- if (skin_buffer == NULL)
+ if (skins_initialising)
{
/* still loading, buffers not initialised yet,
* viewport manager calls into the sbs code, not really
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 43c2ffa304..c0ea3e3ca9 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1613,11 +1613,15 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
wps_data->backdrop_id = -1;
#endif
/* parse the skin source */
+#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0)
skin_buffer_save_position();
+#endif
wps_data->tree = skin_parse(wps_buffer, skin_element_callback, wps_data);
if (!wps_data->tree) {
skin_data_reset(wps_data);
+#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0)
skin_buffer_restore_position();
+#endif
return false;
}
@@ -1639,7 +1643,9 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
!skin_load_fonts(wps_data))
{
skin_data_reset(wps_data);
+#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0)
skin_buffer_restore_position();
+#endif
return false;
}
#endif