* commit '0766cdf49acb77677864995e931eec391243505d': Support BGRA framebuffer
This commit is contained in:
commit
eed6483638
1 changed files with 13 additions and 0 deletions
|
@ -184,8 +184,21 @@ static gr_surface fbdev_flip(minui_backend* backend __unused) {
|
||||||
set_displayed_framebuffer(1-displayed_buffer);
|
set_displayed_framebuffer(1-displayed_buffer);
|
||||||
} else {
|
} else {
|
||||||
// Copy from the in-memory surface to the framebuffer.
|
// Copy from the in-memory surface to the framebuffer.
|
||||||
|
|
||||||
|
#if defined(RECOVERY_BGRA)
|
||||||
|
unsigned int idx;
|
||||||
|
unsigned char* ucfb_vaddr = (unsigned char*)gr_framebuffer[0].data;
|
||||||
|
unsigned char* ucbuffer_vaddr = (unsigned char*)gr_draw->data;
|
||||||
|
for (idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes); idx += 4) {
|
||||||
|
ucfb_vaddr[idx ] = ucbuffer_vaddr[idx + 2];
|
||||||
|
ucfb_vaddr[idx + 1] = ucbuffer_vaddr[idx + 1];
|
||||||
|
ucfb_vaddr[idx + 2] = ucbuffer_vaddr[idx ];
|
||||||
|
ucfb_vaddr[idx + 3] = ucbuffer_vaddr[idx + 3];
|
||||||
|
}
|
||||||
|
#else
|
||||||
memcpy(gr_framebuffer[0].data, gr_draw->data,
|
memcpy(gr_framebuffer[0].data, gr_draw->data,
|
||||||
gr_draw->height * gr_draw->row_bytes);
|
gr_draw->height * gr_draw->row_bytes);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return gr_draw;
|
return gr_draw;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue