Fix some errors in the handling of matte/mask layers
A mask layer normally applies to the immediately preceding
layer. However, when reordering the layers (since the mask must be
computed before the layer to be masked), the mask was placed at the
start of the whole list of layers, instead of just before the layer to
be masked. The result was that the masking was applied to the first layer in the list, instead of the intended one. Fix by adding a method to insert it at the right place.
When the code intended to disable painter clipping, it set the clip
region to an empty path. But that is a misunderstanding of the
QPainter API: the result is not disabled clipping, instead it enables
clipping of everything. Replace with the correct clip disabling call.
A check and warning that was intended to be emitted when the mask type
was unsupported tested the wrong variable.
Change-Id: I86b56276462245378b11f4783a76e9fe6261b9df
Pick-to: 6.9 6.8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>