From b8f2f87672bc04f8f1beddcd68b405d8ee481fba Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 21 Nov 2023 17:18:51 +0200 Subject: [PATCH] plugins/screentransform: Drop m_captured flag It's redundant now. If there's an entry in m_states dictionary for the given screen, then there's also a valid captured previous frame. --- src/plugins/screentransform/screentransform.cpp | 7 ++----- src/plugins/screentransform/screentransform.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/screentransform/screentransform.cpp b/src/plugins/screentransform/screentransform.cpp index 067edf4c00..e457c43d2e 100644 --- a/src/plugins/screentransform/screentransform.cpp +++ b/src/plugins/screentransform/screentransform.cpp @@ -101,9 +101,6 @@ void ScreenTransformEffect::addScreen(Output *screen) RenderTarget renderTarget(state.m_prev.framebuffer.get()); scene->paint(renderTarget, screen->geometry()); - - // Now, the effect can cross-fade between current and previous state. - state.m_captured = true; } else { m_states.remove(screen); } @@ -122,7 +119,7 @@ void ScreenTransformEffect::removeScreen(Output *screen) void ScreenTransformEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) { auto it = m_states.find(data.screen); - if (it != m_states.end() && it->m_captured) { + if (it != m_states.end()) { it->m_timeLine.advance(presentTime); if (it->m_timeLine.done()) { m_states.remove(data.screen); @@ -195,7 +192,7 @@ static QRectF lerp(const QRectF &a, const QRectF &b, qreal t) void ScreenTransformEffect::paintScreen(const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion ®ion, KWin::Output *screen) { auto it = m_states.find(screen); - if (it == m_states.end() || !it->m_captured) { + if (it == m_states.end()) { effects->paintScreen(renderTarget, viewport, mask, region, screen); return; } diff --git a/src/plugins/screentransform/screentransform.h b/src/plugins/screentransform/screentransform.h index cafbc71e40..80eca37a3d 100644 --- a/src/plugins/screentransform/screentransform.h +++ b/src/plugins/screentransform/screentransform.h @@ -52,7 +52,6 @@ private: QRect m_oldGeometry; OutputTransform m_oldTransform; qreal m_angle = 0; - bool m_captured = false; }; void addScreen(Output *screen);