1 #ifndef _EGLUCONFIGINFO_HPP
2 #define _EGLUCONFIGINFO_HPP
3 /*-------------------------------------------------------------------------
4  * drawElements Quality Program Tester Core
5  * ----------------------------------------
6  *
7  * Copyright 2014 The Android Open Source Project
8  *
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
12  *
13  *	  http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  *//*!
22  * \file
23  * \brief EGL config info.
24  *//*--------------------------------------------------------------------*/
25 
26 #include "tcuDefs.hpp"
27 #include "eglwDefs.hpp"
28 #include "eglwEnums.hpp"
29 
30 namespace eglw
31 {
32 class Library;
33 }
34 
35 namespace eglu
36 {
37 
38 class ConfigInfo
39 {
40 public:
41 	// Core attributes
42 	deInt32			bufferSize;
43 	deInt32			redSize;
44 	deInt32			greenSize;
45 	deInt32			blueSize;
46 	deInt32			luminanceSize;
47 	deInt32			alphaSize;
48 	deInt32			alphaMaskSize;
49 	deUint32		bindToTextureRGB;
50 	deUint32		bindToTextureRGBA;
51 	deUint32		colorBufferType;
52 	deUint32		configCaveat;
53 	deInt32			configId;
54 	deInt32			conformant;
55 	deInt32			depthSize;
56 	deInt32			level;
57 	deInt32			maxPbufferWidth;
58 	deInt32			maxPbufferHeight;
59 	deInt32			maxSwapInterval;
60 	deInt32			minSwapInterval;
61 	deUint32		nativeRenderable;
62 	deInt32			nativeVisualId;
63 	deInt32			nativeVisualType;
64 	deInt32			renderableType;
65 	deInt32			sampleBuffers;
66 	deInt32			samples;
67 	deInt32			stencilSize;
68 	deInt32			surfaceType;
69 	deUint32		transparentType;
70 	deInt32			transparentRedValue;
71 	deInt32			transparentGreenValue;
72 	deInt32			transparentBlueValue;
73 
74 	// Extension attributes - set by queryExtConfigInfo()
75 
76 	// EGL_EXT_yuv_surface
77 	deUint32		yuvOrder;
78 	deInt32			yuvNumberOfPlanes;
79 	deUint32		yuvSubsample;
80 	deUint32		yuvDepthRange;
81 	deUint32		yuvCscStandard;
82 	deInt32			yuvPlaneBpp;
83 
84 	// EGL_EXT_pixel_format_float
85 	deUint32		colorComponentType;
86 
ConfigInfo(void)87 	ConfigInfo (void)
88 		: bufferSize			(0)
89 		, redSize				(0)
90 		, greenSize				(0)
91 		, blueSize				(0)
92 		, luminanceSize			(0)
93 		, alphaSize				(0)
94 		, alphaMaskSize			(0)
95 		, bindToTextureRGB		(0)
96 		, bindToTextureRGBA		(0)
97 		, colorBufferType		(0)
98 		, configCaveat			(0)
99 		, configId				(0)
100 		, conformant			(0)
101 		, depthSize				(0)
102 		, level					(0)
103 		, maxPbufferWidth		(0)
104 		, maxPbufferHeight		(0)
105 		, maxSwapInterval		(0)
106 		, minSwapInterval		(0)
107 		, nativeRenderable		(0)
108 		, nativeVisualId		(0)
109 		, nativeVisualType		(0)
110 		, renderableType		(0)
111 		, sampleBuffers			(0)
112 		, samples				(0)
113 		, stencilSize			(0)
114 		, surfaceType			(0)
115 		, transparentType		(0)
116 		, transparentRedValue	(0)
117 		, transparentGreenValue	(0)
118 		, transparentBlueValue	(0)
119 		, yuvOrder				(EGL_NONE)
120 		, yuvNumberOfPlanes		(0)
121 		, yuvSubsample			(EGL_NONE)
122 		, yuvDepthRange			(EGL_NONE)
123 		, yuvCscStandard		(EGL_NONE)
124 		, yuvPlaneBpp			(EGL_YUV_PLANE_BPP_0_EXT)
125 		, colorComponentType	(EGL_NONE)
126 	{
127 	}
128 
129 	deInt32 getAttribute (deUint32 attribute) const;
130 };
131 
132 void	queryCoreConfigInfo	(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, ConfigInfo* dst);
133 void	queryExtConfigInfo	(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, ConfigInfo* dst);
134 
135 } // eglu
136 
137 #endif // _EGLUCONFIGINFO_HPP
138