From db7a072c2be91b6c00f76cab69cff1a58519a402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 1 Jan 2011 17:57:09 +0100 Subject: [PATCH] Blending is also useful in legacy mode... --- effects/cube/cube.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 03a3fe83f7..9b771f70c9 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -522,11 +522,11 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) alpha = 0.3 + 0.4 * timeLine.value(); if( stop ) alpha = 0.3 + 0.4 * ( 1.0 - timeLine.value() ); + glEnable( GL_BLEND ); + glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); ShaderManager *shaderManager = ShaderManager::instance(); if (shaderManager->isValid() && m_reflectionShader->isValid()) { // ensure blending is enabled - no attribute stack - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); shaderManager->pushShader(m_reflectionShader); QMatrix4x4 windowTransformation; windowTransformation.translate(rect.x() + rect.width()*0.5f, 0.0, 0.0); @@ -554,7 +554,6 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) vbo->render(GL_TRIANGLES); shaderManager->popShader(); - glDisable( GL_BLEND ); } else { #ifndef KWIN_HAVE_OPENGLES glColor4f( 0.0, 0.0, 0.0, alpha ); @@ -572,6 +571,7 @@ void CubeEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) glPopMatrix(); #endif } + glDisable( GL_BLEND ); PaintClipper::pop( QRegion( rect )); } glEnable( GL_CULL_FACE );