summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-03-10 08:28:53 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-10 09:53:07 (GMT)
commitb0eeab376fc9f698a899be6dbc4c1fe6cef02982 (patch)
tree5fd6b643a3f4c0f56494ff5c9edf7c1fc2162df1 /src
parent4737daef1c8d7a181117d6482f5b57cfc433e050 (diff)
downloadQt-b0eeab376fc9f698a899be6dbc4c1fe6cef02982.zip
Qt-b0eeab376fc9f698a899be6dbc4c1fe6cef02982.tar.gz
Qt-b0eeab376fc9f698a899be6dbc4c1fe6cef02982.tar.bz2
Make the EGL contexts in QX11GLPixmapData Q_GLOBAL_STATIC
Still not ideal, but this should do for now. Reviewed-By: TrustMe
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index 797fe6b..d7fae16 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -61,6 +61,10 @@ QT_BEGIN_NAMESPACE
// On 16bpp systems, RGB & ARGB pixmaps are different bit-depths and therefore need
// different contexts:
+
+Q_GLOBAL_STATIC(QEglContext, qt_x11gl_rgbContext);
+Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext)
+
QEglContext* QX11GLPixmapData::rgbContext = 0;
QEglContext* QX11GLPixmapData::argbContext = 0;
@@ -75,6 +79,9 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
checkedForX11Pixmaps = true;
+ EGLint rgbConfigId;
+ EGLint argbConfigId;
+
do {
if (qgetenv("QT_USE_X11GL_PIXMAPS").isEmpty())
break;
@@ -83,8 +90,11 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
EGLConfig argbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL,
QEgl::Renderable | QEgl::Translucent);
+ eglGetConfigAttrib(QEgl::display(), rgbConfig, EGL_CONFIG_ID, &rgbConfigId);
+ eglGetConfigAttrib(QEgl::display(), argbConfig, EGL_CONFIG_ID, &argbConfigId);
+
if (!rgbContext) {
- rgbContext = new QEglContext;
+ rgbContext = qt_x11gl_rgbContext();
rgbContext->setConfig(rgbConfig);
rgbContext->createContext();
}
@@ -97,7 +107,7 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
argbContext = rgbContext;
if (!argbContext) {
- argbContext = new QEglContext;
+ argbContext = qt_x11gl_argbContext();
argbContext->setConfig(argbConfig);
argbContext->createContext();
}
@@ -156,7 +166,7 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
}
if (haveX11Pixmaps)
- qDebug("QX11GLPixmapData is supported");
+ qDebug("Using QX11GLPixmapData with EGL config %d for ARGB and config %d for RGB", argbConfigId, rgbConfigId);
else
qDebug("QX11GLPixmapData is *NOT* being used");