1 /*
2 * Copyright 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17 #ifndef __GRALLOC_COMMON_H__
18 #define __GRALLOC_COMMON_H__
19 
20 // Tell the emulator which gralloc formats
21 // need special handling.
22 enum EmulatorFrameworkFormat {
23     FRAMEWORK_FORMAT_GL_COMPATIBLE = 0,
24     FRAMEWORK_FORMAT_YV12 = 1,
25     FRAMEWORK_FORMAT_YUV_420_888 = 2,              // (Y+)(U+)(V+)
26 };
27 
28 #ifndef GL_RGBA16F
29 #define GL_RGBA16F                        0x881A
30 #endif // GL_RGBA16F
31 
32 #ifndef GL_HALF_FLOAT
33 #define GL_HALF_FLOAT                     0x140B
34 #endif // GL_HALF_FLOAT
35 
36 #ifndef GL_RGB10_A2
37 #define GL_RGB10_A2                       0x8059
38 #endif // GL_RGB10_A2
39 
40 #ifndef GL_UNSIGNED_INT_2_10_10_10_REV
41 #define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
42 #endif // GL_UNSIGNED_INT_2_10_10_10_REV
43 
44 // defined in hardware/interfaces/graphics/common/1.0/types.hal
45 #ifndef GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER
46 #define GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER (1ULL << 24)
47 #endif // GOLDFISH_GRALLOC_USAGE_GPU_DATA_BUFFER
48 
49 #endif //__GRALLOC_COMMON_H__
50