feat(decoder): do not even try cache if 'no_cache' is set (#5688)
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -123,10 +123,13 @@ lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src
|
|||||||
|
|
||||||
#if LV_CACHE_DEF_SIZE > 0
|
#if LV_CACHE_DEF_SIZE > 0
|
||||||
dsc->cache = img_cache_p;
|
dsc->cache = img_cache_p;
|
||||||
/*
|
/*Try cache first, unless we are told to ignore cache.*/
|
||||||
* Check the cache first
|
if(!(args && args->no_cache)) {
|
||||||
* If the image is found in the cache, just return it.*/
|
/*
|
||||||
if(try_cache(dsc) == LV_RESULT_OK) return LV_RESULT_OK;
|
* Check the cache first
|
||||||
|
* If the image is found in the cache, just return it.*/
|
||||||
|
if(try_cache(dsc) == LV_RESULT_OK) return LV_RESULT_OK;
|
||||||
|
}
|
||||||
#endif
|
#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.*/
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ typedef struct _lv_image_decoder_dsc_t lv_image_decoder_dsc_t;
|
|||||||
typedef struct _lv_image_decoder_args_t {
|
typedef struct _lv_image_decoder_args_t {
|
||||||
bool stride_align; /*Whether stride should be aligned*/
|
bool stride_align; /*Whether stride should be aligned*/
|
||||||
bool premultiply; /*Whether image should be premultiplied or not after decoding*/
|
bool premultiply; /*Whether image should be premultiplied or not after decoding*/
|
||||||
bool no_cache; /*Whether this image should be kept out of cache*/
|
bool no_cache; /*When set, decoded image won't be put to cache, and decoder open will also ignore cache.*/
|
||||||
bool use_indexed; /*Decoded indexed image as is. Convert to ARGB8888 if false.*/
|
bool use_indexed; /*Decoded indexed image as is. Convert to ARGB8888 if false.*/
|
||||||
} lv_image_decoder_args_t;
|
} lv_image_decoder_args_t;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user