diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 39dd82419b..e28945e501 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -338,9 +338,15 @@ void EglOnXBackend::prepareRenderingFrame() void EglOnXBackend::endRenderingFrame(const QRegion &damage) { setLastDamage(damage); - glFlush(); + if (!blocksForRetrace()) { - present(); // this sets lastDamage emtpy and prevents execution from prepareRenderingFrame() + // This also sets lastDamage to empty which prevents the frame from + // being posted again when prepareRenderingFrame() is called. + present(); + } else { + // Make sure that the GPU begins processing the command stream + // now and not the next time prepareRenderingFrame() is called. + glFlush(); } if (overlayWindow()->window()) // show the window only after the first pass, diff --git a/glxbackend.cpp b/glxbackend.cpp index f1b9a6a598..70973b2917 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -511,9 +511,15 @@ void GlxBackend::prepareRenderingFrame() void GlxBackend::endRenderingFrame(const QRegion &damage) { setLastDamage(damage); - glFlush(); + if (!blocksForRetrace()) { - present(); // this sets lastDamage emtpy and prevents execution from prepareRenderingFrame() + // This also sets lastDamage to empty which prevents the frame from + // being posted again when prepareRenderingFrame() is called. + present(); + } else { + // Make sure that the GPU begins processing the command stream + // now and not the next time prepareRenderingFrame() is called. + glFlush(); } if (overlayWindow()->window()) // show the window only after the first pass,