1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(refr): swap buffers only on the last area with direct mode (#2867)

* fix(refr): avoid swapping buffers every area in direct mode

* Update src/core/lv_refr.c

* Update src/core/lv_refr.c

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Gavin Li 2021-12-03 00:45:05 -08:00 committed by GitHub
parent 29a9cd7257
commit 222af5ad4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -979,7 +979,8 @@ static void draw_buf_flush(void)
call_flush_cb(disp->driver, &draw_buf->area, color_p);
}
}
if(draw_buf->buf1 && draw_buf->buf2) {
/*If there are 2 buffers swap them. With direct mode swap only on the last area*/
if(draw_buf->buf1 && draw_buf->buf2 && (!disp->driver->direct_mode || draw_buf->flushing_last)) {
if(draw_buf->buf_act == draw_buf->buf1)
draw_buf->buf_act = draw_buf->buf2;
else