Commit 8599deba authored by David Edmundson's avatar David Edmundson Committed by Nate Graham
Browse files

Fix scripted shader effect animations

AnimationEffect inherits from CrossfadeEffect as it may do a crossfade,
but it also has to perform non-crossfading activities with a custom
shader.

For crossfades we want to draw the old and new window, but this isn't
needed where the crossFadeProgress remains at 0.

BUG: 460277


(cherry picked from commit 36440a9d)
parent ec1d0644
Pipeline #246529 failed with stage
in 14 minutes and 25 seconds
......@@ -251,7 +251,7 @@ WindowPaintData::WindowPaintData(const QMatrix4x4 &screenProjectionMatrix)
setSaturation(1.0);
setBrightness(1.0);
setScreen(0);
setCrossFadeProgress(1.0);
setCrossFadeProgress(0.0);
}
WindowPaintData::WindowPaintData(const WindowPaintData &other)
......
......@@ -280,16 +280,21 @@ void CrossFadeEffect::drawWindow(EffectWindow *window, int mask, const QRegion &
{
Q_UNUSED(mask)
CrossFadeWindowData *offscreenData = d->windows.value(window);
// paint the new window (if applicable) underneath
Effect::drawWindow(window, mask, region, data);
if (data.crossFadeProgress() > 0 || !offscreenData) {
Effect::drawWindow(window, mask, region, data);
}
// paint old snapshot on top
WindowPaintData previousWindowData = data;
previousWindowData.setOpacity((1.0 - data.crossFadeProgress()) * data.opacity());
CrossFadeWindowData *offscreenData = d->windows[window];
if (!offscreenData) {
return;
}
// paint old snapshot on top
WindowPaintData previousWindowData = data;
previousWindowData.setOpacity((1.0 - data.crossFadeProgress()) * data.opacity());
const QRectF expandedGeometry = window->expandedGeometry();
const QRectF frameGeometry = window->frameGeometry();
......
Supports Markdown
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