summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-10-05 17:43:51 +0000
committerThomas Martitz <kugel@rockbox.org>2011-10-05 17:43:51 +0000
commit6efb3f0760b54fb80423924a7aab17da043dbba9 (patch)
tree605619029ea1bbbc16b4817130b774fcfbdf2637 /apps
parent8c4941e56130d59cb4de465ef53311815945253a (diff)
downloadrockbox-6efb3f0760b54fb80423924a7aab17da043dbba9.zip
rockbox-6efb3f0760b54fb80423924a7aab17da043dbba9.tar.gz
rockbox-6efb3f0760b54fb80423924a7aab17da043dbba9.tar.bz2
rockbox-6efb3f0760b54fb80423924a7aab17da043dbba9.tar.xz
Revert r30599 "Check for the magic file "/.rockbox/skin_buffer_size.txt" [...]"
It's not clear whether a user setting is the right/accepted fix for the skin buffer. But even if it is, this implementation of it is considered bad, even by the author. See http://www.rockbox.org/mail/archive/rockbox-dev-archive-2011-09/0054.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30718 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_engine.c31
-rw-r--r--apps/main.c8
2 files changed, 4 insertions, 35 deletions
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 89230cb..03afbc5 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -25,9 +25,7 @@
#include <limits.h>
#include "inttypes.h"
#include "config.h"
-#include "core_alloc.h"
#include "action.h"
-#include "misc.h"
#include "crc32.h"
#include "settings.h"
#include "wps.h"
@@ -45,38 +43,14 @@ static bool skins_initialising = true;
/* App uses the host malloc to manage the buffer */
#ifdef APPLICATION
#define skin_buffer NULL
-#define skin_buffer_size 0
void theme_init_buffer(void)
{
skins_initialising = false;
}
#else
-static size_t skin_buffer_size;
-static char *skin_buffer = NULL;
-static int buflib_move_callback(int handle, void* current, void* new)
-{
- (void)handle;
- (void)current;
- (void)new;
- return BUFLIB_CB_CANNOT_MOVE;
-}
-static struct buflib_callbacks buflib_ops = {buflib_move_callback, NULL};
-
+static char skin_buffer[SKIN_BUFFER_SIZE];
void theme_init_buffer(void)
{
- int fd;
- size_t size = SKIN_BUFFER_SIZE;
- fd = open_utf8(ROCKBOX_DIR "/skin_buffer_size.txt", O_RDONLY);
- if (fd >= 0)
- {
- char buf[32];
- read(fd, buf, sizeof(buf));
- if (buf[0] >= '0' && buf[0] <= '9')
- size = atoi(buf)*1024;
- close(fd);
- }
- skin_buffer = core_get_data(core_alloc_ex("skin buffer", size, &buflib_ops));
- skin_buffer_size = size;
skins_initialising = false;
}
#endif
@@ -139,7 +113,8 @@ void skin_unload_all(void)
skin_data_free_buflib_allocs(&skins[j][i].data);
}
- skin_buffer_init(skin_buffer, skin_buffer_size);
+ skin_buffer_init(skin_buffer, SKIN_BUFFER_SIZE);
+
#ifdef HAVE_LCD_BITMAP
skin_backdrop_init();
#endif
diff --git a/apps/main.c b/apps/main.c
index 4d1293d..f0da50e 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -350,9 +350,6 @@ static void init(void)
#ifdef HAVE_REMOTE_LCD
lcd_remote_init();
#endif
- /* This init call allocates an *unmovable* block so must be
- * before any other moveable allocs. */
- theme_init_buffer();
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
global_status.font_id[i] = FONT_SYSFIXED;
@@ -393,6 +390,7 @@ static void init(void)
tree_mem_init();
filetype_init();
playlist_init();
+ theme_init_buffer();
#if CONFIG_CODEC != SWCODEC
mp3_init( global_settings.volume,
@@ -442,10 +440,6 @@ static void init(void)
cpu_boost(true);
#endif
- /* This init call allocates an *unmovable* block so must be
- * before any other moveable allocs. */
- theme_init_buffer();
-
i2c_init();
power_init();