From afba7910d6805c615c648f938a4fb53a10f0710d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 29 Mar 2011 12:20:40 +0200 Subject: Fixed bad merges in GL windowsurface and get rid of redundant variable. Reviewed-by: Jani Hautakangas --- src/opengl/qwindowsurface_gl.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 3815f7b..77f6103 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -492,7 +492,14 @@ void QGLWindowSurface::hijackWindow(QWidget *widget) qDebug() << "Found EGL_NOK_swap_region2 extension. Using partial updates."; } - d_ptr->destructive_swap_buffers = !swapBehaviourPreserved; + d_ptr->destructive_swap_buffers = true; + if (ctx->d_func()->eglContext->configAttrib(EGL_SURFACE_TYPE)&EGL_SWAP_BEHAVIOR_PRESERVED_BIT) { + EGLint swapBehavior; + if (eglQuerySurface(ctx->d_func()->eglContext->display(), ctx->d_func()->eglSurface + , EGL_SWAP_BEHAVIOR, &swapBehavior)) { + d_ptr->destructive_swap_buffers = (swapBehavior != EGL_BUFFER_PRESERVED); + } + } d_ptr->swap_region_support = haveNOKSwapRegion; #endif @@ -910,7 +917,7 @@ void QGLWindowSurface::updateGeometry() { ctx->d_func()->eglContext->config()); eglGetError(); // Clear error state. - if (hasPartialUpdateSupport()) { + if (!d_ptr->destructive_swap_buffers) { eglSurfaceAttrib(ctx->d_func()->eglContext->display(), ctx->d_func()->eglSurface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); -- cgit v0.12