1 # -*- coding: utf-8 -*-
3 #-------------------------------------------------------------------------
4 # drawElements Quality Program utilities
5 # --------------------------------------
7 # Copyright 2015 The Android Open Source Project
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
21 #-------------------------------------------------------------------------
27 from khr_util.format import indentLines
28 from khr_util.gen_str_util import addValuePrefix, genStrUtilProtos, genStrUtilImpls
43 "MULTISAMPLE_RESOLVE_BOX_BIT",
44 "SWAP_BEHAVIOR_PRESERVED_BIT",
45 "VG_ALPHA_FORMAT_PRE_BIT",
46 "VG_COLORSPACE_LINEAR_BIT",
47 "LOCK_SURFACE_BIT_KHR",
48 "OPTIMAL_FORMAT_BIT_KHR"
54 ("Boolean", ["TRUE", "FALSE"]),
55 ("BoolDontCare", ["TRUE", "FALSE", "DONT_CARE"]),
56 ("API", ["OPENGL_API", "OPENGL_ES_API", "OPENVG_API"]),
65 "BAD_CURRENT_SURFACE",
76 "CONTEXT_CLIENT_TYPE",
77 "CONTEXT_CLIENT_VERSION",
88 "BIND_TO_TEXTURE_RGB",
89 "BIND_TO_TEXTURE_RGBA",
96 "MATCH_NATIVE_PIXMAP",
100 "NATIVE_VISUAL_TYPE",
107 "TRANSPARENT_RED_VALUE",
108 "TRANSPARENT_GREEN_VALUE",
109 "TRANSPARENT_BLUE_VALUE",
110 "COLOR_COMPONENT_TYPE_EXT"
116 "HORIZONTAL_RESOLUTION",
117 "VERTICAL_RESOLUTION",
121 "MULTISAMPLE_RESOLVE",
122 "PIXEL_ASPECT_RATIO",
134 "YUV_ORDER_YUYV_EXT",
135 "YUV_ORDER_UYVY_EXT",
136 "YUV_ORDER_YVYU_EXT",
137 "YUV_ORDER_VYUY_EXT",
138 "YUV_ORDER_AYUV_EXT",
141 "YUV_PLANE_BPP_0_EXT",
142 "YUV_PLANE_BPP_8_EXT",
143 "YUV_PLANE_BPP_10_EXT",
145 ("ColorComponentType", ["COLOR_COMPONENT_TYPE_FIXED_EXT", "COLOR_COMPONENT_TYPE_FLOAT_EXT"]),
146 ("SurfaceTarget", ["READ", "DRAW"]),
148 # ConfigAttrib values
149 ("ColorBufferType", ["RGB_BUFFER", "LUMINANCE_BUFFER"]),
150 ("ConfigCaveat", ["NONE", "SLOW_CONFIG", "NON_CONFORMANT_CONFIG"]),
151 ("TransparentType", ["NONE", "TRANSPARENT_RGB"]),
153 # SurfaceAttrib values
154 ("MultisampleResolve", ["MULTISAMPLE_RESOLVE_DEFAULT", "MULTISAMPLE_RESOLVE_BOX"]),
155 ("RenderBuffer", ["SINGLE_BUFFER", "BACK_BUFFER"]),
156 ("SwapBehavior", ["BUFFER_DESTROYED", "BUFFER_PRESERVED"]),
157 ("TextureFormat", ["NO_TEXTURE", "TEXTURE_RGB", "TEXTURE_RGBA"]),
158 ("TextureTarget", ["NO_TEXTURE", "TEXTURE_2D"]),
159 ("AlphaFormat", ["ALPHA_FORMAT_NONPRE", "ALPHA_FORMAT_PRE"]),
160 ("Colorspace", ["COLORSPACE_sRGB", "COLORSPACE_LINEAR"])
164 enumGroups = addValuePrefix(ENUM_GROUPS, "EGL_")
165 bitfieldGroups = addValuePrefix(BITFIELD_GROUPS, "EGL_")
166 prototypeFile = os.path.join(EGL_DIR, "egluStrUtilPrototypes.inl")
167 implFile = os.path.join(EGL_DIR, "egluStrUtil.inl")
169 writeInlFile(prototypeFile, indentLines(genStrUtilProtos(iface, enumGroups, bitfieldGroups)))
170 writeInlFile(implFile, genStrUtilImpls(iface, enumGroups, bitfieldGroups))