diff options
author | Janne Koskinen <janne.p.koskinen@digia.com> | 2010-04-23 14:08:48 (GMT) |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@digia.com> | 2010-04-23 14:08:48 (GMT) |
commit | fecce960a050ef2964e28f373bf1a35f7d9949a3 (patch) | |
tree | 296ef35071a80076a5186e71696cddc88cc1a56f /src/opengl/qgl_x11egl.cpp | |
parent | 02c65146610cdd5bfe1f3ee4656ba07af82afcc7 (diff) | |
parent | 15088d236924bccee787953e04214f87392e8e55 (diff) | |
download | Qt-fecce960a050ef2964e28f373bf1a35f7d9949a3.zip Qt-fecce960a050ef2964e28f373bf1a35f7d9949a3.tar.gz Qt-fecce960a050ef2964e28f373bf1a35f7d9949a3.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-webkit into 4.7
Diffstat (limited to 'src/opengl/qgl_x11egl.cpp')
-rw-r--r-- | src/opengl/qgl_x11egl.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index d67a3ea..c0b1515 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -335,24 +335,24 @@ void QGLWidget::setColormap(const QGLColormap &) { } -// Re-creates the EGL surface if the window ID has changed or if force is true -void QGLWidgetPrivate::recreateEglSurface(bool force) +// Re-creates the EGL surface if the window ID has changed or if there isn't a surface +void QGLWidgetPrivate::recreateEglSurface() { Q_Q(QGLWidget); Window currentId = q->winId(); - if ( force || (currentId != eglSurfaceWindowId) ) { - // The window id has changed so we need to re-create the EGL surface - QEglContext *ctx = glcx->d_func()->eglContext; - EGLSurface surface = glcx->d_func()->eglSurface; - if (surface != EGL_NO_SURFACE) - ctx->destroySurface(surface); // Will force doneCurrent() if nec. - surface = ctx->createSurface(q); - if (surface == EGL_NO_SURFACE) - qWarning("Error creating EGL window surface: 0x%x", eglGetError()); - glcx->d_func()->eglSurface = surface; + // If the window ID has changed since the surface was created, we need to delete the + // 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); + glcx->d_func()->destroyEglSurfaceForDevice(); + } + if (glcx->d_func()->eglSurface == EGL_NO_SURFACE) { + qDebug("Re-creating the surface"); + glcx->d_func()->eglSurface = glcx->d_func()->eglContext->createSurface(q); eglSurfaceWindowId = currentId; } } |