summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_x11egl.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-02-19 17:29:42 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-02 08:24:24 (GMT)
commit445b62cb432deb8aed3be766d3c37b9567e1d4ec (patch)
treef17ebb363831739f9bcc2beb05ae2098779e44e8 /src/opengl/qgl_x11egl.cpp
parentc993aef82eca9f5d5241093f407179e4189ab7f1 (diff)
downloadQt-445b62cb432deb8aed3be766d3c37b9567e1d4ec.zip
Qt-445b62cb432deb8aed3be766d3c37b9567e1d4ec.tar.gz
Qt-445b62cb432deb8aed3be766d3c37b9567e1d4ec.tar.bz2
Make QGLWidget use new QEgl::getCompatibleVisualId API
Reviewed-By: TrustMe
Diffstat (limited to 'src/opengl/qgl_x11egl.cpp')
-rw-r--r--src/opengl/qgl_x11egl.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 972a5f6..b8da156 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -282,6 +282,7 @@ void QGLWidget::updateOverlayGL()
}
//#define QT_DEBUG_X11_VISUAL_SELECTION 1
+//#undef QT_DEBUG_X11_VISUAL_SELECTION
bool qt_egl_setup_x11_visual(XVisualInfo &vi, EGLDisplay display, EGLConfig config, const QX11Info &x11Info, bool useArgbVisual)
{
@@ -471,10 +472,21 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
if (visible)
hide();
- XVisualInfo vi;
QEglContext *eglContext = d->glcx->d_func()->eglContext;
- bool usingArgbVisual = qt_egl_setup_x11_visual(vi, eglContext->display(), eglContext->config(),
- x11Info(), tryArgbVisual);
+
+ XVisualInfo vi;
+ memset(&vi, 0, sizeof(XVisualInfo));
+ vi.visualid = QEgl::getCompatibleVisualId(eglContext->config());
+
+ {
+ XVisualInfo *visualInfoPtr;
+ int matchingCount = 0;
+ visualInfoPtr = XGetVisualInfo(X11->display, VisualIDMask, &vi, &matchingCount);
+ vi = *visualInfoPtr;
+ XFree(visualInfoPtr);
+ }
+
+ bool usingArgbVisual = eglContext->configAttrib(EGL_ALPHA_SIZE) > 0;
XSetWindowAttributes a;