summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-02-09 14:00:16 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-02-09 14:44:06 (GMT)
commit5112afc9eeb546f27e2fa5d655418ee7c544b109 (patch)
treea11b2ca6cb550193969ba5f3956309f13b3c460e
parentcb742e70f0d2fb992d27045f6d3d9624bd10ced5 (diff)
downloadQt-5112afc9eeb546f27e2fa5d655418ee7c544b109.zip
Qt-5112afc9eeb546f27e2fa5d655418ee7c544b109.tar.gz
Qt-5112afc9eeb546f27e2fa5d655418ee7c544b109.tar.bz2
Add highest pixel format option to q_configFromQPlatformWindowFormat
The default is still the old behavior
-rw-r--r--src/plugins/platforms/eglconvenience/qeglconvenience.cpp18
-rw-r--r--src/plugins/platforms/eglconvenience/qeglconvenience.h2
2 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
index 1612f79..acdbf24 100644
--- a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
+++ b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp
@@ -206,7 +206,7 @@ bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes)
return false;
}
-EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format)
+EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format, bool highestPixelFormat)
{
EGLConfig cfg = 0;
QVector<EGLint> configureAttributes = q_createConfigAttributesFromFormat(format);
@@ -227,14 +227,14 @@ EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformW
if (!eglChooseConfig(display, configureAttributes.constData(), 0, 0, &matching) || !matching)
continue;
-// // If we want the best pixel format, then return the first
-// // matching configuration.
-// if (match == QEgl::BestPixelFormat) {
-// eglChooseConfig(display, props.properties(), &cfg, 1, &matching);
-// if (matching < 1)
-// continue;
-// return cfg;
-// }
+ // If we want the best pixel format, then return the first
+ // matching configuration.
+ if (highestPixelFormat) {
+ eglChooseConfig(display, configureAttributes.constData(), &cfg, 1, &matching);
+ if (matching < 1)
+ continue;
+ return cfg;
+ }
// Fetch all of the matching configurations and find the
// first that matches the pixel format we wanted.
diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.h b/src/plugins/platforms/eglconvenience/qeglconvenience.h
index 98c30b8..a1df3cc 100644
--- a/src/plugins/platforms/eglconvenience/qeglconvenience.h
+++ b/src/plugins/platforms/eglconvenience/qeglconvenience.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QVector<EGLint> q_createConfigAttributesFromFormat(const QPlatformWindowFormat &format);
bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes);
-EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format);
+EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format, bool highestPixelFormat = false);
QPlatformWindowFormat qt_qPlatformWindowFormatFromConfig(EGLDisplay display, const EGLConfig config);
bool q_hasEglExtension(EGLDisplay display,const char* extensionName);