feat(cache): rework cache

- based in cache size instead of entry count
- not only for images
- needs to be called manually in decoders (and not the cache manages the decoders)
This commit is contained in:
Gabor Kiss-Vamosi
2023-09-14 23:23:26 +02:00
parent 09c12d0f9c
commit 757877b1fc
25 changed files with 885 additions and 540 deletions

View File

@@ -19,7 +19,8 @@
#include "libs/png/lv_png.h"
#include "libs/sjpg/lv_sjpg.h"
#include "draw/lv_draw.h"
#include "draw/lv_image_cache_builtin.h"
#include "misc/lv_cache.h"
#include "misc/lv_cache_builtin.h"
#include "misc/lv_async.h"
#include "misc/lv_fs.h"
@@ -147,7 +148,11 @@ void lv_init(void)
_lv_image_decoder_init();
_lv_image_cache_builtin_init();
_lv_cache_init();
_lv_cache_builtin_init();
lv_cache_lock();
lv_cache_set_max_size(LV_CACHE_DEF_SIZE);
lv_cache_unlock();
/*Test if the IDE has UTF-8 encoding*/
const char * txt = "Á";