Skip to content

Use correct shaped texture filtering

From the commit message:

We checked that the content size was appropriately painted in the stage, but didn't take into account that the size of the sampled texture region, meaning that when stage views were scaled, we'd think that we would draw a texture scaled, as e.g. a 200x200 sized texture with buffer scale 2 would have the size 100x100. When stage views were not scaled, we'd apply a geometry scale meaning it'd end up as 200x200 anyway, thus pass the check, but when stage views are scaled, it'd still be painted as a 100x100 shaped texture on the stage, thus failing the are-we-unscaled test.

Fix this by comparing the transformed paint size with the sampled size, instead of the paint size again, when checking whether we are being painted scaled or not. For example, when stage views are scaled, our 200x200 buffer with buffer scale 2, thus content size 100x100 will transform to a 200x200 paint command, thus passing the test. For non-scaled stage views, our 200x200 buffer with buffer scale 2 thus content size 100x100 will also transform into a 200x200 paint command, and will also pass the check, as the texture sample region is still 200x200.


This makes the shaped texture use the right filter in the cases I've tried:

Nearest is now used when:

  • integer scaled stage views with matching shaped texture buffer scale (including when using viewports)
  • geometry scaled window actors with matching shaped texture buffer scale (also including using viewports)

Otherwise linear.

I used a specially crafted test client that can now be found here to test viewports.

Merge request reports