Lines Matching refs:cached_src
66 _lv_img_cache_entry_t * cached_src = NULL; in _lv_img_cache_open() local
91 cached_src = &cache[i]; in _lv_img_cache_open()
92 cached_src->life += cached_src->dec_dsc.time_to_open * LV_IMG_CACHE_LIFE_GAIN; in _lv_img_cache_open()
93 … if(cached_src->life > LV_IMG_CACHE_LIFE_LIMIT) cached_src->life = LV_IMG_CACHE_LIFE_LIMIT; in _lv_img_cache_open()
100 if(cached_src) return cached_src; in _lv_img_cache_open()
103 cached_src = &cache[0]; in _lv_img_cache_open()
105 if(cache[i].life < cached_src->life) { in _lv_img_cache_open()
106 cached_src = &cache[i]; in _lv_img_cache_open()
111 if(cached_src->dec_dsc.src) { in _lv_img_cache_open()
112 lv_img_decoder_close(&cached_src->dec_dsc); in _lv_img_cache_open()
119 cached_src = &LV_GC_ROOT(_lv_img_cache_single); in _lv_img_cache_open()
123 lv_res_t open_res = lv_img_decoder_open(&cached_src->dec_dsc, src, color, frame_id); in _lv_img_cache_open()
126 lv_memset_00(cached_src, sizeof(_lv_img_cache_entry_t)); in _lv_img_cache_open()
127 cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its us*/ in _lv_img_cache_open()
131 cached_src->life = 0; in _lv_img_cache_open()
134 if(cached_src->dec_dsc.time_to_open == 0) { in _lv_img_cache_open()
135 cached_src->dec_dsc.time_to_open = lv_tick_elaps(t_start); in _lv_img_cache_open()
138 if(cached_src->dec_dsc.time_to_open == 0) cached_src->dec_dsc.time_to_open = 1; in _lv_img_cache_open()
140 return cached_src; in _lv_img_cache_open()