summaryrefslogtreecommitdiffstats
path: root/src/gui/egl/qeglproperties.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-02-18 08:58:57 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-02 08:24:24 (GMT)
commit551b41e20118b66edb37704a0cfbfe5d3a960067 (patch)
treea8d838511a3df2cd72babbdc6378863077b6d0b1 /src/gui/egl/qeglproperties.cpp
parentd0a2d10dfac7be20af78988a3351d374acfdd208 (diff)
downloadQt-551b41e20118b66edb37704a0cfbfe5d3a960067.zip
Qt-551b41e20118b66edb37704a0cfbfe5d3a960067.tar.gz
Qt-551b41e20118b66edb37704a0cfbfe5d3a960067.tar.bz2
Add QEgl::defaultConfig method to select configs suitable for Qt
Reviewed-By: TrustMe
Diffstat (limited to 'src/gui/egl/qeglproperties.cpp')
-rw-r--r--src/gui/egl/qeglproperties.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
index 86e158b..e0e8481 100644
--- a/src/gui/egl/qeglproperties.cpp
+++ b/src/gui/egl/qeglproperties.cpp
@@ -230,6 +230,16 @@ void QEglProperties::setRenderableType(QEgl::API api)
// reductions in complexity are possible.
bool QEglProperties::reduceConfiguration()
{
+#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
+ // For OpenVG, we sometimes try to create a surface using a pre-multiplied format. If we can't
+ // find a config which supports pre-multiplied formats, remove the flag on the surface type:
+ EGLint surfaceType = value(EGL_SURFACE_TYPE);
+ if (surfaceType & EGL_VG_ALPHA_FORMAT_PRE_BIT) {
+ surfaceType ^= EGL_VG_ALPHA_FORMAT_PRE_BIT;
+ setValue(EGL_SURFACE_TYPE, surfaceType);
+ return true;
+ }
+#endif
// EGL chooses configs with the highest color depth over
// those with smaller (but faster) lower color depths. One
// way around this is to set EGL_BUFFER_SIZE to 16, which