From 18a15a59d511d31fdf6bbe20d2f89864edcaa373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 30 Nov 2015 16:02:59 +0100 Subject: [PATCH] [effects] Fix reflections in coverswitch Got broken due to switch to Shader Traits API. --- effects/coverswitch/coverswitch.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 12c6e793c5..807d1d6da3 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -681,11 +681,10 @@ void CoverSwitchEffect::paintWindowCover(EffectWindow* w, bool reflectedWindow, } if (reflectedWindow) { - GLShader *shader = ShaderManager::instance()->pushShader(ShaderManager::GenericShader); - QMatrix4x4 origMatrix = shader->getUniformMatrix4x4("screenTransformation"); QMatrix4x4 reflectionMatrix; reflectionMatrix.scale(1.0, -1.0, 1.0); - shader->setUniform("screenTransformation", origMatrix * reflectionMatrix); + data.setProjectionMatrix(data.screenProjectionMatrix()); + data.setModelViewMatrix(reflectionMatrix); data.setYTranslation(- area.height() - windowRect.y() - windowRect.height()); if (start) { data.multiplyOpacity(timeLine.currentValue()); @@ -695,8 +694,6 @@ void CoverSwitchEffect::paintWindowCover(EffectWindow* w, bool reflectedWindow, effects->drawWindow(w, PAINT_WINDOW_TRANSFORMED, infiniteRegion(), data); - shader->setUniform("screenTransformation", origMatrix); - ShaderManager::instance()->popShader(); } else { effects->paintWindow(w, PAINT_WINDOW_TRANSFORMED,