From 7eb9f75af22c4aeeb58e864772912ec060f79826 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 21 Jun 2024 09:44:07 +0300 Subject: [PATCH] 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 --- src/plugins/glide/glide.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/glide/glide.cpp b/src/plugins/glide/glide.cpp index 6d45f4faf4..419ff8defb 100644 --- a/src/plugins/glide/glide.cpp +++ b/src/plugins/glide/glide.cpp @@ -145,6 +145,7 @@ void GlideEffect::apply(EffectWindow *window, int mask, WindowPaintData &data, W break; } + quads = quads.makeRegularGrid(20, 20); for (WindowQuad &quad : quads) { for (int i = 0; i < 4; ++i) { const QPointF transformed = matrix.map(QPointF(quad[i].x(), quad[i].y()));