diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index adfda54335..cb185d88ba 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -83,6 +83,7 @@ static char* skin_buffer = NULL; | |||
83 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) | 83 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) |
84 | static char *backdrop_filename; | 84 | static char *backdrop_filename; |
85 | #endif | 85 | #endif |
86 | static struct skin_stats *_stats = NULL; | ||
86 | 87 | ||
87 | static bool isdefault(struct skin_tag_parameter *param) | 88 | static bool isdefault(struct skin_tag_parameter *param) |
88 | { | 89 | { |
@@ -1770,6 +1771,8 @@ static int load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char* | |||
1770 | close(fd); | 1771 | close(fd); |
1771 | return handle; | 1772 | return handle; |
1772 | } | 1773 | } |
1774 | _stats->buflib_handles++; | ||
1775 | _stats->images_size += buf_size; | ||
1773 | lseek(fd, 0, SEEK_SET); | 1776 | lseek(fd, 0, SEEK_SET); |
1774 | lock_handle(handle); | 1777 | lock_handle(handle); |
1775 | bitmap->data = core_get_data(handle); | 1778 | bitmap->data = core_get_data(handle); |
@@ -2282,7 +2285,7 @@ static int skin_element_callback(struct skin_element* element, void* data) | |||
2282 | /* to setup up the wps-data from a format-buffer (isfile = false) | 2285 | /* to setup up the wps-data from a format-buffer (isfile = false) |
2283 | from a (wps-)file (isfile = true)*/ | 2286 | from a (wps-)file (isfile = true)*/ |
2284 | bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, | 2287 | bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, |
2285 | const char *buf, bool isfile) | 2288 | const char *buf, bool isfile, struct skin_stats *stats) |
2286 | { | 2289 | { |
2287 | char *wps_buffer = NULL; | 2290 | char *wps_buffer = NULL; |
2288 | if (!wps_data || !buf) | 2291 | if (!wps_data || !buf) |
@@ -2315,8 +2318,9 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, | |||
2315 | } | 2318 | } |
2316 | #endif | 2319 | #endif |
2317 | 2320 | ||
2318 | 2321 | _stats = stats; | |
2319 | /* get buffer space from the plugin buffer */ | 2322 | skin_clear_stats(stats); |
2323 | /* get buffer space from the plugin buffer */ | ||
2320 | size_t buffersize = 0; | 2324 | size_t buffersize = 0; |
2321 | wps_buffer = (char *)plugin_get_buffer(&buffersize); | 2325 | wps_buffer = (char *)plugin_get_buffer(&buffersize); |
2322 | 2326 | ||
@@ -2426,6 +2430,8 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, | |||
2426 | wps_data->wps_loaded = true; | 2430 | wps_data->wps_loaded = true; |
2427 | memcpy(core_get_data(wps_data->buflib_handle), skin_buffer, | 2431 | memcpy(core_get_data(wps_data->buflib_handle), skin_buffer, |
2428 | skin_buffer_usage()); | 2432 | skin_buffer_usage()); |
2433 | stats->buflib_handles++; | ||
2434 | stats->tree_size = skin_buffer_usage(); | ||
2429 | } | 2435 | } |
2430 | #else | 2436 | #else |
2431 | wps_data->wps_loaded = wps_data->tree >= 0; | 2437 | wps_data->wps_loaded = wps_data->tree >= 0; |