diff options
author | Roman Kiryanov <rkir@google.com> | 2019-09-26 11:55:19 -0700 |
---|---|---|
committer | Roman Kiryanov <rkir@google.com> | 2019-10-09 14:42:17 -0700 |
commit | 8a659df43dd107b61e5108757f31fc3d25d68998 (patch) | |
tree | 4058a1db9b6d3f6bcc1339b4e8fb7e872e428de6 | |
parent | c573155e3d5f07f019032cf0d0419cb68dfd59fa (diff) | |
download | device_generic_goldfish-opengl-ndk-sysroot-r21.tar.gz device_generic_goldfish-opengl-ndk-sysroot-r21.tar.bz2 device_generic_goldfish-opengl-ndk-sysroot-r21.zip |
Move GL format defines to a separate header filendk-sysroot-r21
We are going to use them in another place.
Bug: 141385612
Test: build
Change-Id: I4dd791ec7c104ef235021f05b84dd2c019b39ab0
Signed-off-by: Roman Kiryanov <rkir@google.com>
-rw-r--r-- | system/gralloc/gralloc_common.h | 41 | ||||
-rw-r--r-- | system/gralloc/gralloc_old.cpp | 18 |
2 files changed, 44 insertions, 15 deletions
diff --git a/system/gralloc/gralloc_common.h b/system/gralloc/gralloc_common.h new file mode 100644 index 00000000..574e6594 --- /dev/null +++ b/system/gralloc/gralloc_common.h @@ -0,0 +1,41 @@ +/* +* Copyright 2019 The Android Open Source Project +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef __GRALLOC_COMMON_H__ +#define __GRALLOC_COMMON_H__ + +#ifndef GL_RGBA16F +#define GL_RGBA16F 0x881A +#endif // GL_RGBA16F + +#ifndef GL_HALF_FLOAT +#define GL_HALF_FLOAT 0x140B +#endif // GL_HALF_FLOAT + +#ifndef GL_RGB10_A2 +#define GL_RGB10_A2 0x8059 +#endif // GL_RGB10_A2 + +#ifndef GL_UNSIGNED_INT_2_10_10_10_REV +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#endif // GL_UNSIGNED_INT_2_10_10_10_REV + +// defined in hardware/interfaces/graphics/common/1.0/types.hal +#ifndef GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER +#define GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER (1ULL << 24) +#endif // GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER + +#endif //__GRALLOC_COMMON_H__ diff --git a/system/gralloc/gralloc_old.cpp b/system/gralloc/gralloc_old.cpp index 28803914..773f786c 100644 --- a/system/gralloc/gralloc_old.cpp +++ b/system/gralloc/gralloc_old.cpp @@ -28,6 +28,8 @@ #include "../../shared/OpenglCodecCommon/gralloc_cb_old.h" #endif +#include "gralloc_common.h" + #include "goldfish_dma.h" #include "goldfish_address_space.h" #include "FormatConversions.h" @@ -511,18 +513,6 @@ static void updateHostColorBuffer(cb_handle_old_t* cb, } } -#ifndef GL_RGBA16F -#define GL_RGBA16F 0x881A -#endif // GL_RGBA16F -#ifndef GL_HALF_FLOAT -#define GL_HALF_FLOAT 0x140B -#endif // GL_HALF_FLOAT -#ifndef GL_RGB10_A2 -#define GL_RGB10_A2 0x8059 -#endif // GL_RGB10_A2 -#ifndef GL_UNSIGNED_INT_2_10_10_10_REV -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#endif // GL_UNSIGNED_INT_2_10_10_10_REV // // gralloc device functions (alloc interface) // @@ -716,10 +706,8 @@ static int gralloc_alloc(alloc_device_t* dev, // DEFINE_AND_VALIDATE_HOST_CONNECTION; #if PLATFORM_SDK_VERSION >= 17 - // GPU_DATA_BUFFER is defined in hardware/interfaces/graphics/common/1.0/types.hal -# define _GRALLOC_USAGE_GPU_DATA_BUFFER 0x1000000 bool needHostCb = ((!yuv_format && frameworkFormat != HAL_PIXEL_FORMAT_BLOB) || - usage & _GRALLOC_USAGE_GPU_DATA_BUFFER || + usage & GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER || #else bool needHostCb = (!yuv_format || #endif // !(PLATFORM_SDK_VERSION >= 17) |