[effects/slide] Delete redundant checks
Summary: If isActive() returns false, neither paintScreen nor paintWindow nor postPaintScreen will be called. So, `if (m_active)` checks are redundant. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D15708
This commit is contained in:
parent
78ce54f88a
commit
72ad5dc894
1 changed files with 9 additions and 16 deletions
|
@ -128,11 +128,6 @@ inline QRegion buildClipRegion(const QPoint &pos, int w, int h)
|
|||
|
||||
void SlideEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data)
|
||||
{
|
||||
if (!m_active) {
|
||||
effects->paintScreen(mask, region, data);
|
||||
return;
|
||||
}
|
||||
|
||||
const bool wrap = effects->optionRollOverDesktops();
|
||||
const int w = workspaceWidth();
|
||||
const int h = workspaceHeight();
|
||||
|
@ -265,23 +260,21 @@ bool SlideEffect::isPainted(const EffectWindow *w) const
|
|||
|
||||
void SlideEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time)
|
||||
{
|
||||
if (m_active) {
|
||||
const bool painted = isPainted(w);
|
||||
if (painted) {
|
||||
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
|
||||
} else {
|
||||
w->disablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
|
||||
}
|
||||
if (painted && isTranslated(w)) {
|
||||
data.setTransformed();
|
||||
}
|
||||
const bool painted = isPainted(w);
|
||||
if (painted) {
|
||||
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
|
||||
} else {
|
||||
w->disablePainting(EffectWindow::PAINT_DISABLED_BY_DESKTOP);
|
||||
}
|
||||
if (painted && isTranslated(w)) {
|
||||
data.setTransformed();
|
||||
}
|
||||
effects->prePaintWindow(w, data, time);
|
||||
}
|
||||
|
||||
void SlideEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
|
||||
{
|
||||
if (m_active && isTranslated(w)) {
|
||||
if (isTranslated(w)) {
|
||||
data += m_paintCtx.translation;
|
||||
}
|
||||
effects->paintWindow(w, mask, region, data);
|
||||
|
|
Loading…
Reference in a new issue