[effects] Fix reflections in coverswitch

Got broken due to switch to Shader Traits API.
This commit is contained in:
Martin Gräßlin 2015-11-30 16:02:59 +01:00
parent a5e86c66bf
commit 18a15a59d5

View file

@ -681,11 +681,10 @@ void CoverSwitchEffect::paintWindowCover(EffectWindow* w, bool reflectedWindow,
} }
if (reflectedWindow) { if (reflectedWindow) {
GLShader *shader = ShaderManager::instance()->pushShader(ShaderManager::GenericShader);
QMatrix4x4 origMatrix = shader->getUniformMatrix4x4("screenTransformation");
QMatrix4x4 reflectionMatrix; QMatrix4x4 reflectionMatrix;
reflectionMatrix.scale(1.0, -1.0, 1.0); 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()); data.setYTranslation(- area.height() - windowRect.y() - windowRect.height());
if (start) { if (start) {
data.multiplyOpacity(timeLine.currentValue()); data.multiplyOpacity(timeLine.currentValue());
@ -695,8 +694,6 @@ void CoverSwitchEffect::paintWindowCover(EffectWindow* w, bool reflectedWindow,
effects->drawWindow(w, effects->drawWindow(w,
PAINT_WINDOW_TRANSFORMED, PAINT_WINDOW_TRANSFORMED,
infiniteRegion(), data); infiniteRegion(), data);
shader->setUniform("screenTransformation", origMatrix);
ShaderManager::instance()->popShader();
} else { } else {
effects->paintWindow(w, effects->paintWindow(w,
PAINT_WINDOW_TRANSFORMED, PAINT_WINDOW_TRANSFORMED,