feat(draw_buf): add draw_buf init API (#5132)

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
Neo Xu
2024-01-05 21:45:42 +08:00
committed by GitHub
parent 0b54a69c36
commit 1d73e73a93
4 changed files with 38 additions and 9 deletions

View File

@@ -219,10 +219,8 @@ static lv_result_t decoder_open_variable(lv_image_decoder_t * decoder, lv_image_
lv_draw_buf_t * draw_buf = lv_malloc_zeroed(sizeof(lv_draw_buf_t));
LV_ASSERT_MALLOC(draw_buf);
lv_image_header_init(&draw_buf->header, width, height, cf, stride, LV_VG_LITE_IMAGE_NO_CACHE);
lv_draw_buf_init(draw_buf, width, height, cf, stride, (void *)image_data, LV_VG_LITE_IMAGE_NO_CACHE);
dsc->decoded = draw_buf;
draw_buf->data = (void *)image_data;
draw_buf->unaligned_data = (void *)image_data;
return LV_RESULT_OK;
}