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



Rockbox mail archive

Subject: Re: Skin buffer size

Re: Skin buffer size

From: Jonathan Gordon <jdgordy_at_gmail.com>
Date: Fri, 16 Jul 2010 09:13:21 +1000

On 16 July 2010 08:53, Edgar Toernig <froese_at_gmx.de> wrote:
> 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
> _at__at_ -2229,7 +2229,8 _at__at_ 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
> _at__at_ -67,7 +67,7 _at__at_
>  #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
>

Hi,
I saw that crash yesterday also, I'm rather surprised it hasnt shown up before..
The eventual goal is to make that buffer resizeable, but untill then
doing that change is a waste for most people. (On the clip the font
size is 3K IIRC but on targets with I tihnk more than 8MB ram it is
10K and the extra space isnt usually needed anyway.
Received on 2010-07-16

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy