Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Skin buffer size

Skin buffer size

From: Edgar Toernig <froese_at_gmx.de>
Date: Fri, 16 Jul 2010 00:53:41 +0200

Hi,

while creating a new WPS for my Clip+ I hit the limit of
the skin buffer size. The WPS got bigger because I had
to copy most of the classic status bar into the .wps
and I'm using three fonts.

When hitting the limit, a segfault is thrown in the
simulator and in checkwps. The culprit is here:

--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -2229,7 +2229,8 @@ static bool skin_load_fonts(struct wps_data *data)
         if (font->id < 0)
         {
             char *dot = strchr(font->name, '.');
- *dot = '\0';
+ if (dot)
+ *dot = '\0';
             font->id = skin_font_load(font->name);
         }

The first time a font fails to load everything is fine.
But if it's used in multiple viewports, the parser tries
to load it again but this time the extension is already
stripped and 'dot' becomes NULL.

Anyway, trying to make the WPS load I looked at skin_buffer.c
and it seems, the buffer is only sized for a single font.
Could this please be increased to i.e. 5 fonts? As more and
more themes are using multiple fonts and as the space seems
to be shared with images it gets tight easily.

The patch I'm using atm:

--- a/apps/gui/skin_engine/skin_buffer.c
+++ b/apps/gui/skin_engine/skin_buffer.c
@@ -67,7 +67,7 @@
 #endif

-#define SKIN_BUFFER_SIZE (MAIN_BUFFER + REMOTE_BUFFER + SKIN_FONT_SIZE) + \
+#define SKIN_BUFFER_SIZE (MAIN_BUFFER + REMOTE_BUFFER + 5*SKIN_FONT_SIZE) + \
                          (WPS_MAX_TOKENS * sizeof(struct wps_token))
 #endif

Thanks, ET.

PS: Btw, the segfaulting checkwps on the theme server seems to
trigger a PHP error:
| Warning: join() [function.join]: Invalid arguments passed in
| /home/themes/www/upload.php on line 109
Received on 2010-07-16


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa