diff options
Diffstat (limited to 'src/opengl/qpixmapdata_x11gl_egl.cpp')
-rw-r--r-- | src/opengl/qpixmapdata_x11gl_egl.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp index 58d34fc..2c11a0b 100644 --- a/src/opengl/qpixmapdata_x11gl_egl.cpp +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp @@ -74,7 +74,6 @@ public: EGLint rgbConfigId; EGLint argbConfigId; - do { EGLConfig rgbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL, QEgl::Renderable); EGLConfig argbConfig = QEgl::defaultConfig(QInternal::Pixmap, QEgl::OpenGL, @@ -138,6 +137,7 @@ public: valid = argbContext->makeCurrent(argbPixmapSurface); argbContext->doneCurrent(); eglDestroySurface(QEgl::display(), argbPixmapSurface); + argbPixmapData->gl_surface = 0; } if (!valid) { @@ -150,7 +150,6 @@ public: QGLTextureCache::instance(); } while(0); - if (!valid) cleanup(); else @@ -158,6 +157,10 @@ public: } + ~QX11GLSharedContexts() { + cleanup(); + } + void cleanup() { if (sharedQGLContext) { delete sharedQGLContext; @@ -216,18 +219,16 @@ QX11GLSharedContexts* QX11GLPixmapData::sharedContexts() bool QX11GLPixmapData::hasX11GLPixmaps() { - static bool checkedForX11Pixmaps = false; - static bool haveX11Pixmaps = false; - - if (checkedForX11Pixmaps) - return haveX11Pixmaps; + static bool checkedForX11GLPixmaps = false; + static bool haveX11GLPixmaps = false; - checkedForX11Pixmaps = true; + if (checkedForX11GLPixmaps) + return haveX11GLPixmaps; - if (!qgetenv("QT_USE_X11GL_PIXMAPS").isEmpty() && sharedContexts()->isValid()) - haveX11Pixmaps = true; + haveX11GLPixmaps = qt_x11gl_share_contexts()->isValid(); + checkedForX11GLPixmaps = true; - return haveX11Pixmaps; + return haveX11GLPixmaps; } QX11GLPixmapData::QX11GLPixmapData() |