From 43e2da7d0f61266b777d735e89c9df2f55084e1d Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 6 Mar 2023 06:07:13 +0100 Subject: [PATCH] fix(disp): fix comments related to https://github.com/lvgl/lvgl/issues/4011#issuecomment-1455199216 --- src/core/lv_disp.h | 12 ++++++------ src/core/lv_disp_private.h | 2 +- src/dev/sdl/lv_sdl_window.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/lv_disp.h b/src/core/lv_disp.h index e20ced6c1..d5c2718d5 100644 --- a/src/core/lv_disp.h +++ b/src/core/lv_disp.h @@ -233,13 +233,13 @@ lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp); /** * Set the buffers for a display - * @param disp pointer to a display - * @param buf1 first buffer - * @param buf2 second buffer (can be `NULL`) - * @param buf_size_px size of the buffer in pixels - * @param render_mode LV_DISP_RENDER_MODE_PARTIAL/DIRECT/FULL + * @param disp pointer to a display + * @param buf1 first buffer + * @param buf2 second buffer (can be `NULL`) + * @param buf_size_byte size of the buffer in bytes + * @param render_mode LV_DISP_RENDER_MODE_PARTIAL/DIRECT/FULL */ -void lv_disp_set_draw_buffers(lv_disp_t * disp, void * buf1, void * buf2, uint32_t buf_size_px, +void lv_disp_set_draw_buffers(lv_disp_t * disp, void * buf1, void * buf2, uint32_t buf_size_byte, lv_disp_render_mode_t render_mode); /** diff --git a/src/core/lv_disp_private.h b/src/core/lv_disp_private.h index 3e6056ff4..90059302b 100644 --- a/src/core/lv_disp_private.h +++ b/src/core/lv_disp_private.h @@ -65,7 +65,7 @@ typedef struct _lv_disp_t { /** Internal, used by the library*/ void * draw_buf_act; - /** In pixel count*/ + /** In byte count*/ uint32_t draw_buf_size; /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_disp_flush_ready()' has to be diff --git a/src/dev/sdl/lv_sdl_window.c b/src/dev/sdl/lv_sdl_window.c index c57ca3c99..6d5efba3e 100644 --- a/src/dev/sdl/lv_sdl_window.c +++ b/src/dev/sdl/lv_sdl_window.c @@ -86,7 +86,7 @@ lv_disp_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res) lv_disp_set_flush_cb(disp, flush_cb); lv_disp_set_draw_buffers(disp, dsc->fb, NULL, - lv_disp_get_hor_res(disp) * lv_disp_get_hor_res(disp), LV_DISP_RENDER_MODE_DIRECT); + lv_disp_get_hor_res(disp) * lv_disp_get_hor_res(disp) * sizeof(lv_color_t), LV_DISP_RENDER_MODE_DIRECT); lv_disp_add_event(disp, res_chg_event_cb, LV_EVENT_RESOLUTION_CHANGED, NULL); return disp;