Commit 72ad5dc8 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[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
parent 78ce54f8
......@@ -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);
......
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