Properly clip the damage region and windows in SceneQPainter

Summary:
On the framebuffer backend the software rendered cursor was creating
rendering artifacts due to incorrect clipping. This change ensures that
in a single screen setup the clipping is performed correctly. For multi
screen a similar change might be required, but we currently don't have
any a way to test that as framebuffer only supports one screen and other
(visual) platforms don't support the software cursor.

CCBUG: 356328

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2024
remotes/origin/Plasma/5.7
Martin Gräßlin 10 years ago
parent 3c6dff75d5
commit fd19db0fbe
  1. 7
      scene_qpainter.cpp

@ -171,6 +171,8 @@ qint64 SceneQPainter::paint(QRegion damage, ToplevelList toplevels)
m_backend->present(mask, overallUpdate);
} else {
m_painter->begin(m_backend->buffer());
m_painter->setClipping(true);
m_painter->setClipRegion(damage);
if (m_backend->needsFullRepaint()) {
mask |= Scene::PAINT_SCREEN_BACKGROUND_FIRST;
damage = QRegion(0, 0, displayWidth(), displayHeight());
@ -267,10 +269,10 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa
QPainter *scenePainter = m_scene->painter();
QPainter *painter = scenePainter;
painter->save();
painter->setClipRegion(region);
painter->setClipping(true);
painter->save();
painter->translate(x(), y());
if (mask & PAINT_WINDOW_TRANSFORMED) {
painter->translate(data.xTranslation(), data.yTranslation());
@ -317,9 +319,6 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa
}
painter->restore();
painter->setClipRegion(QRegion());
painter->setClipping(false);
}
void SceneQPainter::Window::renderShadow(QPainter* painter)

Loading…
Cancel
Save