kwin: Don't call glFlush() unnecessarily in endRenderingFrame()

We should only call glFlush() here if we're deferring the posting
of the back buffer to the next prepareRenderingFrame() call.
This commit is contained in:
Fredrik Höglund 2013-11-21 10:38:16 +01:00
parent d5e439aae0
commit 12446c9b4c
2 changed files with 16 additions and 4 deletions

View file

@ -338,9 +338,15 @@ void EglOnXBackend::prepareRenderingFrame()
void EglOnXBackend::endRenderingFrame(const QRegion &damage) void EglOnXBackend::endRenderingFrame(const QRegion &damage)
{ {
setLastDamage(damage); setLastDamage(damage);
glFlush();
if (!blocksForRetrace()) { 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, if (overlayWindow()->window()) // show the window only after the first pass,

View file

@ -511,9 +511,15 @@ void GlxBackend::prepareRenderingFrame()
void GlxBackend::endRenderingFrame(const QRegion &damage) void GlxBackend::endRenderingFrame(const QRegion &damage)
{ {
setLastDamage(damage); setLastDamage(damage);
glFlush();
if (!blocksForRetrace()) { 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, if (overlayWindow()->window()) // show the window only after the first pass,