6#ifndef LV_DRAW_SDL_TEXTURE_CACHE_H
7#define LV_DRAW_SDL_TEXTURE_CACHE_H
21#include LV_GPU_SDL_INCLUDE_PATH
31#define LV_DRAW_SDL_DEC_DSC_TEXTURE_HEAD "@LVSDLTex"
39 SDL_Texture * texture;
42 bool texture_referenced;
43} lv_draw_sdl_dec_dsc_userdata_t;
46 LV_GPU_CACHE_KEY_MAGIC_ARC = 0x01,
47 LV_GPU_CACHE_KEY_MAGIC_IMG = 0x11,
48 LV_GPU_CACHE_KEY_MAGIC_IMG_ROUNDED_CORNERS = 0x12,
49 LV_GPU_CACHE_KEY_MAGIC_LINE = 0x21,
50 LV_GPU_CACHE_KEY_MAGIC_RECT_BG = 0x31,
51 LV_GPU_CACHE_KEY_MAGIC_RECT_SHADOW = 0x32,
52 LV_GPU_CACHE_KEY_MAGIC_RECT_BORDER = 0x33,
53 LV_GPU_CACHE_KEY_MAGIC_RECT_GRAD = 0x34,
54 LV_GPU_CACHE_KEY_MAGIC_FONT_GLYPH = 0x41,
55 LV_GPU_CACHE_KEY_MAGIC_MASK = 0x51,
56} lv_sdl_cache_key_magic_t;
59 LV_DRAW_SDL_CACHE_FLAG_NONE = 0,
60 LV_DRAW_SDL_CACHE_FLAG_MANAGED = 1,
61} lv_draw_sdl_cache_flag_t;
64 lv_sdl_cache_key_magic_t magic;
67} lv_draw_sdl_cache_key_head_img_t;
73void lv_draw_sdl_texture_cache_init(lv_draw_sdl_ctx_t * ctx);
75void lv_draw_sdl_texture_cache_deinit(lv_draw_sdl_ctx_t * ctx);
80SDL_Texture * lv_draw_sdl_texture_cache_get(lv_draw_sdl_ctx_t * ctx,
const void * key,
size_t key_length,
bool * found);
82SDL_Texture * lv_draw_sdl_texture_cache_get_with_userdata(lv_draw_sdl_ctx_t * ctx,
const void * key,
size_t key_length,
83 bool * found,
void ** userdata);
85void lv_draw_sdl_texture_cache_put(lv_draw_sdl_ctx_t * ctx,
const void * key,
size_t key_length, SDL_Texture * texture);
87void lv_draw_sdl_texture_cache_put_advanced(lv_draw_sdl_ctx_t * ctx,
const void * key,
size_t key_length,
88 SDL_Texture * texture,
void * userdata,
void userdata_free(
void *),
89 lv_draw_sdl_cache_flag_t flags);
91lv_draw_sdl_cache_key_head_img_t * lv_draw_sdl_texture_img_key_create(
const void * src, int32_t frame_id,