diff --git a/effects/cylinder.cpp b/effects/cylinder.cpp index 231dd5167b..6d056048f3 100644 --- a/effects/cylinder.cpp +++ b/effects/cylinder.cpp @@ -31,6 +31,7 @@ namespace KWin { KWIN_EFFECT( cylinder, CylinderEffect ) +KWIN_EFFECT_SUPPORTED( cylinder, CylinderEffect::supported() ) CylinderEffect::CylinderEffect() : CubeEffect() @@ -49,6 +50,13 @@ CylinderEffect::~CylinderEffect() delete mShader; } +bool CylinderEffect::supported() + { + return GLRenderTarget::supported() && + GLShader::fragmentShaderSupported() && + (effects->compositingType() == OpenGLCompositing); + } + bool CylinderEffect::loadData() { mInited = true; diff --git a/effects/cylinder.h b/effects/cylinder.h index 5ee6e3c8d6..a02b390ffa 100644 --- a/effects/cylinder.h +++ b/effects/cylinder.h @@ -36,6 +36,8 @@ class CylinderEffect virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ); virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); virtual void desktopChanged( int old ); + + static bool supported(); protected: virtual void paintScene( int mask, QRegion region, ScreenPaintData& data ); virtual void paintCap( float z, float zTexture ); diff --git a/effects/sphere.cpp b/effects/sphere.cpp index 81d112ea49..e1f9e1c64e 100644 --- a/effects/sphere.cpp +++ b/effects/sphere.cpp @@ -31,6 +31,7 @@ namespace KWin { KWIN_EFFECT( sphere, SphereEffect ) +KWIN_EFFECT_SUPPORTED( sphere, SphereEffect::supported() ) SphereEffect::SphereEffect() : CubeEffect() @@ -50,6 +51,13 @@ SphereEffect::~SphereEffect() delete mShader; } +bool SphereEffect::supported() + { + return GLRenderTarget::supported() && + GLShader::fragmentShaderSupported() && + (effects->compositingType() == OpenGLCompositing); + } + bool SphereEffect::loadData() { mInited = true; diff --git a/effects/sphere.h b/effects/sphere.h index 805f4cac02..00eb514533 100644 --- a/effects/sphere.h +++ b/effects/sphere.h @@ -35,6 +35,8 @@ class SphereEffect ~SphereEffect(); virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ); virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); + + static bool supported(); protected: virtual void paintScene( int mask, QRegion region, ScreenPaintData& data ); virtual void paintCap( float z, float zTexture );