Skip to content

Backport "effects/screentransform: Do proper cross-fading"

Vlad Zahorodnii requested to merge work/zzag/backport-screen-transform into Plasma/5.25

In general, I think it should be a safe change to backport - it fixes the animation (it looks broken in git master, not sure why, looks like something matrix related) and for the reasons explained in the original commit message.


At the moment, the effect that animates the screen works as follows:

  • render the screen before it's rotated in an offscreen texture
  • after screen rotated, paint the offscreen texture in the first half of the animation but not the screen contents after rotation and in the second half of the animation, paint the live screen contents

This works but it doesn't take into account things such as blur (I can see that the region around where the panel should be doesn't look as expected).

This change makes the screen transform effect do proper cross-fading, i.e. save the screen before it's rotated in an offscreen texture, render the current screen in an offscreen texture, and produce the final result by cross-fading between two offscreen textures in a shader.

Besides fixing the visuals of the effect, another motivation behind this change is to reduce the number of ScreenPaintData transforms, which can be very handy in simplifying item painting code.

(cherry picked from commit a8596083)

Merge request reports