plugins/glide: Subdivide window quad grid

The way the glide effect works is that it takes 2D geometry and applies
the perspective projection to it on the CPU side. The reason we do it is
that the scene is 2D.

However, this leaves us with the well known problem where a texture
that's mapped to a trapezoid won't be correctly interpolated along the
diagonal.

It can addressed by performing a perspective division in the fragment
shader, but given the way the effect is structured, it's off the table. So
instead subdivide the window grid.

BUG: 488840
This commit is contained in:
Vlad Zahorodnii 2024-06-21 09:44:07 +03:00
parent b745f83339
commit 7eb9f75af2

View file

@ -145,6 +145,7 @@ void GlideEffect::apply(EffectWindow *window, int mask, WindowPaintData &data, W
break; break;
} }
quads = quads.makeRegularGrid(20, 20);
for (WindowQuad &quad : quads) { for (WindowQuad &quad : quads) {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
const QPointF transformed = matrix.map(QPointF(quad[i].x(), quad[i].y())); const QPointF transformed = matrix.map(QPointF(quad[i].x(), quad[i].y()));