summaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
authorDaniel Leung <daniel.leung@intel.com>2014-03-19 13:41:31 -0700
committerYong Yao <yong.yao@intel.com>2014-05-13 15:00:40 -0700
commitf766396d9931e1879161132c26fe61453065f450 (patch)
treebe7ff11548d114f7cfcaad087277579a5aad8f5d /minui
parent74b90b309f67dc3b8bb74e47c4eddf7ce511bc35 (diff)
downloadbootable_recovery-f766396d9931e1879161132c26fe61453065f450.zip
bootable_recovery-f766396d9931e1879161132c26fe61453065f450.tar.gz
bootable_recovery-f766396d9931e1879161132c26fe61453065f450.tar.bz2
Support BGRA framebuffer
The re-designed recovery graphics code only supports RGB{_,X,A} framebuffer, and this patch adds support for BGRA framebuffer. Change-Id: I3780c8288088f497fa248f3492c54f43834a8598 Signed-off-by: Daniel Leung <daniel.leung@intel.com> Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com> Reviewed-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com> Tested-by: Parkinson, TimothyX L <timothyx.l.parkinson@intel.com> Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com> Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
Diffstat (limited to 'minui')
-rw-r--r--minui/graphics_fbdev.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/minui/graphics_fbdev.c b/minui/graphics_fbdev.c
index bb91975..a91ea87 100644
--- a/minui/graphics_fbdev.c
+++ b/minui/graphics_fbdev.c
@@ -184,8 +184,21 @@ static gr_surface fbdev_flip(minui_backend* backend __unused) {
set_displayed_framebuffer(1-displayed_buffer);
} else {
// 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,
gr_draw->height * gr_draw->row_bytes);
+#endif
}
return gr_draw;
}