[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/kwin
From: Martin Gräßlin <kde () martin-graesslin ! com>
Date: 2010-12-05 10:02:47
Message-ID: 20101205100247.A45DCAC8A4 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1203714 by graesslin:
Fix blend func for shaders
M +8 -3 scene_opengl.cpp
--- trunk/KDE/kdebase/workspace/kwin/scene_opengl.cpp #1203713:1203714
@@ -1680,13 +1680,18 @@
// setup blending of transparent windows
glPushAttrib( GL_ENABLE_BIT );
bool opaque = isOpaque() && opacity == 1.0;
+ bool alpha = toplevel->hasAlpha() || type != Content;
if( type != Content )
opaque = false;
- if( !opaque )
- {
+ if (!opaque) {
glEnable( GL_BLEND );
- glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );
+ if (alpha) {
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ } else {
+ glBlendColor((float)opacity, (float)opacity, (float)opacity, (float)opacity);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_CONSTANT_ALPHA);
}
+ }
shader->setUniform("opacity", (float)opacity);
shader->setUniform("saturation", (float)saturation);
shader->setUniform("brightness", (float)brightness);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic