lottietoqml: Use defs nodes for precompositions
Using the QML Component/Loader mechanism, defs nodes allow a subtree
to be defined once, and then cheaply instantiated multiple times. This
is very well suited for Lottie precomps.
With this commit, we generate defs nodes for all defined
precompositions during the initial root node visit. Then when visiting
PrecompLayer nodes, we generate only an instantiation of the
referenced precomp node.
Extra care is taken to give the instantiated items access to the
bounds size of the instantiating precomp layer, since that may vary
for different instantiations, and must be correct for e.g. mask/matte
generation.
Fixes: QTBUG-135275
Change-Id: I2cbb4b5fcf1634cf348fbb4d5ccb445dce8c37b9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>