diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-08-24 11:53:49 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-08-24 12:41:23 (GMT) |
commit | 3ba16e3923003a7919eb157ae3375792b714484e (patch) | |
tree | e368e460a938124a5d2047344bb8a84b5035a205 /src/opengl/qgl_x11egl.cpp | |
parent | d959edb97e039c6dbe3c3f11ddfea47ff7ff420f (diff) | |
download | Qt-3ba16e3923003a7919eb157ae3375792b714484e.zip Qt-3ba16e3923003a7919eb157ae3375792b714484e.tar.gz Qt-3ba16e3923003a7919eb157ae3375792b714484e.tar.bz2 |
Call eglReleaseThread() when a thread exits, and fix warnings.
In Qt we track the current context in a thread via a QThreadStorage.
The thread storage contents are deleted in the thread context, just
before it's destroyed. This means we can safely call eglReleaseThread()
in the QGLThreadContext destructor. We can then get rid of unnecessary
context swaps, since we don't need to take care to reset a thread
context back to 0 after having used e.g. the QGLShareContextScope
mechanism, which is good.
Reviewed-by: Samuel
Diffstat (limited to 'src/opengl/qgl_x11egl.cpp')
-rw-r--r-- | src/opengl/qgl_x11egl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index 9d28de0..1f7e60a 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -97,7 +97,6 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *) XVisualInfo visualInfo; XVisualInfo *vi; int numVisuals; - EGLint id = 0; visualInfo.visualid = QEgl::getCompatibleVisualId(config); vi = XGetVisualInfo(X11->display, VisualIDMask, &visualInfo, &numVisuals); @@ -346,7 +345,7 @@ void QGLWidgetPrivate::recreateEglSurface() // old surface before re-creating a new one. Note: This should not be the case as the // surface should be deleted before the old window id. if (glcx->d_func()->eglSurface != EGL_NO_SURFACE && (currentId != eglSurfaceWindowId)) { - qWarning("EGL surface for deleted window %x was not destroyed", eglSurfaceWindowId); + qWarning("EGL surface for deleted window %lx was not destroyed", eglSurfaceWindowId); glcx->d_func()->destroyEglSurfaceForDevice(); } |