Commit 838d7e7a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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 9b09f039)
parent 9ae4021e
......@@ -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
......
......@@ -680,8 +680,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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment