kwin: don't wait for vsync when nothing has been painted
This commit is contained in:
parent
815a0fe681
commit
dbc48c91f9
2 changed files with 6 additions and 3 deletions
|
@ -190,7 +190,9 @@ void SceneOpenGL::paint(QRegion damage, ToplevelList toplevels)
|
||||||
if (m_overlayWindow->window()) // show the window only after the first pass, since
|
if (m_overlayWindow->window()) // show the window only after the first pass, since
|
||||||
m_overlayWindow->show(); // that pass may take long
|
m_overlayWindow->show(); // that pass may take long
|
||||||
lastRenderTime = renderTimer.elapsed();
|
lastRenderTime = renderTimer.elapsed();
|
||||||
|
if (!damage.isEmpty()) {
|
||||||
flushBuffer(mask, damage);
|
flushBuffer(mask, damage);
|
||||||
|
}
|
||||||
// do cleanup
|
// do cleanup
|
||||||
stacking_order.clear();
|
stacking_order.clear();
|
||||||
checkGLError("PostPaint");
|
checkGLError("PostPaint");
|
||||||
|
@ -203,7 +205,6 @@ void SceneOpenGL::waitSync()
|
||||||
|
|
||||||
void SceneOpenGL::flushBuffer(int mask, QRegion damage)
|
void SceneOpenGL::flushBuffer(int mask, QRegion damage)
|
||||||
{
|
{
|
||||||
Q_UNUSED(damage)
|
|
||||||
glFlush();
|
glFlush();
|
||||||
if (mask & PAINT_SCREEN_REGION && surfaceHasSubPost && eglPostSubBufferNV) {
|
if (mask & PAINT_SCREEN_REGION && surfaceHasSubPost && eglPostSubBufferNV) {
|
||||||
QRect damageRect = damage.boundingRect();
|
QRect damageRect = damage.boundingRect();
|
||||||
|
|
|
@ -465,7 +465,9 @@ void SceneOpenGL::paint(QRegion damage, ToplevelList toplevels)
|
||||||
if (m_overlayWindow->window()) // show the window only after the first pass, since
|
if (m_overlayWindow->window()) // show the window only after the first pass, since
|
||||||
m_overlayWindow->show(); // that pass may take long
|
m_overlayWindow->show(); // that pass may take long
|
||||||
lastRenderTime = renderTimer.elapsed();
|
lastRenderTime = renderTimer.elapsed();
|
||||||
|
if (!damage.isEmpty()) {
|
||||||
flushBuffer(mask, damage);
|
flushBuffer(mask, damage);
|
||||||
|
}
|
||||||
// do cleanup
|
// do cleanup
|
||||||
stacking_order.clear();
|
stacking_order.clear();
|
||||||
checkGLError("PostPaint");
|
checkGLError("PostPaint");
|
||||||
|
|
Loading…
Reference in a new issue