kwin: don't wait for vsync when nothing has been painted

This commit is contained in:
Philipp Knechtges 2012-01-12 21:01:56 +01:00
parent 815a0fe681
commit dbc48c91f9
2 changed files with 6 additions and 3 deletions

View file

@ -190,7 +190,9 @@ void SceneOpenGL::paint(QRegion damage, ToplevelList toplevels)
if (m_overlayWindow->window()) // show the window only after the first pass, since
m_overlayWindow->show(); // that pass may take long
lastRenderTime = renderTimer.elapsed();
flushBuffer(mask, damage);
if (!damage.isEmpty()) {
flushBuffer(mask, damage);
}
// do cleanup
stacking_order.clear();
checkGLError("PostPaint");
@ -203,7 +205,6 @@ void SceneOpenGL::waitSync()
void SceneOpenGL::flushBuffer(int mask, QRegion damage)
{
Q_UNUSED(damage)
glFlush();
if (mask & PAINT_SCREEN_REGION && surfaceHasSubPost && eglPostSubBufferNV) {
QRect damageRect = damage.boundingRect();

View file

@ -465,7 +465,9 @@ void SceneOpenGL::paint(QRegion damage, ToplevelList toplevels)
if (m_overlayWindow->window()) // show the window only after the first pass, since
m_overlayWindow->show(); // that pass may take long
lastRenderTime = renderTimer.elapsed();
flushBuffer(mask, damage);
if (!damage.isEmpty()) {
flushBuffer(mask, damage);
}
// do cleanup
stacking_order.clear();
checkGLError("PostPaint");