From 9d03e16c347e51b27ca3ccafbd1e0f2c15016a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Tue, 11 Jun 2013 20:49:54 +0200 Subject: [PATCH] kwin: Check that color correction is enabled in setupForOutput() Return early if color correction is disabled, so this function becomes a no-op in that case. --- libkwineffects/kwinglcolorcorrection.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libkwineffects/kwinglcolorcorrection.cpp b/libkwineffects/kwinglcolorcorrection.cpp index c3c5496851..42bc5febd9 100644 --- a/libkwineffects/kwinglcolorcorrection.cpp +++ b/libkwineffects/kwinglcolorcorrection.cpp @@ -327,7 +327,7 @@ void ColorCorrection::setupForOutput(int screen) { Q_D(ColorCorrection); - if (d->m_hasError) + if (!d->m_enabled || d->m_hasError) return; // Clear any previous GL errors @@ -348,9 +348,6 @@ void ColorCorrection::setupForOutput(int screen) } if (!shader->setUniform("u_ccLookupTexture", d->m_ccTextureUnit)) { - // This means the color correction shaders are probably not loaded - if (!d->m_enabled) - return; kError(1212) << "unable to set uniform for the color correction lookup texture"; d->m_hasError = true; emit errorOccured();