From e185e5f008f6852bd7a79d74262717c8e377b918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 5 Jan 2011 08:25:56 +0100 Subject: Restored old flushing behavior in -graphicssystem opengl on desktop. Change 284211ccbd2cbd recently introduced a fix for EGL, to prevent flushing when nothing has been rendered into the back buffer. However, the skip should only be done when there's no partial update support in the window surface. If there is partial update support we can still flush as usual. Reviewed-by: Gunnar Sletta --- src/opengl/qwindowsurface_gl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index b8716ce..7243f02 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -520,9 +520,10 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & // did_paint is set to true in ::beginPaint. ::beginPaint means that we // at least cleared the background (= painted something). In EGL API it's a - // mistakte to call swapBuffers if nothing was painted. This check protects - // the flush func from being executed if it's for nothing. - if (!d_ptr->did_paint) + // mistake to call swapBuffers if nothing was painted unless + // EGL_BUFFER_PRESERVED is set. This check protects the flush func from + // being executed if it's for nothing. + if (!hasPartialUpdateSupport() && !d_ptr->did_paint) return; QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget(); -- cgit v0.12