summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2011-11-23 11:24:12 +0059
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-11-14 00:50:28 +0100
commit87ce0b0a67f7f5827a07cf53173c8efd5f457629 (patch)
treeec5a5a5f7b6491e828267b776a5e6f7ab709d344
parent2e760d975e67a7f0bde74364208efa5fcce8a1e2 (diff)
downloadlibhardware-87ce0b0a67f7f5827a07cf53173c8efd5f457629.tar.gz
gralloc: Fix inverted colors on BRGA
Don't assume any 32bpp mode is RGBX. This is a forward-port of commit f50b075a8b88eff482628e8ab62a04539117c7ea Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r--modules/gralloc/framebuffer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index e0831df0..a1ded497 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -330,7 +330,7 @@ int fb_device_open(hw_module_t const* module, const char* name,
if (status >= 0) {
int stride = m->finfo.line_length / (m->info.bits_per_pixel >> 3);
int format = (m->info.bits_per_pixel == 32)
- ? HAL_PIXEL_FORMAT_RGBX_8888
+ ? (m->info.red.offset ? HAL_PIXEL_FORMAT_BGRA_8888 : HAL_PIXEL_FORMAT_RGBX_8888)
: HAL_PIXEL_FORMAT_RGB_565;
const_cast<uint32_t&>(dev->device.flags) = 0;
const_cast<uint32_t&>(dev->device.width) = m->info.xres;