summaryrefslogtreecommitdiff
path: root/framework/egl/egluStrUtil.inl
blob: 02b3d1b8e9c99047c8d4da042b119930fe06779f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
/* WARNING: This is auto-generated file. Do not modify, since changes will
 * be lost! Modify the generating script instead.
 *
 * Generated from Khronos EGL API description (egl.xml) revision 13a26984991216cbf9a44fbf390f95dc05b5493a.
 */

const char* getBooleanName (int value)
{
	switch (value)
	{
		case EGL_TRUE:	return "EGL_TRUE";
		case EGL_FALSE:	return "EGL_FALSE";
		default:		return DE_NULL;
	}
}

const char* getBoolDontCareName (int value)
{
	switch (value)
	{
		case EGL_TRUE:		return "EGL_TRUE";
		case EGL_FALSE:		return "EGL_FALSE";
		case EGL_DONT_CARE:	return "EGL_DONT_CARE";
		default:			return DE_NULL;
	}
}

const char* getAPIName (int value)
{
	switch (value)
	{
		case EGL_OPENGL_API:	return "EGL_OPENGL_API";
		case EGL_OPENGL_ES_API:	return "EGL_OPENGL_ES_API";
		case EGL_OPENVG_API:	return "EGL_OPENVG_API";
		default:				return DE_NULL;
	}
}

const char* getErrorName (int value)
{
	switch (value)
	{
		case EGL_SUCCESS:				return "EGL_SUCCESS";
		case EGL_NOT_INITIALIZED:		return "EGL_NOT_INITIALIZED";
		case EGL_BAD_ACCESS:			return "EGL_BAD_ACCESS";
		case EGL_BAD_ALLOC:				return "EGL_BAD_ALLOC";
		case EGL_BAD_ATTRIBUTE:			return "EGL_BAD_ATTRIBUTE";
		case EGL_BAD_CONFIG:			return "EGL_BAD_CONFIG";
		case EGL_BAD_CONTEXT:			return "EGL_BAD_CONTEXT";
		case EGL_BAD_CURRENT_SURFACE:	return "EGL_BAD_CURRENT_SURFACE";
		case EGL_BAD_DISPLAY:			return "EGL_BAD_DISPLAY";
		case EGL_BAD_MATCH:				return "EGL_BAD_MATCH";
		case EGL_BAD_NATIVE_PIXMAP:		return "EGL_BAD_NATIVE_PIXMAP";
		case EGL_BAD_NATIVE_WINDOW:		return "EGL_BAD_NATIVE_WINDOW";
		case EGL_BAD_PARAMETER:			return "EGL_BAD_PARAMETER";
		case EGL_BAD_SURFACE:			return "EGL_BAD_SURFACE";
		case EGL_CONTEXT_LOST:			return "EGL_CONTEXT_LOST";
		default:						return DE_NULL;
	}
}

const char* getContextAttribName (int value)
{
	switch (value)
	{
		case EGL_CONFIG_ID:					return "EGL_CONFIG_ID";
		case EGL_CONTEXT_CLIENT_TYPE:		return "EGL_CONTEXT_CLIENT_TYPE";
		case EGL_CONTEXT_CLIENT_VERSION:	return "EGL_CONTEXT_CLIENT_VERSION";
		case EGL_RENDER_BUFFER:				return "EGL_RENDER_BUFFER";
		default:							return DE_NULL;
	}
}

const char* getConfigAttribName (int value)
{
	switch (value)
	{
		case EGL_BUFFER_SIZE:				return "EGL_BUFFER_SIZE";
		case EGL_RED_SIZE:					return "EGL_RED_SIZE";
		case EGL_GREEN_SIZE:				return "EGL_GREEN_SIZE";
		case EGL_BLUE_SIZE:					return "EGL_BLUE_SIZE";
		case EGL_LUMINANCE_SIZE:			return "EGL_LUMINANCE_SIZE";
		case EGL_ALPHA_SIZE:				return "EGL_ALPHA_SIZE";
		case EGL_ALPHA_MASK_SIZE:			return "EGL_ALPHA_MASK_SIZE";
		case EGL_BIND_TO_TEXTURE_RGB:		return "EGL_BIND_TO_TEXTURE_RGB";
		case EGL_BIND_TO_TEXTURE_RGBA:		return "EGL_BIND_TO_TEXTURE_RGBA";
		case EGL_COLOR_BUFFER_TYPE:			return "EGL_COLOR_BUFFER_TYPE";
		case EGL_CONFIG_CAVEAT:				return "EGL_CONFIG_CAVEAT";
		case EGL_CONFIG_ID:					return "EGL_CONFIG_ID";
		case EGL_CONFORMANT:				return "EGL_CONFORMANT";
		case EGL_DEPTH_SIZE:				return "EGL_DEPTH_SIZE";
		case EGL_LEVEL:						return "EGL_LEVEL";
		case EGL_MATCH_NATIVE_PIXMAP:		return "EGL_MATCH_NATIVE_PIXMAP";
		case EGL_MAX_SWAP_INTERVAL:			return "EGL_MAX_SWAP_INTERVAL";
		case EGL_MIN_SWAP_INTERVAL:			return "EGL_MIN_SWAP_INTERVAL";
		case EGL_NATIVE_RENDERABLE:			return "EGL_NATIVE_RENDERABLE";
		case EGL_NATIVE_VISUAL_TYPE:		return "EGL_NATIVE_VISUAL_TYPE";
		case EGL_RENDERABLE_TYPE:			return "EGL_RENDERABLE_TYPE";
		case EGL_SAMPLE_BUFFERS:			return "EGL_SAMPLE_BUFFERS";
		case EGL_SAMPLES:					return "EGL_SAMPLES";
		case EGL_STENCIL_SIZE:				return "EGL_STENCIL_SIZE";
		case EGL_SURFACE_TYPE:				return "EGL_SURFACE_TYPE";
		case EGL_TRANSPARENT_TYPE:			return "EGL_TRANSPARENT_TYPE";
		case EGL_TRANSPARENT_RED_VALUE:		return "EGL_TRANSPARENT_RED_VALUE";
		case EGL_TRANSPARENT_GREEN_VALUE:	return "EGL_TRANSPARENT_GREEN_VALUE";
		case EGL_TRANSPARENT_BLUE_VALUE:	return "EGL_TRANSPARENT_BLUE_VALUE";
		case EGL_COLOR_COMPONENT_TYPE_EXT:	return "EGL_COLOR_COMPONENT_TYPE_EXT";
		default:							return DE_NULL;
	}
}

const char* getSurfaceAttribName (int value)
{
	switch (value)
	{
		case EGL_CONFIG_ID:				return "EGL_CONFIG_ID";
		case EGL_WIDTH:					return "EGL_WIDTH";
		case EGL_HEIGHT:				return "EGL_HEIGHT";
		case EGL_HORIZONTAL_RESOLUTION:	return "EGL_HORIZONTAL_RESOLUTION";
		case EGL_VERTICAL_RESOLUTION:	return "EGL_VERTICAL_RESOLUTION";
		case EGL_LARGEST_PBUFFER:		return "EGL_LARGEST_PBUFFER";
		case EGL_MIPMAP_TEXTURE:		return "EGL_MIPMAP_TEXTURE";
		case EGL_MIPMAP_LEVEL:			return "EGL_MIPMAP_LEVEL";
		case EGL_MULTISAMPLE_RESOLVE:	return "EGL_MULTISAMPLE_RESOLVE";
		case EGL_PIXEL_ASPECT_RATIO:	return "EGL_PIXEL_ASPECT_RATIO";
		case EGL_RENDER_BUFFER:			return "EGL_RENDER_BUFFER";
		case EGL_SWAP_BEHAVIOR:			return "EGL_SWAP_BEHAVIOR";
		case EGL_TEXTURE_FORMAT:		return "EGL_TEXTURE_FORMAT";
		case EGL_TEXTURE_TARGET:		return "EGL_TEXTURE_TARGET";
		case EGL_ALPHA_FORMAT:			return "EGL_ALPHA_FORMAT";
		case EGL_COLORSPACE:			return "EGL_COLORSPACE";
		default:						return DE_NULL;
	}
}

const char* getYuvOrderName (int value)
{
	switch (value)
	{
		case EGL_NONE:					return "EGL_NONE";
		case EGL_YUV_ORDER_YUV_EXT:		return "EGL_YUV_ORDER_YUV_EXT";
		case EGL_YUV_ORDER_YVU_EXT:		return "EGL_YUV_ORDER_YVU_EXT";
		case EGL_YUV_ORDER_YUYV_EXT:	return "EGL_YUV_ORDER_YUYV_EXT";
		case EGL_YUV_ORDER_UYVY_EXT:	return "EGL_YUV_ORDER_UYVY_EXT";
		case EGL_YUV_ORDER_YVYU_EXT:	return "EGL_YUV_ORDER_YVYU_EXT";
		case EGL_YUV_ORDER_VYUY_EXT:	return "EGL_YUV_ORDER_VYUY_EXT";
		case EGL_YUV_ORDER_AYUV_EXT:	return "EGL_YUV_ORDER_AYUV_EXT";
		default:						return DE_NULL;
	}
}

const char* getYuvPlaneBppName (int value)
{
	switch (value)
	{
		case EGL_YUV_PLANE_BPP_0_EXT:	return "EGL_YUV_PLANE_BPP_0_EXT";
		case EGL_YUV_PLANE_BPP_8_EXT:	return "EGL_YUV_PLANE_BPP_8_EXT";
		case EGL_YUV_PLANE_BPP_10_EXT:	return "EGL_YUV_PLANE_BPP_10_EXT";
		default:						return DE_NULL;
	}
}

const char* getColorComponentTypeName (int value)
{
	switch (value)
	{
		case EGL_COLOR_COMPONENT_TYPE_FIXED_EXT:	return "EGL_COLOR_COMPONENT_TYPE_FIXED_EXT";
		case EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT:	return "EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT";
		default:									return DE_NULL;
	}
}

const char* getSurfaceTargetName (int value)
{
	switch (value)
	{
		case EGL_READ:	return "EGL_READ";
		case EGL_DRAW:	return "EGL_DRAW";
		default:		return DE_NULL;
	}
}

const char* getColorBufferTypeName (int value)
{
	switch (value)
	{
		case EGL_RGB_BUFFER:		return "EGL_RGB_BUFFER";
		case EGL_LUMINANCE_BUFFER:	return "EGL_LUMINANCE_BUFFER";
		default:					return DE_NULL;
	}
}

const char* getConfigCaveatName (int value)
{
	switch (value)
	{
		case EGL_NONE:					return "EGL_NONE";
		case EGL_SLOW_CONFIG:			return "EGL_SLOW_CONFIG";
		case EGL_NON_CONFORMANT_CONFIG:	return "EGL_NON_CONFORMANT_CONFIG";
		default:						return DE_NULL;
	}
}

const char* getTransparentTypeName (int value)
{
	switch (value)
	{
		case EGL_NONE:				return "EGL_NONE";
		case EGL_TRANSPARENT_RGB:	return "EGL_TRANSPARENT_RGB";
		default:					return DE_NULL;
	}
}

const char* getMultisampleResolveName (int value)
{
	switch (value)
	{
		case EGL_MULTISAMPLE_RESOLVE_DEFAULT:	return "EGL_MULTISAMPLE_RESOLVE_DEFAULT";
		case EGL_MULTISAMPLE_RESOLVE_BOX:		return "EGL_MULTISAMPLE_RESOLVE_BOX";
		default:								return DE_NULL;
	}
}

const char* getRenderBufferName (int value)
{
	switch (value)
	{
		case EGL_SINGLE_BUFFER:	return "EGL_SINGLE_BUFFER";
		case EGL_BACK_BUFFER:	return "EGL_BACK_BUFFER";
		default:				return DE_NULL;
	}
}

const char* getSwapBehaviorName (int value)
{
	switch (value)
	{
		case EGL_BUFFER_DESTROYED:	return "EGL_BUFFER_DESTROYED";
		case EGL_BUFFER_PRESERVED:	return "EGL_BUFFER_PRESERVED";
		default:					return DE_NULL;
	}
}

const char* getTextureFormatName (int value)
{
	switch (value)
	{
		case EGL_NO_TEXTURE:	return "EGL_NO_TEXTURE";
		case EGL_TEXTURE_RGB:	return "EGL_TEXTURE_RGB";
		case EGL_TEXTURE_RGBA:	return "EGL_TEXTURE_RGBA";
		default:				return DE_NULL;
	}
}

const char* getTextureTargetName (int value)
{
	switch (value)
	{
		case EGL_NO_TEXTURE:	return "EGL_NO_TEXTURE";
		case EGL_TEXTURE_2D:	return "EGL_TEXTURE_2D";
		default:				return DE_NULL;
	}
}

const char* getAlphaFormatName (int value)
{
	switch (value)
	{
		case EGL_ALPHA_FORMAT_NONPRE:	return "EGL_ALPHA_FORMAT_NONPRE";
		case EGL_ALPHA_FORMAT_PRE:		return "EGL_ALPHA_FORMAT_PRE";
		default:						return DE_NULL;
	}
}

const char* getColorspaceName (int value)
{
	switch (value)
	{
		case EGL_COLORSPACE_sRGB:	return "EGL_COLORSPACE_sRGB";
		case EGL_COLORSPACE_LINEAR:	return "EGL_COLORSPACE_LINEAR";
		default:					return DE_NULL;
	}
}

tcu::Format::Bitfield<16> getAPIBitsStr (int value)
{
	static const tcu::Format::BitDesc s_desc[] =
	{
		tcu::Format::BitDesc(EGL_OPENGL_BIT,			"EGL_OPENGL_BIT"),
		tcu::Format::BitDesc(EGL_OPENGL_ES_BIT,			"EGL_OPENGL_ES_BIT"),
		tcu::Format::BitDesc(EGL_OPENGL_ES2_BIT,		"EGL_OPENGL_ES2_BIT"),
		tcu::Format::BitDesc(EGL_OPENGL_ES3_BIT_KHR,	"EGL_OPENGL_ES3_BIT_KHR"),
		tcu::Format::BitDesc(EGL_OPENVG_BIT,			"EGL_OPENVG_BIT"),
	};
	return tcu::Format::Bitfield<16>(value, &s_desc[0], &s_desc[DE_LENGTH_OF_ARRAY(s_desc)]);
}

tcu::Format::Bitfield<16> getSurfaceBitsStr (int value)
{
	static const tcu::Format::BitDesc s_desc[] =
	{
		tcu::Format::BitDesc(EGL_PBUFFER_BIT,					"EGL_PBUFFER_BIT"),
		tcu::Format::BitDesc(EGL_PIXMAP_BIT,					"EGL_PIXMAP_BIT"),
		tcu::Format::BitDesc(EGL_WINDOW_BIT,					"EGL_WINDOW_BIT"),
		tcu::Format::BitDesc(EGL_MULTISAMPLE_RESOLVE_BOX_BIT,	"EGL_MULTISAMPLE_RESOLVE_BOX_BIT"),
		tcu::Format::BitDesc(EGL_SWAP_BEHAVIOR_PRESERVED_BIT,	"EGL_SWAP_BEHAVIOR_PRESERVED_BIT"),
		tcu::Format::BitDesc(EGL_VG_ALPHA_FORMAT_PRE_BIT,		"EGL_VG_ALPHA_FORMAT_PRE_BIT"),
		tcu::Format::BitDesc(EGL_VG_COLORSPACE_LINEAR_BIT,		"EGL_VG_COLORSPACE_LINEAR_BIT"),
		tcu::Format::BitDesc(EGL_LOCK_SURFACE_BIT_KHR,			"EGL_LOCK_SURFACE_BIT_KHR"),
		tcu::Format::BitDesc(EGL_OPTIMAL_FORMAT_BIT_KHR,		"EGL_OPTIMAL_FORMAT_BIT_KHR"),
	};
	return tcu::Format::Bitfield<16>(value, &s_desc[0], &s_desc[DE_LENGTH_OF_ARRAY(s_desc)]);
}