feat(draw): add initial SDL renderer

It caches SW rendered bitmaps in textures.
The cache is also updated to support data and source separately.
E.g. source is a path to an image, and if that image changes all
related cache entries needs to found and invalidated.

Limitations of SDL rederer:
- not all draw task types are supported
- image transformation is not supported
- some textures (e.g. button matrix texts) are not detected as cached
- images are not cached
- images are supported only from path
This commit is contained in:
Gabor Kiss-Vamosi
2023-11-18 15:33:58 +01:00
parent cd6b4db6e8
commit 2f3e8d4066
58 changed files with 1049 additions and 282 deletions

View File

@@ -225,7 +225,7 @@ static void draw_vector(lv_layer_t * layer)
void lv_demo_vector_graphic(void)
{
static uint8_t canvas_buf[WIDTH * HEIGHT * 4];
static uint8_t canvas_buf[LV_CANVAS_BUF_SIZE(WIDTH, HEIGHT, 32, LV_DRAW_BUF_STRIDE_ALIGN)];
lv_obj_t * canvas = lv_canvas_create(lv_scr_act());
lv_canvas_set_buffer(canvas, canvas_buf, WIDTH, HEIGHT, LV_COLOR_FORMAT_ARGB8888);

View File

@@ -249,6 +249,7 @@ static void profile_create(lv_obj_t * parent)
LV_IMAGE_DECLARE(img_demo_widgets_avatar);
lv_obj_t * avatar = lv_image_create(panel1);
lv_image_set_src(avatar, &img_demo_widgets_avatar);
// lv_image_set_src(avatar, "A:lvgl/demos/widgets/assets/avatar.png")
lv_obj_t * name = lv_label_create(panel1);
lv_label_set_text(name, "Elena Smith");