diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-05-15 03:09:59 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-05-15 03:09:59 +0000 |
commit | c62b9a26e5a78547fd0ab7c348733563f7c1f2e1 (patch) | |
tree | 5d6afb08804243c437f3b704f4dbcaf29367141e | |
parent | 99399b2cc87853e7c9af5e3c6658e41fc4913288 (diff) | |
parent | 146f745d0de292a04b88d1665edbdb4c75f9dbeb (diff) | |
download | device_generic_goldfish-opengl-c62b9a26e5a78547fd0ab7c348733563f7c1f2e1.tar.gz device_generic_goldfish-opengl-c62b9a26e5a78547fd0ab7c348733563f7c1f2e1.tar.bz2 device_generic_goldfish-opengl-c62b9a26e5a78547fd0ab7c348733563f7c1f2e1.zip |
Snap for 5567188 from 146f745d0de292a04b88d1665edbdb4c75f9dbeb to qt-release
Change-Id: I016b434a1b1d1cb11dec031095b309cf59942902
-rw-r--r-- | system/gralloc/gralloc.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index d76ac0b9..a83ca963 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -479,6 +479,7 @@ static int gralloc_alloc(alloc_device_t* dev, bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK)); bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER); bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK)); + const bool hw_texture = usage & GRALLOC_USAGE_HW_TEXTURE; #if PLATFORM_SDK_VERSION >= 17 bool hw_cam_write = (usage & GRALLOC_USAGE_HW_CAMERA_WRITE); bool hw_cam_read = (usage & GRALLOC_USAGE_HW_CAMERA_READ); @@ -541,6 +542,15 @@ static int gralloc_alloc(alloc_device_t* dev, glFormat = GL_RGBA; glType = GL_UNSIGNED_BYTE; break; + case HAL_PIXEL_FORMAT_RGB_888: + if (hw_texture) { + return -EINVAL; // we dont support RGB_888 for HW textures + } else { + bpp = 3; + glFormat = GL_RGB; + glType = GL_UNSIGNED_BYTE; + break; + } case HAL_PIXEL_FORMAT_RGB_565: bpp = 2; // Workaround: distinguish vs the RGB8/RGBA8 |