summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2012-05-04 09:31:06 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2012-05-05 08:20:34 (GMT)
commitdb42152def79381547965eaadb3771f0d2fe908c (patch)
treec82b92e4afe9c0960364056835f398698acd1ae0
parent4d39db624571600d41bb0fa2149f774cbc67a5dc (diff)
Properly detect effects which need OpenGL 2
Effects that need GLSL require that OpenGL 2 is active. It does not matter whether the GPU would support it if OpenGL 2 is not used. BUG: 299426 FIXED-IN: 4.8.4 REVIEW: 104848
-rw-r--r--kwin/effects/explosion/explosion.cpp7
-rw-r--r--kwin/effects/invert/invert.cpp7
-rw-r--r--kwin/effects/lookingglass/lookingglass.cpp8
3 files changed, 15 insertions, 7 deletions
diff --git a/kwin/effects/explosion/explosion.cpp b/kwin/effects/explosion/explosion.cpp
index dc9cd14..125aafb 100644
--- a/kwin/effects/explosion/explosion.cpp
+++ b/kwin/effects/explosion/explosion.cpp
@@ -60,8 +60,11 @@ ExplosionEffect::~ExplosionEffect()
bool ExplosionEffect::supported()
{
- return GLPlatform::instance()->supports(GLSL) &&
- (effects->compositingType() == OpenGLCompositing);
+ if (effects->compositingType() == OpenGLCompositing) {
+ return ShaderManager::instance()->isValid();
+ } else {
+ return false;
+ }
}
bool ExplosionEffect::loadData()
diff --git a/kwin/effects/invert/invert.cpp b/kwin/effects/invert/invert.cpp
index 0ef1545..c8c0da2 100644
--- a/kwin/effects/invert/invert.cpp
+++ b/kwin/effects/invert/invert.cpp
@@ -64,8 +64,11 @@ InvertEffect::~InvertEffect()
bool InvertEffect::supported()
{
- return GLPlatform::instance()->supports(GLSL) &&
- (effects->compositingType() == OpenGLCompositing);
+ if (effects->compositingType() == OpenGLCompositing) {
+ return ShaderManager::instance()->isValid();
+ } else {
+ return false;
+ }
}
bool InvertEffect::loadData()
diff --git a/kwin/effects/lookingglass/lookingglass.cpp b/kwin/effects/lookingglass/lookingglass.cpp
index c62e268..6ebd7a1 100644
--- a/kwin/effects/lookingglass/lookingglass.cpp
+++ b/kwin/effects/lookingglass/lookingglass.cpp
@@ -79,9 +79,11 @@ LookingGlassEffect::~LookingGlassEffect()
bool LookingGlassEffect::supported()
{
- return GLRenderTarget::supported() &&
- GLPlatform::instance()->supports(GLSL) &&
- (effects->compositingType() == OpenGLCompositing);
+ if (effects->compositingType() == OpenGLCompositing) {
+ return ShaderManager::instance()->isValid() && GLRenderTarget::supported();
+ } else {
+ return false;
+ }
}
void LookingGlassEffect::reconfigure(ReconfigureFlags)