summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-16 19:15:17 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-16 19:15:17 +0000
commit576793a637bb924a6f2c2bacf684a82a93fd438f (patch)
tree4b435c01108452310ba5d6256e05d350d1576e96
parentc20801b71210daaed53d576be0ae7c24d04440df (diff)
downloadrockbox-576793a637bb924a6f2c2bacf684a82a93fd438f.tar.gz
rockbox-576793a637bb924a6f2c2bacf684a82a93fd438f.zip
Recalibrate the skin buffer size calculation so that targets with remote get a reasonable extra buffer (depending on the remote) instead of just doubling it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22352 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_buffer.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_buffer.c b/apps/gui/skin_engine/skin_buffer.c
index 2d10a931ec..750fec62b3 100644
--- a/apps/gui/skin_engine/skin_buffer.c
+++ b/apps/gui/skin_engine/skin_buffer.c
@@ -33,20 +33,37 @@
33 * tokens for both/all screens. 33 * tokens for both/all screens.
34 * 34 *
35 * This is mostly just copy/paste from firmware/buffer.c 35 * This is mostly just copy/paste from firmware/buffer.c
36 *
37 *
38 * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration,
39 * both screens can use the whole buffer as they need; it's not split
40 * between screens
36 */ 41 */
37 42
38#define IMG_BUFSIZE (((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ 43
39 + (2*LCD_HEIGHT*LCD_WIDTH/8)) * NB_SCREENS) 44#define MAIN_BUFFER ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \
40 45 + (2*LCD_HEIGHT*LCD_WIDTH/8))
41static unsigned char buffer_start[IMG_BUFSIZE], *buffer_pos = NULL; 46
42static size_t buf_size = IMG_BUFSIZE; 47#if (NB_SCREENS > 1)
48#define REMOTE_BUFFER ((LCD_REMOTE_HEIGHT*LCD_REMOTE_WIDTH*LCD_REMOTE_DEPTH/8) \
49 + (2*LCD_REMOTE_HEIGHT*LCD_REMOTE_WIDTH/8))
50#else
51#define REMOTE_BUFFER 0
52#endif
53
54
55#define SKIN_BUFFER_SIZE (MAIN_BUFFER + REMOTE_BUFFER)
56
57
58static unsigned char buffer_start[SKIN_BUFFER_SIZE], *buffer_pos = NULL;
59static size_t buf_size = SKIN_BUFFER_SIZE;
43 60
44void skin_buffer_init(void) 61void skin_buffer_init(void)
45{ 62{
46#if 0 /* this will go in again later probably */ 63#if 0 /* this will go in again later probably */
47 if (buffer_start == NULL) 64 if (buffer_start == NULL)
48 { 65 {
49 buf_size = IMG_BUFSIZE;/* global_settings.skin_buf_size */ 66 buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */
50 67
51 buffer_start = buffer_alloc(buf_size); 68 buffer_start = buffer_alloc(buf_size);
52 buffer_pos = buffer_start; 69 buffer_pos = buffer_start;