From 6d0f1fedc0d1193c19e6946f72273eb6d00cd91f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 7 Feb 2024 10:12:03 +0200 Subject: [PATCH] plugins/backgroundcontrast: Correct texture transform The y axis should be mirrored as the last step, otherwise it's going to change the winding order in rotation transforms in the render target transform. BUG: 479934 --- src/plugins/backgroundcontrast/contrast.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/backgroundcontrast/contrast.cpp b/src/plugins/backgroundcontrast/contrast.cpp index 99889fad9b..7698783888 100644 --- a/src/plugins/backgroundcontrast/contrast.cpp +++ b/src/plugins/backgroundcontrast/contrast.cpp @@ -474,13 +474,13 @@ void ContrastEffect::doContrast(const RenderTarget &renderTarget, const RenderVi // to texture coordinates. const QRectF boundingRect = actualShape.boundingRect(); QMatrix4x4 textureMatrix; + textureMatrix.scale(1, -1); + textureMatrix.translate(0, -1); // apply texture->buffer transformation textureMatrix.translate(0.5, 0.5); textureMatrix *= renderTarget.transform().toMatrix(); textureMatrix.translate(-0.5, -0.5); // scaled logical to texture coordinates - textureMatrix.scale(1, -1); - textureMatrix.translate(0, -1); textureMatrix.scale(1.0 / boundingRect.width(), 1.0 / boundingRect.height(), 1); textureMatrix.translate(-boundingRect.x(), -boundingRect.y(), 0); textureMatrix.scale(1.0 / viewport.scale(), 1.0 / viewport.scale());