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

icc-effect-5.14.5
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");