summaryrefslogtreecommitdiffstats
path: root/modules/gralloc
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2014-02-21 01:38:44 +0530
committerAmit Pundir <amit.pundir@linaro.org>2014-02-21 19:28:56 +0530
commit5e3ac6bc7138e92fa04d7425a2a2535b9ae0e44a (patch)
tree1ab0b0b07cd9c83fbf3b5d0c1366dff5324e07d6 /modules/gralloc
parent80d4eced69f4d1e9f9ef97b5f4f26868cd76ae26 (diff)
downloadhardware_libhardware-5e3ac6bc7138e92fa04d7425a2a2535b9ae0e44a.zip
hardware_libhardware-5e3ac6bc7138e92fa04d7425a2a2535b9ae0e44a.tar.gz
hardware_libhardware-5e3ac6bc7138e92fa04d7425a2a2535b9ae0e44a.tar.bz2
gralloc: dont hardcode 32bpp as RGBX
Not every 32bpp is in RGBX format. Change-Id: Ic3c6a0cbf475bff2fe2fc4b023c6bc58e4fc295e Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'modules/gralloc')
-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 326f2ae..9d8513a 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;