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.
(cherry picked from commit 9b09f0399f
)
icc-effect-5.20.5
parent
9ae4021ef4
commit
838d7e7a14
|
@ -705,6 +705,9 @@ void Compositor::performCompositing()
|
||||||
surface->frameRendered(currentTime);
|
surface->frameRendered(currentTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!kwinApp()->platform()->isCursorHidden()) {
|
||||||
|
Cursors::self()->currentCursor()->markAsRendered();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop here to ensure *we* cause the next repaint schedule - not some effect
|
// Stop here to ensure *we* cause the next repaint schedule - not some effect
|
||||||
|
|
|
@ -680,8 +680,6 @@ void DrmBackend::setCursor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Cursors::self()->currentCursor()->markAsRendered();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrmBackend::updateCursor()
|
void DrmBackend::updateCursor()
|
||||||
|
|
|
@ -481,7 +481,6 @@ void X11WindowedBackend::createCursor(const QImage &srcImage, const QPoint &hots
|
||||||
}
|
}
|
||||||
m_cursor = cid;
|
m_cursor = cid;
|
||||||
xcb_flush(m_connection);
|
xcb_flush(m_connection);
|
||||||
Cursors::self()->currentCursor()->markAsRendered();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xcb_window_t X11WindowedBackend::rootWindow() const
|
xcb_window_t X11WindowedBackend::rootWindow() const
|
||||||
|
|
|
@ -601,9 +601,6 @@ void SceneOpenGL2::paintCursor()
|
||||||
binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
|
binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
|
||||||
m_cursorTexture->render(QRegion(cursorRect), cursorRect);
|
m_cursorTexture->render(QRegion(cursorRect), cursorRect);
|
||||||
m_cursorTexture->unbind();
|
m_cursorTexture->unbind();
|
||||||
|
|
||||||
cursor->markAsRendered();
|
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,6 @@ void SceneQPainter::paintCursor()
|
||||||
const QPoint cursorPos = cursor->pos();
|
const QPoint cursorPos = cursor->pos();
|
||||||
const QPoint hotspot = cursor->hotspot();
|
const QPoint hotspot = cursor->hotspot();
|
||||||
m_painter->drawImage(cursorPos - hotspot, img);
|
m_painter->drawImage(cursorPos - hotspot, img);
|
||||||
cursor->markAsRendered();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneQPainter::paintEffectQuickView(EffectQuickView *w)
|
void SceneQPainter::paintEffectQuickView(EffectQuickView *w)
|
||||||
|
|
Loading…
Reference in New Issue