diff -r dee5afe5301f -r 3f74d0d4af4c src/opengl/qpixmapdata_x11gl_egl.cpp --- a/src/opengl/qpixmapdata_x11gl_egl.cpp Mon Mar 15 12:43:09 2010 +0200 +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp Thu Apr 08 14:19:33 2010 +0300 @@ -96,14 +96,14 @@ #endif EGL_NONE }; - qPixmapARGBSharedEglContext = eglCreateContext(QEglContext::defaultDisplay(0), + qPixmapARGBSharedEglContext = eglCreateContext(QEglContext::display(), argbConfig, 0, contextAttribs); if (argbConfig == rgbConfig) { // If the configs are the same, we can re-use the same context. qPixmapRGBSharedEglContext = qPixmapARGBSharedEglContext; } else { - qPixmapRGBSharedEglContext = eglCreateContext(QEglContext::defaultDisplay(0), + qPixmapRGBSharedEglContext = eglCreateContext(QEglContext::display(), rgbConfig, 0, contextAttribs); } @@ -114,7 +114,7 @@ if (!qt_createEGLSurfaceForPixmap(argbPixmapData, false)) break; - haveX11Pixmaps = eglMakeCurrent(QEglContext::defaultDisplay(0), + haveX11Pixmaps = eglMakeCurrent(QEglContext::display(), (EGLSurface)argbPixmapData->gl_surface, (EGLSurface)argbPixmapData->gl_surface, qPixmapARGBSharedEglContext); @@ -134,7 +134,7 @@ if (!qt_createEGLSurfaceForPixmap(rgbPixmapData, false)) break; - haveX11Pixmaps = eglMakeCurrent(QEglContext::defaultDisplay(0), + haveX11Pixmaps = eglMakeCurrent(QEglContext::display(), (EGLSurface)rgbPixmapData->gl_surface, (EGLSurface)rgbPixmapData->gl_surface, qPixmapRGBSharedEglContext); @@ -147,7 +147,7 @@ } while (0); if (qPixmapARGBSharedEglContext || qPixmapRGBSharedEglContext) { - eglMakeCurrent(QEglContext::defaultDisplay(0), + eglMakeCurrent(QEglContext::display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } @@ -167,12 +167,12 @@ if (!haveX11Pixmaps) { // Clean up the context(s) if we can't use X11GL pixmaps if (qPixmapARGBSharedEglContext != EGL_NO_CONTEXT) - eglDestroyContext(QEglContext::defaultDisplay(0), qPixmapARGBSharedEglContext); + eglDestroyContext(QEglContext::display(), qPixmapARGBSharedEglContext); if (qPixmapRGBSharedEglContext != qPixmapARGBSharedEglContext && qPixmapRGBSharedEglContext != EGL_NO_CONTEXT) { - eglDestroyContext(QEglContext::defaultDisplay(0), qPixmapRGBSharedEglContext); + eglDestroyContext(QEglContext::display(), qPixmapRGBSharedEglContext); } qPixmapRGBSharedEglContext = EGL_NO_CONTEXT; qPixmapARGBSharedEglContext = EGL_NO_CONTEXT; @@ -212,7 +212,6 @@ ctx = new QGLContext(glFormat()); if (ctx->d_func()->eglContext == 0) ctx->d_func()->eglContext = new QEglContext(); - ctx->d_func()->eglContext->openDisplay(0); // ;-) ctx->d_func()->eglContext->setApi(QEgl::OpenGL); ctx->d_func()->eglContext->setContext(hasAlphaChannel() ? qPixmapARGBSharedEglContext : qPixmapRGBSharedEglContext);