diff options
-rw-r--r-- | modules/gralloc/framebuffer.cpp | 12 |
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 |