kwin: make decoration repaints window-specific

This gives the new Scene::paintSimpleScreen more room for optimizations.
This commit is contained in:
Philipp Knechtges 2011-07-15 10:27:11 +02:00
parent 7025e72d87
commit fc5e74f4e2
3 changed files with 12 additions and 2 deletions

View file

@ -500,8 +500,9 @@ void Client::repaintDecorationPending()
// The scene will update the decoration pixmaps in the next painting pass
// if it has not been already repainted before
const QRegion r = paintRedirector->scheduledRepaintRegion();
if (!r.isEmpty())
Workspace::self()->addRepaint(r.translated(x() - padding_left, y() - padding_top));
if (!r.isEmpty()) {
addRepaint(r.translated(-padding_left,-padding_top));
}
}
}

View file

@ -748,6 +748,14 @@ void Toplevel::addRepaint(int x, int y, int w, int h)
workspace()->checkCompositeTimer();
}
void Toplevel::addRepaint(const QRegion& r)
{
if (!compositing())
return;
repaints_region += r;
workspace()->checkCompositeTimer();
}
void Toplevel::addRepaintFull()
{
repaints_region = decorationRect();

View file

@ -124,6 +124,7 @@ public:
bool unredirected() const;
void suspendUnredirect(bool suspend);
void addRepaint(const QRect& r);
void addRepaint(const QRegion& r);
void addRepaint(int x, int y, int w, int h);
virtual void addRepaintFull();
// these call workspace->addRepaint(), but first transform the damage if needed