diff options
author | Mathias Agopian <mathias@google.com> | 2009-08-07 20:55:37 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-08-07 20:55:37 -0700 |
commit | 7d512e3dc37cc921a3e0e541a0476a4168310ecc (patch) | |
tree | 24b8efb7f72b48564b8b3565453743c3035ed893 | |
parent | e83629abb995cfdc49c0cd2ced2456c8eb41e73e (diff) | |
download | hardware_libhardware-7d512e3dc37cc921a3e0e541a0476a4168310ecc.zip hardware_libhardware-7d512e3dc37cc921a3e0e541a0476a4168310ecc.tar.gz hardware_libhardware-7d512e3dc37cc921a3e0e541a0476a4168310ecc.tar.bz2 |
add support for RGBX_8888
-rw-r--r-- | include/hardware/copybit.h | 2 | ||||
-rw-r--r-- | include/hardware/hardware.h | 2 | ||||
-rw-r--r-- | modules/gralloc/gralloc.cpp | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/include/hardware/copybit.h b/include/hardware/copybit.h index 833aa32..556ccfa 100644 --- a/include/hardware/copybit.h +++ b/include/hardware/copybit.h @@ -40,6 +40,8 @@ __BEGIN_DECLS */ enum { COPYBIT_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, + COPYBIT_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, + COPYBIT_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, COPYBIT_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, COPYBIT_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, COPYBIT_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, diff --git a/include/hardware/hardware.h b/include/hardware/hardware.h index 27a4156..4d34852 100644 --- a/include/hardware/hardware.h +++ b/include/hardware/hardware.h @@ -121,6 +121,8 @@ int hw_get_module(const char *id, const struct hw_module_t **module); enum { HAL_PIXEL_FORMAT_RGBA_8888 = 1, + HAL_PIXEL_FORMAT_RGBX_8888 = 2, + HAL_PIXEL_FORMAT_RGB_888 = 3, HAL_PIXEL_FORMAT_RGB_565 = 4, HAL_PIXEL_FORMAT_BGRA_8888 = 5, HAL_PIXEL_FORMAT_RGBA_5551 = 6, diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp index 54aa64c..d936cd3 100644 --- a/modules/gralloc/gralloc.cpp +++ b/modules/gralloc/gralloc.cpp @@ -369,9 +369,13 @@ static int gralloc_alloc(alloc_device_t* dev, int bpp = 0; switch (format) { case HAL_PIXEL_FORMAT_RGBA_8888: + case HAL_PIXEL_FORMAT_RGBX_8888: case HAL_PIXEL_FORMAT_BGRA_8888: bpp = 4; break; + case HAL_PIXEL_FORMAT_RGB_888: + bpp = 3; + break; case HAL_PIXEL_FORMAT_RGB_565: case HAL_PIXEL_FORMAT_RGBA_5551: case HAL_PIXEL_FORMAT_RGBA_4444: |