Mark the cursor as rendered after performing compositing
If a cursor animation is driven purely by frame callbacks and kwin uses hardware cursors, the cpu usage may spike to 100%. This change addresses that issue by sending frame callbacks after a compositing cycle has been performed.
This commit is contained in:
parent
7cf74d7df7
commit
9b09f0399f
5 changed files with 3 additions and 7 deletions
|
@ -705,6 +705,9 @@ void Compositor::performCompositing()
|
|||
surface->frameRendered(currentTime);
|
||||
}
|
||||
}
|
||||
if (!kwinApp()->platform()->isCursorHidden()) {
|
||||
Cursors::self()->currentCursor()->markAsRendered();
|
||||
}
|
||||
}
|
||||
|
||||
// Stop here to ensure *we* cause the next repaint schedule - not some effect
|
||||
|
|
|
@ -544,8 +544,6 @@ void DrmBackend::setCursor()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cursors::self()->currentCursor()->markAsRendered();
|
||||
}
|
||||
|
||||
void DrmBackend::updateCursor()
|
||||
|
|
|
@ -481,7 +481,6 @@ void X11WindowedBackend::createCursor(const QImage &srcImage, const QPoint &hots
|
|||
}
|
||||
m_cursor = cid;
|
||||
xcb_flush(m_connection);
|
||||
Cursors::self()->currentCursor()->markAsRendered();
|
||||
}
|
||||
|
||||
xcb_window_t X11WindowedBackend::rootWindow() const
|
||||
|
|
|
@ -601,9 +601,6 @@ void SceneOpenGL2::paintCursor()
|
|||
binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
|
||||
m_cursorTexture->render(QRegion(cursorRect), cursorRect);
|
||||
m_cursorTexture->unbind();
|
||||
|
||||
cursor->markAsRendered();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,6 @@ void SceneQPainter::paintCursor()
|
|||
const QPoint cursorPos = cursor->pos();
|
||||
const QPoint hotspot = cursor->hotspot();
|
||||
m_painter->drawImage(cursorPos - hotspot, img);
|
||||
cursor->markAsRendered();
|
||||
}
|
||||
|
||||
void SceneQPainter::paintEffectQuickView(EffectQuickView *w)
|
||||
|
|
Loading…
Reference in a new issue