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"
115 "HORIZONTAL_RESOLUTION",
116 "VERTICAL_RESOLUTION",
120 "MULTISAMPLE_RESOLVE",
121 "PIXEL_ASPECT_RATIO",
129 ("SurfaceTarget", ["READ", "DRAW"]),
131 # ConfigAttrib values
132 ("ColorBufferType", ["RGB_BUFFER", "LUMINANCE_BUFFER"]),
133 ("ConfigCaveat", ["NONE", "SLOW_CONFIG", "NON_CONFORMANT_CONFIG"]),
134 ("TransparentType", ["NONE", "TRANSPARENT_RGB"]),
136 # SurfaceAttrib values
137 ("MultisampleResolve", ["MULTISAMPLE_RESOLVE_DEFAULT", "MULTISAMPLE_RESOLVE_BOX"]),
138 ("RenderBuffer", ["SINGLE_BUFFER", "BACK_BUFFER"]),
139 ("SwapBehavior", ["BUFFER_DESTROYED", "BUFFER_PRESERVED"]),
140 ("TextureFormat", ["NO_TEXTURE", "TEXTURE_RGB", "TEXTURE_RGBA"]),
141 ("TextureTarget", ["NO_TEXTURE", "TEXTURE_2D"]),
142 ("AlphaFormat", ["ALPHA_FORMAT_NONPRE", "ALPHA_FORMAT_PRE"]),
143 ("Colorspace", ["COLORSPACE_sRGB", "COLORSPACE_LINEAR"])
147 enumGroups = addValuePrefix(ENUM_GROUPS, "EGL_")
148 bitfieldGroups = addValuePrefix(BITFIELD_GROUPS, "EGL_")
149 prototypeFile = os.path.join(EGL_DIR, "egluStrUtilPrototypes.inl")
150 implFile = os.path.join(EGL_DIR, "egluStrUtil.inl")
152 writeInlFile(prototypeFile, indentLines(genStrUtilProtos(iface, enumGroups, bitfieldGroups)))
153 writeInlFile(implFile, genStrUtilImpls(iface, enumGroups, bitfieldGroups))