Skip to content

shaped-texture: Only check for fb transforms if the texture isn't scaled

Since we allow MetaShapedTextures to be drawn in a different size than they are rendered in (dst_width/height vs cogl-texture width/height), only looking at the transformation matrix applied to the framebuffer isn't enough to determine if the texture is going to end up on the screen untransformed.

So only apply the optimization to use NEAREST interpolation if the texture is the same size as the paint size and the framebuffer does not have transformations applied. This solution is correct, but missing one case, that is when the framebuffer scaling and the paint scaling "cancel each other out" ie. multiplied they return 1.

This fixes a bug where a window is being rendered at two times scale (because it's present on two monitors, and unscaled one and a scaled one) and its paint size on the unscaled monitor is half the texture size. Now because the fb doesn't have transformations applied, meta_actor_painting_untransformed() returns TRUE, even though the texture is scaled down and we end up wrongly using NEAREST interpolation.

Merge request reports