user avatar
Fix effects for dynamic source item updates
Eskil Abrahamsen Blomfeldt authored
d53af701 aimed to fix graphical
effects when the image source was cleared programmatically after
the shader effect had been initialized.

The fix made the assumption that the source size of the proxy
had been bound to the size of the input, but this turned out
to be wrong for many of the effects.

Further investigation revealed that the graphical effects were
never written to support source items with properties that
change. For instance, if you initialize the source image with
fill mode == Stretch, it would pick the direct throughput
mode and this would stick, even if you change the fill mode
later on, causing rendering errors.

Similarly, if you dynamically add children to a childless
source item at runtime, the effect would not be applied to
these items since the proxy render mode is required for that.

d53af701

 was only added to
5.15 because that is where the regression is visible, but
it turns out that this is a general problem in effects which
is also visible in Qt 6, both as rendering errors and also
as unpredictable performance implications, where the order
of operations can decide which mode of throughput you would
end up with.

The fix is to redo the polish whenever someone changes any
of the properties that might affect the choice of code path.

Task-number: QTBUG-84686
Pick-to: 5.15
Change-Id: I4af494a7a7fabe496e2d3442084cb823ec177b04
Reviewed-by: default avatarLaszlo Agocs <laszlo.agocs@qt.io>
3a7181de