Skip to content

Commit

Permalink
[component/disp_fb] copy front to back if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
versaloon committed Oct 7, 2024
1 parent 3757ee4 commit 76dc60b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/component/ui/disp/driver/fb/vsf_disp_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ static vsf_err_t __vk_disp_fb_refresh(vk_disp_t *pthis, vk_disp_area_t *area, vo
uint_fast32_t y_end = real_area.pos.y + real_area.size.y;
void *cur_buffer = vk_disp_fb_get_back_buffer(pthis);

if ( (real_area.pos.x != 0) || (real_area.pos.y != 0)
|| (real_area.size.x != disp_fb->param.width)
|| (real_area.size.y != disp_fb->param.height)) {
void *prev_buffer = vk_disp_fb_get_front_buffer(pthis);
memcpy(cur_buffer, prev_buffer, disp_fb->fb_size);
}

for (uint_fast32_t y = real_area.pos.y; y < y_end; y++) {
memcpy((uint8_t *)cur_buffer + x_offset, disp_buff, copy_size);
disp_buff = (uint8_t *)disp_buff + copy_size;
Expand Down

0 comments on commit 76dc60b

Please sign in to comment.