effects: Drop EffectWindow::(un)referencePreviousWindowPixmap

This commit is contained in:
Vlad Zahorodnii 2023-02-03 22:25:00 +02:00
parent 89283c4cc6
commit a3748b8e48
6 changed files with 2 additions and 78 deletions

View file

@ -2281,16 +2281,6 @@ void EffectWindowImpl::closeWindow()
}
}
void EffectWindowImpl::referencePreviousWindowPixmap()
{
// TODO: Implement.
}
void EffectWindowImpl::unreferencePreviousWindowPixmap()
{
// TODO: Implement.
}
bool EffectWindowImpl::isManaged() const
{
return managed;

View file

@ -479,9 +479,6 @@ public:
void unminimize() override;
void closeWindow() override;
void referencePreviousWindowPixmap() override;
void unreferencePreviousWindowPixmap() override;
QWindow *internalWindow() const override;
const Window *window() const;

View file

@ -31,21 +31,6 @@ FullScreenEffectLock::~FullScreenEffectLock()
effects->setActiveFullScreenEffect(nullptr);
}
PreviousWindowPixmapLock::PreviousWindowPixmapLock(EffectWindow *w)
: m_window(w)
{
m_window->referencePreviousWindowPixmap();
}
PreviousWindowPixmapLock::~PreviousWindowPixmapLock()
{
m_window->unreferencePreviousWindowPixmap();
// Add synthetic repaint to prevent glitches after cross-fading
// translucent windows.
effects->addRepaint(m_window->expandedGeometry().toAlignedRect());
}
AniData::AniData()
: attribute(AnimationEffect::Opacity)
, customCurve(0) // Linear
@ -60,7 +45,7 @@ AniData::AniData()
AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_,
int delay, const FPx2 &from_, bool waitAtSource_,
FullScreenEffectLockPtr fullScreenEffectLock_, bool keepAlive,
PreviousWindowPixmapLockPtr previousWindowPixmapLock_, GLShader *shader)
GLShader *shader)
: attribute(a)
, from(from_)
, to(to_)
@ -70,7 +55,6 @@ AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_,
, fullScreenEffectLock(std::move(fullScreenEffectLock_))
, waitAtSource(waitAtSource_)
, keepAlive(keepAlive)
, previousWindowPixmapLock(std::move(previousWindowPixmapLock_))
, shader(shader)
{
}

View file

@ -31,21 +31,6 @@ private:
};
typedef QSharedPointer<FullScreenEffectLock> FullScreenEffectLockPtr;
/**
* References the previous window pixmap to prevent discarding.
*/
class PreviousWindowPixmapLock
{
public:
PreviousWindowPixmapLock(EffectWindow *w);
~PreviousWindowPixmapLock();
private:
EffectWindow *m_window;
Q_DISABLE_COPY(PreviousWindowPixmapLock)
};
typedef QSharedPointer<PreviousWindowPixmapLock> PreviousWindowPixmapLockPtr;
class KWINEFFECTS_EXPORT AniData
{
public:
@ -53,7 +38,7 @@ public:
AniData(AnimationEffect::Attribute a, int meta, const FPx2 &to,
int delay, const FPx2 &from, bool waitAtSource,
FullScreenEffectLockPtr = FullScreenEffectLockPtr(),
bool keepAlive = true, PreviousWindowPixmapLockPtr previousWindowPixmapLock = {}, GLShader *shader = nullptr);
bool keepAlive = true, GLShader *shader = nullptr);
bool isActive() const;
@ -76,7 +61,6 @@ public:
bool keepAlive;
EffectWindowDeletedRef deletedRef;
EffectWindowVisibleRef visibleRef;
PreviousWindowPixmapLockPtr previousWindowPixmapLock;
AnimationEffect::TerminationFlags terminationFlags;
GLShader *shader{nullptr};
};

View file

@ -232,7 +232,6 @@ quint64 AnimationEffect::p_animate(EffectWindow *w, Attribute a, uint meta, int
}
}
PreviousWindowPixmapLockPtr previousPixmap;
if (a == CrossFadePrevious) {
CrossFadeEffect::redirect(w);
}
@ -246,7 +245,6 @@ quint64 AnimationEffect::p_animate(EffectWindow *w, Attribute a, uint meta, int
waitAtSource, // Whether the animation should be kept at source
fullscreen, // Full screen effect lock
keepAlive, // Keep alive flag
previousPixmap, // Previous window pixmap lock
shader
));

View file

@ -2654,35 +2654,6 @@ public:
Q_SCRIPTABLE virtual void setData(int role, const QVariant &data) = 0;
Q_SCRIPTABLE virtual QVariant data(int role) const = 0;
/**
* @brief References the previous window pixmap to prevent discarding.
*
* This method allows to reference the previous window pixmap in case that a window changed
* its size, which requires a new window pixmap. By referencing the previous (and then outdated)
* window pixmap an effect can for example cross fade the current window pixmap with the previous
* one. This allows for smoother transitions for window geometry changes.
*
* If an effect calls this method on a window it also needs to call unreferencePreviousWindowPixmap
* once it does no longer need the previous window pixmap.
*
* Note: the window pixmap is not kept forever even when referenced. If the geometry changes again, so that
* a new window pixmap is created, the previous window pixmap will be exchanged with the current one. This
* means it's still possible to have rendering glitches. An effect is supposed to track for itself the changes
* to the window's geometry and decide how the transition should continue in such a situation.
*
* @see unreferencePreviousWindowPixmap
* @since 4.11
*/
virtual void referencePreviousWindowPixmap() = 0;
/**
* @brief Unreferences the previous window pixmap. Only relevant after referencePreviousWindowPixmap had
* been called.
*
* @see referencePreviousWindowPixmap
* @since 4.11
*/
virtual void unreferencePreviousWindowPixmap() = 0;
protected:
friend EffectWindowVisibleRef;
virtual void refVisible(const EffectWindowVisibleRef *holder) = 0;