summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2011-09-15 21:46:50 +0400
committerVishal Bhoj <vishal.bhoj@linaro.org>2011-09-15 21:46:50 +0400
commitf50b075a8b88eff482628e8ab62a04539117c7ea (patch)
treeaf54f515972757e1dff1fbe5d9a8d2a168e51c56
parentd9c30e622a7c1bfd7fa941434101cd34d185780c (diff)
downloadlibhardware-linaro_android_2.3.7.tar.gz
Botao's code change to fix inverted colorslinaro_android_2.3.7linaro_android_2.3.5
Change-Id: I19f4db0fedd1f1e4aeeab60e06320877bb9e7dee
-rw-r--r--modules/gralloc/framebuffer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index 9d7709d4..b4e5bf04 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -354,9 +354,15 @@ int fb_device_open(hw_module_t const* module, const char* name,
status = mapFrameBuffer(m);
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
- : HAL_PIXEL_FORMAT_RGB_565;
+ // int format = (m->info.bits_per_pixel == 32);
+ int format;
+ if (m->info.bits_per_pixel == 32)
+ if (m->info.red.offset == 0)
+ format = HAL_PIXEL_FORMAT_RGBX_8888;
+ else
+ format = HAL_PIXEL_FORMAT_BGRA_8888;
+ else
+ format = HAL_PIXEL_FORMAT_RGB_565;
#ifdef NO_32BPP
format = HAL_PIXEL_FORMAT_RGB_565;
#endif