feat(cache): image cache supports dynamic setting of cache size (#5926)
This commit is contained in:
@@ -103,13 +103,8 @@ typedef struct _lv_global_t {
|
|||||||
|
|
||||||
lv_ll_t img_decoder_ll;
|
lv_ll_t img_decoder_ll;
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
lv_cache_t * img_cache;
|
lv_cache_t * img_cache;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
lv_cache_t * img_header_cache;
|
lv_cache_t * img_header_cache;
|
||||||
#endif
|
|
||||||
|
|
||||||
lv_draw_global_info_t draw_info;
|
lv_draw_global_info_t draw_info;
|
||||||
#if defined(LV_DRAW_SW_SHADOW_CACHE_SIZE) && LV_DRAW_SW_SHADOW_CACHE_SIZE > 0
|
#if defined(LV_DRAW_SW_SHADOW_CACHE_SIZE) && LV_DRAW_SW_SHADOW_CACHE_SIZE > 0
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ static uint32_t img_width_to_stride(lv_image_header_t * header);
|
|||||||
*/
|
*/
|
||||||
static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_header_t * header);
|
static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_header_t * header);
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc);
|
||||||
static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
@@ -57,18 +55,13 @@ static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_he
|
|||||||
/**
|
/**
|
||||||
* Initialize the image decoder module
|
* Initialize the image decoder module
|
||||||
*/
|
*/
|
||||||
void _lv_image_decoder_init(void)
|
void _lv_image_decoder_init(uint32_t image_cache_size, uint32_t image_header_count)
|
||||||
{
|
{
|
||||||
_lv_ll_init(img_decoder_ll_p, sizeof(lv_image_decoder_t));
|
_lv_ll_init(img_decoder_ll_p, sizeof(lv_image_decoder_t));
|
||||||
|
|
||||||
/*Initialize the cache*/
|
/*Initialize the cache*/
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
lv_image_cache_init(image_cache_size);
|
||||||
lv_image_cache_init();
|
lv_image_header_cache_init(image_header_count);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
lv_image_header_cache_init();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,13 +69,9 @@ void _lv_image_decoder_init(void)
|
|||||||
*/
|
*/
|
||||||
void _lv_image_decoder_deinit(void)
|
void _lv_image_decoder_deinit(void)
|
||||||
{
|
{
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
lv_cache_destroy(img_cache_p, NULL);
|
lv_cache_destroy(img_cache_p, NULL);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
lv_cache_destroy(img_header_cache_p, NULL);
|
lv_cache_destroy(img_header_cache_p, NULL);
|
||||||
#endif
|
|
||||||
_lv_ll_clear(img_decoder_ll_p);
|
_lv_ll_clear(img_decoder_ll_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,16 +91,16 @@ lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src
|
|||||||
dsc->src = src;
|
dsc->src = src;
|
||||||
dsc->src_type = lv_image_src_get_type(src);
|
dsc->src_type = lv_image_src_get_type(src);
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
if(lv_image_cache_is_enabled()) {
|
||||||
dsc->cache = img_cache_p;
|
dsc->cache = img_cache_p;
|
||||||
/*Try cache first, unless we are told to ignore cache.*/
|
/*Try cache first, unless we are told to ignore cache.*/
|
||||||
if(!(args && args->no_cache)) {
|
if(!(args && args->no_cache)) {
|
||||||
/*
|
/*
|
||||||
* Check the cache first
|
* Check the cache first
|
||||||
* If the image is found in the cache, just return it.*/
|
* If the image is found in the cache, just return it.*/
|
||||||
if(try_cache(dsc) == LV_RESULT_OK) return LV_RESULT_OK;
|
if(try_cache(dsc) == LV_RESULT_OK) return LV_RESULT_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*Find the decoder that can open the image source, and get the header info in the same time.*/
|
/*Find the decoder that can open the image source, and get the header info in the same time.*/
|
||||||
dsc->decoder = image_decoder_get_info(src, &dsc->header);
|
dsc->decoder = image_decoder_get_info(src, &dsc->header);
|
||||||
@@ -201,7 +190,6 @@ void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decode
|
|||||||
decoder->close_cb = close_cb;
|
decoder->close_cb = close_cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder,
|
lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder,
|
||||||
lv_image_cache_data_t * search_key,
|
lv_image_cache_data_t * search_key,
|
||||||
const lv_draw_buf_t * decoded, void * user_data)
|
const lv_draw_buf_t * decoded, void * user_data)
|
||||||
@@ -224,7 +212,6 @@ lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder,
|
|||||||
|
|
||||||
return cache_entry;
|
return cache_entry;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
lv_draw_buf_t * lv_image_decoder_post_process(lv_image_decoder_dsc_t * dsc, lv_draw_buf_t * decoded)
|
lv_draw_buf_t * lv_image_decoder_post_process(lv_image_decoder_dsc_t * dsc, lv_draw_buf_t * decoded)
|
||||||
{
|
{
|
||||||
@@ -291,9 +278,9 @@ static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_he
|
|||||||
}
|
}
|
||||||
|
|
||||||
lv_image_decoder_t * decoder;
|
lv_image_decoder_t * decoder;
|
||||||
|
bool is_header_cache_enabled = lv_image_header_cache_is_enabled();
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
if(is_header_cache_enabled && src_type == LV_IMAGE_SRC_FILE) {
|
||||||
if(src_type == LV_IMAGE_SRC_FILE) {
|
|
||||||
lv_image_header_cache_data_t search_key;
|
lv_image_header_cache_data_t search_key;
|
||||||
search_key.src_type = src_type;
|
search_key.src_type = src_type;
|
||||||
search_key.src = src;
|
search_key.src = src;
|
||||||
@@ -308,7 +295,6 @@ static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_he
|
|||||||
return decoder;
|
return decoder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
_LV_LL_READ(img_decoder_ll_p, decoder) {
|
_LV_LL_READ(img_decoder_ll_p, decoder) {
|
||||||
/*Info and Open callbacks are required*/
|
/*Info and Open callbacks are required*/
|
||||||
@@ -324,8 +310,7 @@ static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_he
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
if(is_header_cache_enabled && src_type == LV_IMAGE_SRC_FILE && decoder) {
|
||||||
if(src_type == LV_IMAGE_SRC_FILE && decoder) {
|
|
||||||
lv_cache_entry_t * entry;
|
lv_cache_entry_t * entry;
|
||||||
lv_image_header_cache_data_t search_key;
|
lv_image_header_cache_data_t search_key;
|
||||||
search_key.src_type = src_type;
|
search_key.src_type = src_type;
|
||||||
@@ -341,7 +326,6 @@ static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_he
|
|||||||
|
|
||||||
lv_cache_release(img_header_cache_p, entry, NULL);
|
lv_cache_release(img_header_cache_p, entry, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return decoder;
|
return decoder;
|
||||||
}
|
}
|
||||||
@@ -356,7 +340,6 @@ static uint32_t img_width_to_stride(lv_image_header_t * header)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc)
|
static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc)
|
||||||
{
|
{
|
||||||
lv_cache_t * cache = dsc->cache;
|
lv_cache_t * cache = dsc->cache;
|
||||||
@@ -377,4 +360,3 @@ static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc)
|
|||||||
|
|
||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -178,8 +178,10 @@ struct _lv_image_decoder_dsc_t {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the image decoder module
|
* Initialize the image decoder module
|
||||||
|
* @param image_cache_size Image cache size in bytes. 0 to disable cache.
|
||||||
|
* @param image_header_count Number of header cache entries. 0 to disable header cache.
|
||||||
*/
|
*/
|
||||||
void _lv_image_decoder_init(void);
|
void _lv_image_decoder_init(uint32_t image_cache_size, uint32_t image_header_count);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deinitialize the image decoder module
|
* Deinitialize the image decoder module
|
||||||
@@ -276,11 +278,9 @@ void lv_image_decoder_set_get_area_cb(lv_image_decoder_t * decoder, lv_image_dec
|
|||||||
*/
|
*/
|
||||||
void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decoder_close_f_t close_cb);
|
void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decoder_close_f_t close_cb);
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder,
|
lv_cache_entry_t * lv_image_decoder_add_to_cache(lv_image_decoder_t * decoder,
|
||||||
lv_image_cache_data_t * search_key,
|
lv_image_cache_data_t * search_key,
|
||||||
const lv_draw_buf_t * decoded, void * user_data);
|
const lv_draw_buf_t * decoded, void * user_data);
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the decoded image, make any modification if decoder `args` requires.
|
* Check the decoded image, make any modification if decoder `args` requires.
|
||||||
|
|||||||
@@ -393,7 +393,10 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(dsc->args.no_cache) return res;
|
if(dsc->args.no_cache) return res;
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
|
if(!lv_image_cache_is_enabled()) return res;
|
||||||
|
|
||||||
|
/*Add the decoded image to the cache*/
|
||||||
if(res == LV_RESULT_OK) {
|
if(res == LV_RESULT_OK) {
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
search_key.src_type = dsc->src_type;
|
search_key.src_type = dsc->src_type;
|
||||||
@@ -409,7 +412,6 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
}
|
}
|
||||||
dsc->cache_entry = entry;
|
dsc->cache_entry = entry;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -418,7 +420,7 @@ static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t *
|
|||||||
{
|
{
|
||||||
LV_UNUSED(decoder); /*Unused*/
|
LV_UNUSED(decoder); /*Unused*/
|
||||||
|
|
||||||
if(dsc->args.no_cache || LV_CACHE_DEF_SIZE == 0)
|
if(dsc->args.no_cache || !lv_image_cache_is_enabled())
|
||||||
decoder_draw_buf_free((lv_draw_buf_t *)dsc->decoded);
|
decoder_draw_buf_free((lv_draw_buf_t *)dsc->decoded);
|
||||||
else
|
else
|
||||||
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
||||||
|
|||||||
@@ -326,7 +326,8 @@ lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(use_directly || dsc->args.no_cache) return LV_RESULT_OK; /*Do not put image to cache if it can be used directly.*/
|
if(use_directly || dsc->args.no_cache) return LV_RESULT_OK; /*Do not put image to cache if it can be used directly.*/
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
|
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;
|
||||||
|
|
||||||
/*Add it to cache*/
|
/*Add it to cache*/
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
@@ -342,7 +343,6 @@ lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
dsc->cache_entry = cache_entry;
|
dsc->cache_entry = cache_entry;
|
||||||
decoder_data_t * decoder_data = get_decoder_data(dsc);
|
decoder_data_t * decoder_data = get_decoder_data(dsc);
|
||||||
decoder_data->decoded = NULL; /*Cache will take care of it*/
|
decoder_data->decoded = NULL; /*Cache will take care of it*/
|
||||||
#endif
|
|
||||||
|
|
||||||
return LV_RESULT_OK;
|
return LV_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,10 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(dsc->args.no_cache) return LV_RES_OK;
|
if(dsc->args.no_cache) return LV_RES_OK;
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
|
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;
|
||||||
|
|
||||||
|
/*Add the decoded image to the cache*/
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
search_key.src_type = dsc->src_type;
|
search_key.src_type = dsc->src_type;
|
||||||
search_key.src = dsc->src;
|
search_key.src = dsc->src;
|
||||||
@@ -186,7 +189,6 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
dsc->cache_entry = entry;
|
dsc->cache_entry = entry;
|
||||||
#endif
|
|
||||||
return LV_RESULT_OK; /*If not returned earlier then it failed*/
|
return LV_RESULT_OK; /*If not returned earlier then it failed*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +202,7 @@ static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t *
|
|||||||
{
|
{
|
||||||
LV_UNUSED(decoder); /*Unused*/
|
LV_UNUSED(decoder); /*Unused*/
|
||||||
|
|
||||||
if(dsc->args.no_cache || LV_CACHE_DEF_SIZE == 0)
|
if(dsc->args.no_cache || !lv_image_cache_is_enabled())
|
||||||
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
||||||
else
|
else
|
||||||
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
||||||
|
|||||||
@@ -147,7 +147,10 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(dsc->args.no_cache) return LV_RES_OK;
|
if(dsc->args.no_cache) return LV_RES_OK;
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
|
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;
|
||||||
|
|
||||||
|
/*Add the decoded image to the cache*/
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
search_key.src_type = dsc->src_type;
|
search_key.src_type = dsc->src_type;
|
||||||
search_key.src = dsc->src;
|
search_key.src = dsc->src;
|
||||||
@@ -160,7 +163,7 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
dsc->cache_entry = entry;
|
dsc->cache_entry = entry;
|
||||||
#endif
|
|
||||||
return LV_RESULT_OK; /*The image is fully decoded. Return with its pointer*/
|
return LV_RESULT_OK; /*The image is fully decoded. Return with its pointer*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +177,7 @@ static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t *
|
|||||||
{
|
{
|
||||||
LV_UNUSED(decoder); /*Unused*/
|
LV_UNUSED(decoder); /*Unused*/
|
||||||
|
|
||||||
if(dsc->args.no_cache || LV_CACHE_DEF_SIZE == 0)
|
if(dsc->args.no_cache || !lv_image_cache_is_enabled())
|
||||||
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
||||||
else
|
else
|
||||||
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
||||||
|
|||||||
@@ -201,7 +201,10 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
|
|
||||||
if(dsc->args.no_cache) return LV_RES_OK;
|
if(dsc->args.no_cache) return LV_RES_OK;
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
/*If the image cache is disabled, just return the decoded image*/
|
||||||
|
if(!lv_image_cache_is_enabled()) return LV_RESULT_OK;
|
||||||
|
|
||||||
|
/*Add the decoded image to the cache*/
|
||||||
lv_image_cache_data_t search_key;
|
lv_image_cache_data_t search_key;
|
||||||
search_key.src_type = dsc->src_type;
|
search_key.src_type = dsc->src_type;
|
||||||
search_key.src = dsc->src;
|
search_key.src = dsc->src;
|
||||||
@@ -213,7 +216,6 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
|||||||
return LV_RESULT_INVALID;
|
return LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
dsc->cache_entry = entry;
|
dsc->cache_entry = entry;
|
||||||
#endif
|
|
||||||
|
|
||||||
return LV_RESULT_OK; /*If not returned earlier then it failed*/
|
return LV_RESULT_OK; /*If not returned earlier then it failed*/
|
||||||
}
|
}
|
||||||
@@ -228,7 +230,7 @@ static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t *
|
|||||||
{
|
{
|
||||||
LV_UNUSED(decoder);
|
LV_UNUSED(decoder);
|
||||||
|
|
||||||
if(dsc->args.no_cache || LV_CACHE_DEF_SIZE == 0)
|
if(dsc->args.no_cache || !lv_image_cache_is_enabled())
|
||||||
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
||||||
else
|
else
|
||||||
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ void lv_init(void)
|
|||||||
_lv_sysmon_builtin_init();
|
_lv_sysmon_builtin_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_lv_image_decoder_init();
|
_lv_image_decoder_init(LV_CACHE_DEF_SIZE, LV_IMAGE_HEADER_CACHE_DEF_CNT);
|
||||||
lv_bin_decoder_init(); /*LVGL built-in binary image decoder*/
|
lv_bin_decoder_init(); /*LVGL built-in binary image decoder*/
|
||||||
|
|
||||||
#if LV_USE_DRAW_VG_LITE
|
#if LV_USE_DRAW_VG_LITE
|
||||||
|
|||||||
6
src/misc/cache/_lv_cache_lru_rb.c
vendored
6
src/misc/cache/_lv_cache_lru_rb.c
vendored
@@ -198,8 +198,7 @@ static bool init_cnt_cb(lv_cache_t * cache)
|
|||||||
LV_ASSERT_NULL(lru->cache.ops.free_cb);
|
LV_ASSERT_NULL(lru->cache.ops.free_cb);
|
||||||
LV_ASSERT(lru->cache.node_size > 0);
|
LV_ASSERT(lru->cache.node_size > 0);
|
||||||
|
|
||||||
if(lru->cache.node_size <= 0 || lru->cache.max_size <= 0
|
if(lru->cache.node_size <= 0 || lru->cache.ops.compare_cb == NULL || lru->cache.ops.free_cb == NULL) {
|
||||||
|| lru->cache.ops.compare_cb == NULL || lru->cache.ops.free_cb == NULL) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,8 +221,7 @@ static bool init_size_cb(lv_cache_t * cache)
|
|||||||
LV_ASSERT_NULL(lru->cache.ops.free_cb);
|
LV_ASSERT_NULL(lru->cache.ops.free_cb);
|
||||||
LV_ASSERT(lru->cache.node_size > 0);
|
LV_ASSERT(lru->cache.node_size > 0);
|
||||||
|
|
||||||
if(lru->cache.node_size <= 0 || lru->cache.max_size <= 0
|
if(lru->cache.node_size <= 0 || lru->cache.ops.compare_cb == NULL || lru->cache.ops.free_cb == NULL) {
|
||||||
|| lru->cache.ops.compare_cb == NULL || lru->cache.ops.free_cb == NULL) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
35
src/misc/cache/lv_cache.c
vendored
35
src/misc/cache/lv_cache.c
vendored
@@ -82,6 +82,12 @@ lv_cache_entry_t * lv_cache_acquire(lv_cache_t * cache, const void * key, void *
|
|||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
|
|
||||||
|
if(cache->size == 0) {
|
||||||
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
lv_cache_entry_t * entry = cache->clz->get_cb(cache, key, user_data);
|
lv_cache_entry_t * entry = cache->clz->get_cb(cache, key, user_data);
|
||||||
if(entry != NULL) {
|
if(entry != NULL) {
|
||||||
lv_cache_entry_acquire_data(entry);
|
lv_cache_entry_acquire_data(entry);
|
||||||
@@ -108,6 +114,11 @@ lv_cache_entry_t * lv_cache_add(lv_cache_t * cache, const void * key, void * use
|
|||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
|
if(cache->max_size == 0) {
|
||||||
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
lv_cache_entry_t * entry = cache_add_internal_no_lock(cache, key, user_data);
|
lv_cache_entry_t * entry = cache_add_internal_no_lock(cache, key, user_data);
|
||||||
if(entry != NULL) {
|
if(entry != NULL) {
|
||||||
lv_cache_entry_acquire_data(entry);
|
lv_cache_entry_acquire_data(entry);
|
||||||
@@ -122,12 +133,22 @@ lv_cache_entry_t * lv_cache_acquire_or_create(lv_cache_t * cache, const void * k
|
|||||||
LV_ASSERT_NULL(key);
|
LV_ASSERT_NULL(key);
|
||||||
|
|
||||||
lv_mutex_lock(&cache->lock);
|
lv_mutex_lock(&cache->lock);
|
||||||
lv_cache_entry_t * entry = cache->clz->get_cb(cache, key, user_data);
|
lv_cache_entry_t * entry = NULL;
|
||||||
if(entry != NULL) {
|
|
||||||
lv_cache_entry_acquire_data(entry);
|
if(cache->size != 0) {
|
||||||
lv_mutex_unlock(&cache->lock);
|
entry = cache->clz->get_cb(cache, key, user_data);
|
||||||
return entry;
|
if(entry != NULL) {
|
||||||
|
lv_cache_entry_acquire_data(entry);
|
||||||
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cache->max_size == 0) {
|
||||||
|
lv_mutex_unlock(&cache->lock);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
entry = cache_add_internal_no_lock(cache, key, user_data);
|
entry = cache_add_internal_no_lock(cache, key, user_data);
|
||||||
if(entry == NULL) {
|
if(entry == NULL) {
|
||||||
lv_mutex_unlock(&cache->lock);
|
lv_mutex_unlock(&cache->lock);
|
||||||
@@ -203,6 +224,10 @@ size_t lv_cache_get_free_size(lv_cache_t * cache, void * user_data)
|
|||||||
LV_UNUSED(user_data);
|
LV_UNUSED(user_data);
|
||||||
return cache->max_size - cache->size;
|
return cache->max_size - cache->size;
|
||||||
}
|
}
|
||||||
|
bool lv_cache_is_enabled(lv_cache_t * cache)
|
||||||
|
{
|
||||||
|
return cache->max_size > 0;
|
||||||
|
}
|
||||||
void lv_cache_set_compare_cb(lv_cache_t * cache, lv_cache_compare_cb_t compare_cb, void * user_data)
|
void lv_cache_set_compare_cb(lv_cache_t * cache, lv_cache_compare_cb_t compare_cb, void * user_data)
|
||||||
{
|
{
|
||||||
LV_UNUSED(user_data);
|
LV_UNUSED(user_data);
|
||||||
|
|||||||
9
src/misc/cache/lv_cache.h
vendored
9
src/misc/cache/lv_cache.h
vendored
@@ -137,6 +137,7 @@ bool lv_cache_evict_one(lv_cache_t * cache, void * user_data);
|
|||||||
/**
|
/**
|
||||||
* Set the maximum size of the cache.
|
* Set the maximum size of the cache.
|
||||||
* If the current cache size is greater than the new maximum size, the cache's policy will be used to evict entries until the new maximum size is reached.
|
* If the current cache size is greater than the new maximum size, the cache's policy will be used to evict entries until the new maximum size is reached.
|
||||||
|
* If set to 0, the cache will be disabled.
|
||||||
* @note But this behavior will happen only new entries are added to the cache.
|
* @note But this behavior will happen only new entries are added to the cache.
|
||||||
* @param cache The cache object pointer to set the maximum size.
|
* @param cache The cache object pointer to set the maximum size.
|
||||||
* @param max_size The new maximum size of the cache.
|
* @param max_size The new maximum size of the cache.
|
||||||
@@ -168,6 +169,14 @@ size_t lv_cache_get_size(lv_cache_t * cache, void * user_data);
|
|||||||
*/
|
*/
|
||||||
size_t lv_cache_get_free_size(lv_cache_t * cache, void * user_data);
|
size_t lv_cache_get_free_size(lv_cache_t * cache, void * user_data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the cache is enabled.
|
||||||
|
* Disabled cache means that when the max_size of the cache is 0. In this case, all cache operations will be no-op.
|
||||||
|
* @param cache The cache object pointer to check if it's disabled.
|
||||||
|
* @return Returns true if the cache is enabled, false otherwise.
|
||||||
|
*/
|
||||||
|
bool lv_cache_is_enabled(lv_cache_t * cache);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the compare callback of the cache.
|
* Set the compare callback of the cache.
|
||||||
* @param cache The cache object pointer to set the compare callback.
|
* @param cache The cache object pointer to set the compare callback.
|
||||||
|
|||||||
26
src/misc/cache/lv_image_cache.c
vendored
26
src/misc/cache/lv_image_cache.c
vendored
@@ -6,14 +6,12 @@
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
#include "../lv_assert.h"
|
#include "../lv_assert.h"
|
||||||
#include "lv_image_header_cache.h"
|
#include "../../core/lv_global.h"
|
||||||
|
|
||||||
#include "lv_image_cache.h"
|
#include "lv_image_cache.h"
|
||||||
|
#include "lv_image_header_cache.h"
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
|
|
||||||
#include "../../core/lv_global.h"
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -49,14 +47,14 @@ static void image_cache_free_cb(lv_image_cache_data_t * entry, void * user_data)
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
lv_result_t lv_image_cache_init(void)
|
lv_result_t lv_image_cache_init(uint32_t size)
|
||||||
{
|
{
|
||||||
if(img_cache_p != NULL) {
|
if(img_cache_p != NULL) {
|
||||||
return LV_RESULT_OK;
|
return LV_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
img_cache_p = lv_cache_create(&lv_cache_class_lru_rb_size,
|
img_cache_p = lv_cache_create(&lv_cache_class_lru_rb_size,
|
||||||
sizeof(lv_image_cache_data_t), LV_CACHE_DEF_SIZE, (lv_cache_ops_t) {
|
sizeof(lv_image_cache_data_t), size, (lv_cache_ops_t) {
|
||||||
.compare_cb = (lv_cache_compare_cb_t) image_cache_compare_cb,
|
.compare_cb = (lv_cache_compare_cb_t) image_cache_compare_cb,
|
||||||
.create_cb = NULL,
|
.create_cb = NULL,
|
||||||
.free_cb = (lv_cache_free_cb_t) image_cache_free_cb,
|
.free_cb = (lv_cache_free_cb_t) image_cache_free_cb,
|
||||||
@@ -72,14 +70,11 @@ void lv_image_cache_resize(uint32_t new_size, bool evict_now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void lv_image_cache_drop(const void * src)
|
void lv_image_cache_drop(const void * src)
|
||||||
{
|
{
|
||||||
/*If user invalidate image, the header cache should be invalidated too.*/
|
/*If user invalidate image, the header cache should be invalidated too.*/
|
||||||
lv_image_header_cache_drop(src);
|
lv_image_header_cache_drop(src);
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
if(src == NULL) {
|
if(src == NULL) {
|
||||||
lv_cache_drop_all(img_cache_p, NULL);
|
lv_cache_drop_all(img_cache_p, NULL);
|
||||||
return;
|
return;
|
||||||
@@ -91,17 +86,17 @@ void lv_image_cache_drop(const void * src)
|
|||||||
};
|
};
|
||||||
|
|
||||||
lv_cache_drop(img_cache_p, &search_key, NULL);
|
lv_cache_drop(img_cache_p, &search_key, NULL);
|
||||||
#else
|
}
|
||||||
LV_UNUSED(src);
|
|
||||||
#endif
|
bool lv_image_cache_is_enabled(void)
|
||||||
|
{
|
||||||
|
return lv_cache_is_enabled(img_cache_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
|
|
||||||
inline static lv_cache_compare_res_t image_cache_common_compare(const void * lhs_src, lv_image_src_t lhs_src_type,
|
inline static lv_cache_compare_res_t image_cache_common_compare(const void * lhs_src, lv_image_src_t lhs_src_type,
|
||||||
const void * rhs_src, lv_image_src_t rhs_src_type)
|
const void * rhs_src, lv_image_src_t rhs_src_type)
|
||||||
{
|
{
|
||||||
@@ -142,4 +137,3 @@ static void image_cache_free_cb(lv_image_cache_data_t * entry, void * user_data)
|
|||||||
/*Free the duplicated file name*/
|
/*Free the duplicated file name*/
|
||||||
if(entry->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)entry->src);
|
if(entry->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)entry->src);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
14
src/misc/cache/lv_image_cache.h
vendored
14
src/misc/cache/lv_image_cache.h
vendored
@@ -17,8 +17,6 @@ extern "C" {
|
|||||||
#include "../../lv_conf_internal.h"
|
#include "../../lv_conf_internal.h"
|
||||||
#include "../lv_types.h"
|
#include "../lv_types.h"
|
||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -33,25 +31,31 @@ extern "C" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize image cache.
|
* Initialize image cache.
|
||||||
|
* @param size size of the cache in bytes.
|
||||||
* @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed.
|
* @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed.
|
||||||
*/
|
*/
|
||||||
lv_result_t lv_image_cache_init(void);
|
lv_result_t lv_image_cache_init(uint32_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize image cache.
|
* Resize image cache.
|
||||||
|
* If set to 0, the cache will be disabled.
|
||||||
* @param new_size new size of the cache in bytes.
|
* @param new_size new size of the cache in bytes.
|
||||||
* @param evict_now true: evict the images should be removed by the eviction policy, false: wait for the next cache cleanup.
|
* @param evict_now true: evict the images should be removed by the eviction policy, false: wait for the next cache cleanup.
|
||||||
*/
|
*/
|
||||||
void lv_image_cache_resize(uint32_t new_size, bool evict_now);
|
void lv_image_cache_resize(uint32_t new_size, bool evict_now);
|
||||||
|
|
||||||
#endif /*LV_CACHE_DEF_SIZE > 0*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate image cache. Use NULL to invalidate all images.
|
* Invalidate image cache. Use NULL to invalidate all images.
|
||||||
* @param src pointer to an image source.
|
* @param src pointer to an image source.
|
||||||
*/
|
*/
|
||||||
void lv_image_cache_drop(const void * src);
|
void lv_image_cache_drop(const void * src);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the image cache is enabled.
|
||||||
|
* @return true: enabled, false: disabled.
|
||||||
|
*/
|
||||||
|
bool lv_image_cache_is_enabled(void);
|
||||||
|
|
||||||
/*************************
|
/*************************
|
||||||
* GLOBAL VARIABLES
|
* GLOBAL VARIABLES
|
||||||
*************************/
|
*************************/
|
||||||
|
|||||||
33
src/misc/cache/lv_image_header_cache.c
vendored
33
src/misc/cache/lv_image_header_cache.c
vendored
@@ -6,13 +6,12 @@
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
#include "../lv_assert.h"
|
#include "../lv_assert.h"
|
||||||
#include "lv_image_header_cache.h"
|
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
|
|
||||||
#include "../../core/lv_global.h"
|
#include "../../core/lv_global.h"
|
||||||
|
|
||||||
|
#include "lv_image_header_cache.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -47,14 +46,14 @@ static void image_header_cache_free_cb(lv_image_header_cache_data_t * entry, voi
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
lv_result_t lv_image_header_cache_init(void)
|
lv_result_t lv_image_header_cache_init(uint32_t count)
|
||||||
{
|
{
|
||||||
if(img_header_cache_p != NULL) {
|
if(img_header_cache_p != NULL) {
|
||||||
return LV_RESULT_OK;
|
return LV_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
img_header_cache_p = lv_cache_create(&lv_cache_class_lru_rb_count,
|
img_header_cache_p = lv_cache_create(&lv_cache_class_lru_rb_count,
|
||||||
sizeof(lv_image_header_cache_data_t), LV_IMAGE_HEADER_CACHE_DEF_CNT, (lv_cache_ops_t) {
|
sizeof(lv_image_header_cache_data_t), count, (lv_cache_ops_t) {
|
||||||
.compare_cb = (lv_cache_compare_cb_t) image_header_cache_compare_cb,
|
.compare_cb = (lv_cache_compare_cb_t) image_header_cache_compare_cb,
|
||||||
.create_cb = NULL,
|
.create_cb = NULL,
|
||||||
.free_cb = (lv_cache_free_cb_t) image_header_cache_free_cb
|
.free_cb = (lv_cache_free_cb_t) image_header_cache_free_cb
|
||||||
@@ -63,19 +62,16 @@ lv_result_t lv_image_header_cache_init(void)
|
|||||||
return img_header_cache_p != NULL ? LV_RESULT_OK : LV_RESULT_INVALID;
|
return img_header_cache_p != NULL ? LV_RESULT_OK : LV_RESULT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_image_header_cache_resize(uint32_t new_size, bool evict_now)
|
void lv_image_header_cache_resize(uint32_t count, bool evict_now)
|
||||||
{
|
{
|
||||||
lv_cache_set_max_size(img_header_cache_p, new_size, NULL);
|
lv_cache_set_max_size(img_header_cache_p, count, NULL);
|
||||||
if(evict_now) {
|
if(evict_now) {
|
||||||
lv_cache_reserve(img_header_cache_p, new_size, NULL);
|
lv_cache_reserve(img_header_cache_p, count, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void lv_image_header_cache_drop(const void * src)
|
void lv_image_header_cache_drop(const void * src)
|
||||||
{
|
{
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
if(src == NULL) {
|
if(src == NULL) {
|
||||||
lv_cache_drop_all(img_header_cache_p, NULL);
|
lv_cache_drop_all(img_header_cache_p, NULL);
|
||||||
return;
|
return;
|
||||||
@@ -87,18 +83,17 @@ void lv_image_header_cache_drop(const void * src)
|
|||||||
};
|
};
|
||||||
|
|
||||||
lv_cache_drop(img_header_cache_p, &search_key, NULL);
|
lv_cache_drop(img_header_cache_p, &search_key, NULL);
|
||||||
#else
|
}
|
||||||
LV_UNUSED(src);
|
|
||||||
#endif
|
bool lv_image_header_cache_is_enabled(void)
|
||||||
|
{
|
||||||
|
return lv_cache_is_enabled(img_header_cache_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
|
|
||||||
inline static lv_cache_compare_res_t image_cache_common_compare(const void * lhs_src, lv_image_src_t lhs_src_type,
|
inline static lv_cache_compare_res_t image_cache_common_compare(const void * lhs_src, lv_image_src_t lhs_src_type,
|
||||||
const void * rhs_src, lv_image_src_t rhs_src_type)
|
const void * rhs_src, lv_image_src_t rhs_src_type)
|
||||||
{
|
{
|
||||||
@@ -132,5 +127,3 @@ static void image_header_cache_free_cb(lv_image_header_cache_data_t * entry, voi
|
|||||||
|
|
||||||
if(entry->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)entry->src);
|
if(entry->src_type == LV_IMAGE_SRC_FILE) lv_free((void *)entry->src);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
18
src/misc/cache/lv_image_header_cache.h
vendored
18
src/misc/cache/lv_image_header_cache.h
vendored
@@ -17,8 +17,6 @@ extern "C" {
|
|||||||
#include "../../lv_conf_internal.h"
|
#include "../../lv_conf_internal.h"
|
||||||
#include "../lv_types.h"
|
#include "../lv_types.h"
|
||||||
|
|
||||||
#if LV_IMAGE_HEADER_CACHE_DEF_CNT > 0
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -33,18 +31,18 @@ extern "C" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize image header cache.
|
* Initialize image header cache.
|
||||||
|
* @param count initial size of the cache in count of image headers.
|
||||||
* @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed.
|
* @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed.
|
||||||
*/
|
*/
|
||||||
lv_result_t lv_image_header_cache_init(void);
|
lv_result_t lv_image_header_cache_init(uint32_t count);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize image header cache.
|
* Resize image header cache.
|
||||||
* @param new_size new size of the cache in count of image headers.
|
* If set to 0, the cache is disabled.
|
||||||
|
* @param count new max count of cached image headers.
|
||||||
* @param evict_now true: evict the image headers should be removed by the eviction policy, false: wait for the next cache cleanup.
|
* @param evict_now true: evict the image headers should be removed by the eviction policy, false: wait for the next cache cleanup.
|
||||||
*/
|
*/
|
||||||
void lv_image_header_cache_resize(uint32_t new_size, bool evict_now);
|
void lv_image_header_cache_resize(uint32_t count, bool evict_now);
|
||||||
|
|
||||||
#endif /*LV_IMAGE_HEADER_CACHE_DEF_CNT > 0*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate image header cache. Use NULL to invalidate all image headers.
|
* Invalidate image header cache. Use NULL to invalidate all image headers.
|
||||||
@@ -53,6 +51,12 @@ void lv_image_header_cache_resize(uint32_t new_size, bool evict_now);
|
|||||||
*/
|
*/
|
||||||
void lv_image_header_cache_drop(const void * src);
|
void lv_image_header_cache_drop(const void * src);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the image header cache is enabled.
|
||||||
|
* @return true: enabled, false: disabled.
|
||||||
|
*/
|
||||||
|
bool lv_image_header_cache_is_enabled(void);
|
||||||
|
|
||||||
/*************************
|
/*************************
|
||||||
* GLOBAL VARIABLES
|
* GLOBAL VARIABLES
|
||||||
*************************/
|
*************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user