From 3ae400772b3cece751c1f8e61c747b1f096128df Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 10 Jun 2021 13:50:06 +0300 Subject: [PATCH] kwineffects: Remove dead code AnimationEffect sets the clip region to clip windows, so this code can be safely removed. --- src/libkwineffects/kwinanimationeffect.cpp | 45 ---------------------- src/libkwineffects/kwinanimationeffect.h | 1 - 2 files changed, 46 deletions(-) diff --git a/src/libkwineffects/kwinanimationeffect.cpp b/src/libkwineffects/kwinanimationeffect.cpp index 742ed01984..ace4c27255 100644 --- a/src/libkwineffects/kwinanimationeffect.cpp +++ b/src/libkwineffects/kwinanimationeffect.cpp @@ -447,49 +447,6 @@ QRect AnimationEffect::clipRect(const QRect &geo, const AniData &anim) const return clip; } -void AnimationEffect::clipWindow(const EffectWindow *w, const AniData &anim, WindowQuadList &quads) const -{ - return; - const QRect geo = w->expandedGeometry(); - QRect clip = AnimationEffect::clipRect(geo, anim); - WindowQuadList filtered; - if (clip.left() != geo.left()) { - quads = quads.splitAtX(clip.left()); - Q_FOREACH (const WindowQuad &quad, quads) { - if (quad.right() >= clip.left()) - filtered << quad; - } - quads = filtered; - filtered.clear(); - } - if (clip.right() != geo.right()) { - quads = quads.splitAtX(clip.left()); - Q_FOREACH (const WindowQuad &quad, quads) { - if (quad.right() <= clip.right()) - filtered << quad; - } - quads = filtered; - filtered.clear(); - } - if (clip.top() != geo.top()) { - quads = quads.splitAtY(clip.top()); - Q_FOREACH (const WindowQuad &quad, quads) { - if (quad.top() >= clip.top()) - filtered << quad; - } - quads = filtered; - filtered.clear(); - } - if (clip.bottom() != geo.bottom()) { - quads = quads.splitAtY(clip.bottom()); - Q_FOREACH (const WindowQuad &quad, quads) { - if (quad.bottom() <= clip.bottom()) - filtered << quad; - } - quads = filtered; - } -} - void AnimationEffect::disconnectGeometryChanges() { disconnect(effects, &EffectsHandler::windowExpandedGeometryChanged, @@ -513,8 +470,6 @@ void AnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, data.setTranslucent(); else if (!(anim->attribute == Brightness || anim->attribute == Saturation)) { data.setTransformed(); - if (anim->attribute == Clip) - clipWindow(w, *anim, data.quads); } paintDeleted |= anim->keepAlive; diff --git a/src/libkwineffects/kwinanimationeffect.h b/src/libkwineffects/kwinanimationeffect.h index 7e9df62b87..b93743b8bb 100644 --- a/src/libkwineffects/kwinanimationeffect.h +++ b/src/libkwineffects/kwinanimationeffect.h @@ -377,7 +377,6 @@ protected: private: quint64 p_animate(EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, const QEasingCurve &curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect, bool keepAlive); QRect clipRect(const QRect &windowRect, const AniData&) const; - void clipWindow(const EffectWindow *, const AniData &, WindowQuadList &) const; float interpolated( const AniData&, int i = 0 ) const; float progress( const AniData& ) const; void disconnectGeometryChanges();