fix(draw_buf): dup a draw buffer should dup its flags too (#5101)

Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu
2023-12-29 01:16:07 +08:00
committed by GitHub
parent 88837a1df6
commit 240d9a3cb1

View File

@@ -180,6 +180,9 @@ lv_draw_buf_t * lv_draw_buf_dup(const lv_draw_buf_t * draw_buf)
lv_draw_buf_t * new_buf = lv_draw_buf_create(header->w, header->h, header->cf, header->stride);
if(new_buf == NULL) return NULL;
new_buf->header.flags = draw_buf->header.flags;
new_buf->header.flags |= LV_IMAGE_FLAGS_MODIFIABLE | LV_IMAGE_FLAGS_ALLOCATED;
/*Choose the smaller size to copy*/
uint32_t size = LV_MIN(draw_buf->data_size, new_buf->data_size);