summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeather Lee Wilson <hwilson@google.com>2014-11-14 21:26:51 +0100
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-14 21:26:51 +0100
commitde27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0 (patch)
tree9d9b795c440b82bee110d8088e0e2790882ab5f1
parentam be81e51c: Use more aggressive sync writing to applypatch. (diff)
parentByte swap to support BGRA in recovery mode (diff)
downloadandroid_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.tar
android_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.tar.gz
android_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.tar.bz2
android_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.tar.lz
android_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.tar.xz
android_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.tar.zst
android_bootable_recovery-de27d4cbb75a9c2f5ad0fc24edf5295d0f3d9fe0.zip
Diffstat (limited to '')
-rw-r--r--minui/graphics_fbdev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/minui/graphics_fbdev.c b/minui/graphics_fbdev.c
index c0c1bcb1a..6df2726f5 100644
--- a/minui/graphics_fbdev.c
+++ b/minui/graphics_fbdev.c
@@ -179,6 +179,18 @@ static gr_surface fbdev_init(minui_backend* backend) {
static gr_surface fbdev_flip(minui_backend* backend __unused) {
if (double_buffered) {
+#if defined(RECOVERY_BGRA)
+ // In case of BGRA, do some byte swapping
+ unsigned int idx;
+ unsigned char tmp;
+ unsigned char* ucfb_vaddr = (unsigned char*)gr_draw->data;
+ for (idx = 0 ; idx < (gr_draw->height * gr_draw->row_bytes);
+ idx += 4) {
+ tmp = ucfb_vaddr[idx];
+ ucfb_vaddr[idx ] = ucfb_vaddr[idx + 2];
+ ucfb_vaddr[idx + 2] = tmp;
+ }
+#endif
// Change gr_draw to point to the buffer currently displayed,
// then flip the driver so we're displaying the other buffer
// instead.