e08d52bb introduced a bug when rotating by 90 or 270 degrees and doing
non-uniform scaling (different scale factor on X and Y axes). The scale
factor was calculated as the ratio between the src box and the rotated
dst box. But scaling is applied after rotation, so the scale factor
should instead be the ratio between rotated src box and dst box.
Reverts 77006e5565. It turns out this
change really breaks the labwc drop-shadow implementation (which relies
on scaling up single-pixel-wide buffers).
After reverting this there's still something subtley wrong with scaling
pixel locations (shown by `weston-scaler -b`) but I can't see an obvious
way to make both weston-scaler and labwc drop-shadows work in the same
way with pixman and gles2. I'll have a harder look at this but in the
mean time reverting this patch seems to make things less broken on
average.
The old code to render transformed textures with pixman would run
composite over the whole output regardless of the texture size. When
rendering something small this caused a huge performance hit.
Rewrite the transform branch of render_pass_add_texture to:
- Only composite over the rectangle we're drawing to
- Generally try to make things a lot clearer and some comments
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3832
Fix source crop in the pixman render backend. It was being applied by
using a source offset as arguments to pixman_image_composite32(). But
this is wrong because the source crop should get applied before all the
other transforms, not after them (or at least this is how it works in
the other wlroots render backends). Instead, apply the source crop as
yet another matrix transform when we're doing transforms (Or keep it the
same as previously if there's no other transforming going on).
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3830
The translations for flipped offsets were set the same as non-flipped
ones which was totally wrong and meant that any textures with
flipped-transforms rendered entirely outside the viewport and were
basically invisible.