0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the QtGui module of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
#include "qeglproperties_p.h"
|
|
43 |
|
|
44 |
QT_BEGIN_NAMESPACE
|
|
45 |
|
|
46 |
#include <QtCore/qdebug.h>
|
|
47 |
#include <QtCore/qstringlist.h>
|
|
48 |
|
|
49 |
#include "qegl_p.h"
|
|
50 |
|
|
51 |
|
|
52 |
// Initialize a property block.
|
|
53 |
QEglProperties::QEglProperties()
|
|
54 |
{
|
|
55 |
props.append(EGL_NONE);
|
|
56 |
}
|
|
57 |
|
|
58 |
QEglProperties::QEglProperties(EGLConfig cfg)
|
|
59 |
{
|
|
60 |
props.append(EGL_NONE);
|
|
61 |
for (int name = 0x3020; name <= 0x304F; ++name) {
|
|
62 |
EGLint value;
|
|
63 |
if (name != EGL_NONE && eglGetConfigAttrib(QEglContext::defaultDisplay(0), cfg, name, &value))
|
|
64 |
setValue(name, value);
|
|
65 |
}
|
|
66 |
eglGetError(); // Clear the error state.
|
|
67 |
}
|
|
68 |
|
|
69 |
// Fetch the current value associated with a property.
|
|
70 |
int QEglProperties::value(int name) const
|
|
71 |
{
|
|
72 |
for (int index = 0; index < (props.size() - 1); index += 2) {
|
|
73 |
if (props[index] == name)
|
|
74 |
return props[index + 1];
|
|
75 |
}
|
|
76 |
|
|
77 |
// If the attribute has not been explicitly set, return the EGL default
|
|
78 |
// The following defaults were taken from the EGL 1.4 spec:
|
|
79 |
switch(name) {
|
|
80 |
case EGL_BUFFER_SIZE: return 0;
|
|
81 |
case EGL_RED_SIZE: return 0;
|
|
82 |
case EGL_GREEN_SIZE: return 0;
|
|
83 |
case EGL_BLUE_SIZE: return 0;
|
|
84 |
case EGL_ALPHA_SIZE: return 0;
|
|
85 |
#if defined(EGL_LUMINANCE_SIZE)
|
|
86 |
case EGL_LUMINANCE_SIZE: return 0;
|
|
87 |
#endif
|
|
88 |
#if defined(EGL_ALPHA_MASK_SIZE)
|
|
89 |
case EGL_ALPHA_MASK_SIZE: return 0;
|
|
90 |
#endif
|
|
91 |
case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE;
|
|
92 |
case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE;
|
|
93 |
#if defined(EGL_COLOR_BUFFER_TYPE)
|
|
94 |
case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER;
|
|
95 |
#endif
|
|
96 |
case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE;
|
|
97 |
case EGL_CONFIG_ID: return EGL_DONT_CARE;
|
|
98 |
case EGL_DEPTH_SIZE: return 0;
|
|
99 |
case EGL_LEVEL: return 0;
|
|
100 |
case EGL_NATIVE_RENDERABLE: return EGL_DONT_CARE;
|
|
101 |
case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE;
|
|
102 |
case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE;
|
|
103 |
case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE;
|
|
104 |
#if defined(EGL_RENDERABLE_TYPE)
|
|
105 |
case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT;
|
|
106 |
#endif
|
|
107 |
case EGL_SAMPLE_BUFFERS: return 0;
|
|
108 |
case EGL_SAMPLES: return 0;
|
|
109 |
case EGL_STENCIL_SIZE: return 0;
|
|
110 |
case EGL_SURFACE_TYPE: return EGL_WINDOW_BIT;
|
|
111 |
case EGL_TRANSPARENT_TYPE: return EGL_NONE;
|
|
112 |
case EGL_TRANSPARENT_RED_VALUE: return EGL_DONT_CARE;
|
|
113 |
case EGL_TRANSPARENT_GREEN_VALUE: return EGL_DONT_CARE;
|
|
114 |
case EGL_TRANSPARENT_BLUE_VALUE: return EGL_DONT_CARE;
|
|
115 |
|
|
116 |
#if defined(EGL_VERSION_1_3)
|
|
117 |
case EGL_CONFORMANT: return 0;
|
|
118 |
case EGL_MATCH_NATIVE_PIXMAP: return EGL_NONE;
|
|
119 |
#endif
|
|
120 |
|
|
121 |
case EGL_MAX_PBUFFER_HEIGHT:
|
|
122 |
case EGL_MAX_PBUFFER_WIDTH:
|
|
123 |
case EGL_MAX_PBUFFER_PIXELS:
|
|
124 |
case EGL_NATIVE_VISUAL_ID:
|
|
125 |
case EGL_NONE:
|
|
126 |
// Attribute does not affect config selection.
|
|
127 |
return EGL_DONT_CARE;
|
|
128 |
default:
|
|
129 |
// Attribute is unknown in EGL <= 1.4.
|
|
130 |
return EGL_DONT_CARE;
|
|
131 |
}
|
|
132 |
}
|
|
133 |
|
|
134 |
// Set the value associated with a property, replacing an existing
|
|
135 |
// value if there is one.
|
|
136 |
void QEglProperties::setValue(int name, int value)
|
|
137 |
{
|
|
138 |
for (int index = 0; index < (props.size() - 1); index += 2) {
|
|
139 |
if (props[index] == name) {
|
|
140 |
props[index + 1] = value;
|
|
141 |
return;
|
|
142 |
}
|
|
143 |
}
|
|
144 |
props[props.size() - 1] = name;
|
|
145 |
props.append(value);
|
|
146 |
props.append(EGL_NONE);
|
|
147 |
}
|
|
148 |
|
|
149 |
// Remove a property value. Returns false if the property is not present.
|
|
150 |
bool QEglProperties::removeValue(int name)
|
|
151 |
{
|
|
152 |
for (int index = 0; index < (props.size() - 1); index += 2) {
|
|
153 |
if (props[index] == name) {
|
|
154 |
while ((index + 2) < props.size()) {
|
|
155 |
props[index] = props[index + 2];
|
|
156 |
++index;
|
|
157 |
}
|
|
158 |
props.resize(props.size() - 2);
|
|
159 |
return true;
|
|
160 |
}
|
|
161 |
}
|
|
162 |
return false;
|
|
163 |
}
|
|
164 |
|
|
165 |
// Sets the red, green, blue, and alpha sizes based on a pixel format.
|
|
166 |
// Normally used to match a configuration request to the screen format.
|
|
167 |
void QEglProperties::setPixelFormat(QImage::Format pixelFormat)
|
|
168 |
{
|
|
169 |
int red, green, blue, alpha;
|
|
170 |
switch (pixelFormat) {
|
|
171 |
case QImage::Format_RGB32:
|
|
172 |
case QImage::Format_RGB888:
|
|
173 |
red = green = blue = 8; alpha = 0; break;
|
|
174 |
case QImage::Format_ARGB32:
|
|
175 |
case QImage::Format_ARGB32_Premultiplied:
|
|
176 |
red = green = blue = alpha = 8; break;
|
|
177 |
case QImage::Format_RGB16:
|
|
178 |
red = 5; green = 6; blue = 5; alpha = 0; break;
|
|
179 |
case QImage::Format_ARGB8565_Premultiplied:
|
|
180 |
red = 5; green = 6; blue = 5; alpha = 8; break;
|
|
181 |
case QImage::Format_RGB666:
|
|
182 |
red = green = blue = 6; alpha = 0; break;
|
|
183 |
case QImage::Format_ARGB6666_Premultiplied:
|
|
184 |
red = green = blue = alpha = 6; break;
|
|
185 |
case QImage::Format_RGB555:
|
|
186 |
red = green = blue = 5; alpha = 0; break;
|
|
187 |
case QImage::Format_ARGB8555_Premultiplied:
|
|
188 |
red = green = blue = 5; alpha = 8; break;
|
|
189 |
case QImage::Format_RGB444:
|
|
190 |
red = green = blue = 4; alpha = 0; break;
|
|
191 |
case QImage::Format_ARGB4444_Premultiplied:
|
|
192 |
red = green = blue = alpha = 4; break;
|
|
193 |
default:
|
|
194 |
qWarning() << "QEglProperties::setPixelFormat(): Unsupported pixel format";
|
|
195 |
red = green = blue = alpha = 1; break;
|
|
196 |
}
|
|
197 |
setValue(EGL_RED_SIZE, red);
|
|
198 |
setValue(EGL_GREEN_SIZE, green);
|
|
199 |
setValue(EGL_BLUE_SIZE, blue);
|
|
200 |
setValue(EGL_ALPHA_SIZE, alpha);
|
|
201 |
}
|
|
202 |
|
|
203 |
void QEglProperties::setRenderableType(QEgl::API api)
|
|
204 |
{
|
|
205 |
#if defined(EGL_RENDERABLE_TYPE)
|
|
206 |
#if defined(QT_OPENGL_ES_2)
|
|
207 |
if (api == QEgl::OpenGL)
|
|
208 |
setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT);
|
|
209 |
#elif defined(QT_OPENGL_ES)
|
|
210 |
if (api == QEgl::OpenGL)
|
|
211 |
setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
|
|
212 |
#endif
|
|
213 |
#if defined(EGL_OPENVG_BIT)
|
|
214 |
if (api == QEgl::OpenVG)
|
|
215 |
setValue(EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT);
|
|
216 |
#endif
|
|
217 |
#else
|
|
218 |
Q_UNUSED(api);
|
|
219 |
#endif
|
|
220 |
}
|
|
221 |
|
|
222 |
// Reduce the complexity of a configuration request to ask for less
|
|
223 |
// because the previous request did not result in success. Returns
|
|
224 |
// true if the complexity was reduced, or false if no further
|
|
225 |
// reductions in complexity are possible.
|
|
226 |
bool QEglProperties::reduceConfiguration()
|
|
227 |
{
|
|
228 |
if (removeValue(EGL_SAMPLE_BUFFERS)) {
|
|
229 |
removeValue(EGL_SAMPLES);
|
|
230 |
return true;
|
|
231 |
}
|
|
232 |
if (removeValue(EGL_ALPHA_SIZE)) {
|
|
233 |
#if defined(EGL_BIND_TO_TEXTURE_RGBA) && defined(EGL_BIND_TO_TEXTURE_RGB)
|
|
234 |
if (removeValue(EGL_BIND_TO_TEXTURE_RGBA))
|
|
235 |
setValue(EGL_BIND_TO_TEXTURE_RGB, TRUE);
|
|
236 |
#endif
|
|
237 |
return true;
|
|
238 |
}
|
|
239 |
if (removeValue(EGL_STENCIL_SIZE))
|
|
240 |
return true;
|
|
241 |
if (removeValue(EGL_DEPTH_SIZE))
|
|
242 |
return true;
|
|
243 |
#if defined(EGL_BIND_TO_TEXTURE_RGB)
|
|
244 |
if (removeValue(EGL_BIND_TO_TEXTURE_RGB))
|
|
245 |
return true;
|
|
246 |
#endif
|
|
247 |
return false;
|
|
248 |
}
|
|
249 |
|
|
250 |
static void addTag(QString& str, const QString& tag)
|
|
251 |
{
|
|
252 |
int lastnl = str.lastIndexOf(QLatin1String("\n"));
|
|
253 |
if (lastnl == -1)
|
|
254 |
lastnl = 0;
|
|
255 |
if ((str.length() - lastnl) >= 50)
|
|
256 |
str += QLatin1String("\n ");
|
|
257 |
str += tag;
|
|
258 |
}
|
|
259 |
|
|
260 |
void QEglProperties::dumpAllConfigs()
|
|
261 |
{
|
|
262 |
EGLint count = 0;
|
|
263 |
eglGetConfigs(QEglContext::defaultDisplay(0), 0, 0, &count);
|
|
264 |
if (count < 1)
|
|
265 |
return;
|
|
266 |
|
|
267 |
EGLConfig *configs = new EGLConfig [count];
|
|
268 |
eglGetConfigs(QEglContext::defaultDisplay(0), configs, count, &count);
|
|
269 |
for (EGLint index = 0; index < count; ++index)
|
|
270 |
qWarning() << QEglProperties(configs[index]).toString();
|
|
271 |
delete [] configs;
|
|
272 |
}
|
|
273 |
|
|
274 |
// Convert a property list to a string suitable for debug output.
|
|
275 |
QString QEglProperties::toString() const
|
|
276 |
{
|
|
277 |
QString str;
|
|
278 |
int val;
|
|
279 |
|
|
280 |
val = value(EGL_CONFIG_ID);
|
|
281 |
if (val != EGL_DONT_CARE) {
|
|
282 |
str += QLatin1String("id=");
|
|
283 |
str += QString::number(val);
|
|
284 |
str += QLatin1Char(' ');
|
|
285 |
}
|
|
286 |
|
|
287 |
#ifdef EGL_RENDERABLE_TYPE
|
|
288 |
val = value(EGL_RENDERABLE_TYPE);
|
|
289 |
if (val != EGL_DONT_CARE) {
|
|
290 |
str += QLatin1String("type=");
|
|
291 |
QStringList types;
|
|
292 |
if ((val & EGL_OPENGL_ES_BIT) != 0)
|
|
293 |
types += QLatin1String("es1");
|
|
294 |
#ifdef EGL_OPENGL_ES2_BIT
|
|
295 |
if ((val & EGL_OPENGL_ES2_BIT) != 0)
|
|
296 |
types += QLatin1String("es2");
|
|
297 |
#endif
|
|
298 |
if ((val & EGL_OPENVG_BIT) != 0)
|
|
299 |
types += QLatin1String("vg");
|
|
300 |
if ((val & ~7) != 0)
|
|
301 |
types += QString::number(val);
|
|
302 |
str += types.join(QLatin1String(","));
|
|
303 |
} else {
|
|
304 |
str += QLatin1String("type=any");
|
|
305 |
}
|
|
306 |
#else
|
|
307 |
str += QLatin1String("type=es1");
|
|
308 |
#endif
|
|
309 |
|
|
310 |
int red = value(EGL_RED_SIZE);
|
|
311 |
int green = value(EGL_GREEN_SIZE);
|
|
312 |
int blue = value(EGL_BLUE_SIZE);
|
|
313 |
int alpha = value(EGL_ALPHA_SIZE);
|
|
314 |
int bufferSize = value(EGL_BUFFER_SIZE);
|
|
315 |
if (bufferSize == (red + green + blue + alpha))
|
|
316 |
bufferSize = 0;
|
|
317 |
str += QLatin1String(" rgba=");
|
|
318 |
str += QString::number(red);
|
|
319 |
str += QLatin1Char(',');
|
|
320 |
str += QString::number(green);
|
|
321 |
str += QLatin1Char(',');
|
|
322 |
str += QString::number(blue);
|
|
323 |
str += QLatin1Char(',');
|
|
324 |
str += QString::number(alpha);
|
|
325 |
if (bufferSize != 0) {
|
|
326 |
// Only report buffer size if different than r+g+b+a.
|
|
327 |
str += QLatin1String(" buffer-size=");
|
|
328 |
str += QString::number(bufferSize);
|
|
329 |
}
|
|
330 |
|
|
331 |
#ifdef EGL_COLOR_BUFFER_TYPE
|
|
332 |
val = value(EGL_COLOR_BUFFER_TYPE);
|
|
333 |
if (val == EGL_LUMINANCE_BUFFER) {
|
|
334 |
addTag(str, QLatin1String(" color-buffer-type=luminance"));
|
|
335 |
} else if (val != EGL_DONT_CARE && val != EGL_RGB_BUFFER) {
|
|
336 |
addTag(str, QLatin1String(" color-buffer-type="));
|
|
337 |
str += QString::number(val, 16);
|
|
338 |
}
|
|
339 |
#endif
|
|
340 |
|
|
341 |
val = value(EGL_DEPTH_SIZE);
|
|
342 |
if (val != 0) {
|
|
343 |
addTag(str, QLatin1String(" depth="));
|
|
344 |
str += QString::number(val);
|
|
345 |
}
|
|
346 |
|
|
347 |
val = value(EGL_STENCIL_SIZE);
|
|
348 |
if (val != 0) {
|
|
349 |
addTag(str, QLatin1String(" stencil="));
|
|
350 |
str += QString::number(val);
|
|
351 |
}
|
|
352 |
|
|
353 |
val = value(EGL_SURFACE_TYPE);
|
|
354 |
if (val != EGL_DONT_CARE) {
|
|
355 |
addTag(str, QLatin1String(" surface-type="));
|
|
356 |
QStringList types;
|
|
357 |
if ((val & EGL_WINDOW_BIT) != 0)
|
|
358 |
types += QLatin1String("window");
|
|
359 |
if ((val & EGL_PIXMAP_BIT) != 0)
|
|
360 |
types += QLatin1String("pixmap");
|
|
361 |
if ((val & EGL_PBUFFER_BIT) != 0)
|
|
362 |
types += QLatin1String("pbuffer");
|
|
363 |
#ifdef EGL_VG_COLORSPACE_LINEAR_BIT
|
|
364 |
if ((val & EGL_VG_COLORSPACE_LINEAR_BIT) != 0)
|
|
365 |
types += QLatin1String("vg-colorspace-linear");
|
|
366 |
#endif
|
|
367 |
#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
|
|
368 |
if ((val & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0)
|
|
369 |
types += QLatin1String("vg-alpha-format-pre");
|
|
370 |
#endif
|
|
371 |
if ((val & ~(EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT
|
|
372 |
#ifdef EGL_VG_COLORSPACE_LINEAR_BIT
|
|
373 |
| EGL_VG_COLORSPACE_LINEAR_BIT
|
|
374 |
#endif
|
|
375 |
#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
|
|
376 |
| EGL_VG_ALPHA_FORMAT_PRE_BIT
|
|
377 |
#endif
|
|
378 |
)) != 0) {
|
|
379 |
types += QString::number(val);
|
|
380 |
}
|
|
381 |
str += types.join(QLatin1String(","));
|
|
382 |
}
|
|
383 |
|
|
384 |
val = value(EGL_CONFIG_CAVEAT);
|
|
385 |
if (val != EGL_DONT_CARE) {
|
|
386 |
addTag(str, QLatin1String(" caveat="));
|
|
387 |
if (val == EGL_NONE)
|
|
388 |
str += QLatin1String("none");
|
|
389 |
else if (val == EGL_SLOW_CONFIG)
|
|
390 |
str += QLatin1String("slow");
|
|
391 |
else if (val == EGL_NON_CONFORMANT_CONFIG)
|
|
392 |
str += QLatin1String("non-conformant");
|
|
393 |
else
|
|
394 |
str += QString::number(val, 16);
|
|
395 |
}
|
|
396 |
|
|
397 |
val = value(EGL_LEVEL);
|
|
398 |
if (val != 0) {
|
|
399 |
addTag(str, QLatin1String(" level="));
|
|
400 |
str += QString::number(val);
|
|
401 |
}
|
|
402 |
|
|
403 |
int width, height, pixels;
|
|
404 |
width = value(EGL_MAX_PBUFFER_WIDTH);
|
|
405 |
height = value(EGL_MAX_PBUFFER_HEIGHT);
|
|
406 |
pixels = value(EGL_MAX_PBUFFER_PIXELS);
|
|
407 |
if (height != EGL_DONT_CARE || width != EGL_DONT_CARE) {
|
|
408 |
addTag(str, QLatin1String(" max-pbuffer-size="));
|
|
409 |
str += QString::number(width);
|
|
410 |
str += QLatin1Char('x');
|
|
411 |
str += QString::number(height);
|
|
412 |
if (pixels != (width * height)) {
|
|
413 |
addTag(str, QLatin1String(" max-pbuffer-pixels="));
|
|
414 |
str += QString::number(pixels);
|
|
415 |
}
|
|
416 |
}
|
|
417 |
|
|
418 |
val = value(EGL_NATIVE_RENDERABLE);
|
|
419 |
if (val != EGL_DONT_CARE) {
|
|
420 |
if (val)
|
|
421 |
addTag(str, QLatin1String(" native-renderable=true"));
|
|
422 |
else
|
|
423 |
addTag(str, QLatin1String(" native-renderable=false"));
|
|
424 |
}
|
|
425 |
|
|
426 |
val = value(EGL_NATIVE_VISUAL_ID);
|
|
427 |
if (val != EGL_DONT_CARE) {
|
|
428 |
addTag(str, QLatin1String(" visual-id="));
|
|
429 |
str += QString::number(val);
|
|
430 |
}
|
|
431 |
|
|
432 |
val = value(EGL_NATIVE_VISUAL_TYPE);
|
|
433 |
if (val != EGL_DONT_CARE) {
|
|
434 |
addTag(str, QLatin1String(" visual-type="));
|
|
435 |
str += QString::number(val);
|
|
436 |
}
|
|
437 |
|
|
438 |
#ifdef EGL_PRESERVED_RESOURCES
|
|
439 |
val = value(EGL_PRESERVED_RESOURCES);
|
|
440 |
if (val != EGL_DONT_CARE) {
|
|
441 |
if (val)
|
|
442 |
addTag(str, QLatin1String(" preserved-resources=true"));
|
|
443 |
else
|
|
444 |
addTag(str, QLatin1String(" preserved-resources=false"));
|
|
445 |
}
|
|
446 |
#endif
|
|
447 |
|
|
448 |
val = value(EGL_SAMPLES);
|
|
449 |
if (val != 0) {
|
|
450 |
addTag(str, QLatin1String(" samples="));
|
|
451 |
str += QString::number(val);
|
|
452 |
}
|
|
453 |
|
|
454 |
val = value(EGL_SAMPLE_BUFFERS);
|
|
455 |
if (val != 0) {
|
|
456 |
addTag(str, QLatin1String(" sample-buffers="));
|
|
457 |
str += QString::number(val);
|
|
458 |
}
|
|
459 |
|
|
460 |
val = value(EGL_TRANSPARENT_TYPE);
|
|
461 |
if (val == EGL_TRANSPARENT_RGB) {
|
|
462 |
addTag(str, QLatin1String(" transparent-rgb="));
|
|
463 |
str += QString::number(value(EGL_TRANSPARENT_RED_VALUE));
|
|
464 |
str += QLatin1Char(',');
|
|
465 |
str += QString::number(value(EGL_TRANSPARENT_GREEN_VALUE));
|
|
466 |
str += QLatin1Char(',');
|
|
467 |
str += QString::number(value(EGL_TRANSPARENT_BLUE_VALUE));
|
|
468 |
}
|
|
469 |
|
|
470 |
#if defined(EGL_BIND_TO_TEXTURE_RGB) && defined(EGL_BIND_TO_TEXTURE_RGBA)
|
|
471 |
val = value(EGL_BIND_TO_TEXTURE_RGB);
|
|
472 |
int val2 = value(EGL_BIND_TO_TEXTURE_RGBA);
|
|
473 |
if (val != EGL_DONT_CARE || val2 != EGL_DONT_CARE) {
|
|
474 |
addTag(str, QLatin1String(" bind-texture="));
|
|
475 |
if (val == EGL_TRUE)
|
|
476 |
str += QLatin1String("rgb");
|
|
477 |
else
|
|
478 |
str += QLatin1String("no-rgb");
|
|
479 |
if (val2 == EGL_TRUE)
|
|
480 |
str += QLatin1String(",rgba");
|
|
481 |
else
|
|
482 |
str += QLatin1String(",no-rgba");
|
|
483 |
}
|
|
484 |
#endif
|
|
485 |
|
|
486 |
#ifdef EGL_MIN_SWAP_INTERVAL
|
|
487 |
val = value(EGL_MIN_SWAP_INTERVAL);
|
|
488 |
if (val != EGL_DONT_CARE) {
|
|
489 |
addTag(str, QLatin1String(" min-swap-interval="));
|
|
490 |
str += QString::number(val);
|
|
491 |
}
|
|
492 |
#endif
|
|
493 |
|
|
494 |
#ifdef EGL_MIN_SWAP_INTERVAL
|
|
495 |
val = value(EGL_MAX_SWAP_INTERVAL);
|
|
496 |
if (val != EGL_DONT_CARE) {
|
|
497 |
addTag(str, QLatin1String(" max-swap-interval="));
|
|
498 |
str += QString::number(val);
|
|
499 |
}
|
|
500 |
#endif
|
|
501 |
|
|
502 |
#ifdef EGL_LUMINANCE_SIZE
|
|
503 |
val = value(EGL_LUMINANCE_SIZE);
|
|
504 |
if (val != 0) {
|
|
505 |
addTag(str, QLatin1String(" luminance="));
|
|
506 |
str += QString::number(val);
|
|
507 |
}
|
|
508 |
#endif
|
|
509 |
|
|
510 |
#ifdef EGL_ALPHA_MASK_SIZE
|
|
511 |
val = value(EGL_ALPHA_MASK_SIZE);
|
|
512 |
if (val != 0) {
|
|
513 |
addTag(str, QLatin1String(" alpha-mask="));
|
|
514 |
str += QString::number(val);
|
|
515 |
}
|
|
516 |
#endif
|
|
517 |
|
|
518 |
#ifdef EGL_CONFORMANT
|
|
519 |
val = value(EGL_CONFORMANT);
|
|
520 |
if (val != 0) {
|
|
521 |
if (val)
|
|
522 |
addTag(str, QLatin1String(" conformant=true"));
|
|
523 |
else
|
|
524 |
addTag(str, QLatin1String(" conformant=false"));
|
|
525 |
}
|
|
526 |
#endif
|
|
527 |
|
|
528 |
return str;
|
|
529 |
}
|
|
530 |
|
|
531 |
QT_END_NAMESPACE
|
|
532 |
|
|
533 |
|