1、在/hardware/libhardware/modules/gralloc/framebuffer.cpp中的
fb_device_open(hw_module_t const* module, const char* name,hw_device_t** device)中改动
// 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) ? HAL_PIXEL_FORMAT_BGRA_8888 : HAL_PIXEL_FORMAT_RGB_565;
当framebuffer是32位色深时选择HAL_PIXEL_FORMAT_BGRA_8888格式;