From 563437de91da0ea41ae34d247a8e91d1a9e115ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 21 Sep 2021 16:35:32 +0200 Subject: [PATCH] Always assume GLSL is supported The support for GLSL has been advertised as unconditionally supported by mutter for a while, and has now lost the 'GLSL' feature completely. Lets remove the checks. Part-of: --- js/ui/lightbox.js | 2 +- src/shell-glsl-effect.c | 26 -------------------------- src/shell-invert-lightness-effect.c | 29 ----------------------------- src/st/st-scroll-view-fade.c | 9 --------- 4 files changed, 1 insertion(+), 65 deletions(-) diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js index 8348abada..cf68ea828 100644 --- a/js/ui/lightbox.js +++ b/js/ui/lightbox.js @@ -129,7 +129,7 @@ var Lightbox = GObject.registerClass({ this._container = container; this._children = container.get_children(); this._fadeFactor = params.fadeFactor; - this._radialEffect = Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL) && params.radialEffect; + this._radialEffect = params.radialEffect; if (this._radialEffect) this.add_effect(new RadialShaderEffect({ name: 'radial' })); diff --git a/src/shell-glsl-effect.c b/src/shell-glsl-effect.c index b7d39bd7b..ee6f5eefe 100644 --- a/src/shell-glsl-effect.c +++ b/src/shell-glsl-effect.c @@ -22,29 +22,6 @@ struct _ShellGLSLEffectPrivate G_DEFINE_TYPE_WITH_PRIVATE (ShellGLSLEffect, shell_glsl_effect, CLUTTER_TYPE_OFFSCREEN_EFFECT); -static gboolean -shell_glsl_effect_pre_paint (ClutterEffect *effect, - ClutterPaintNode *node, - ClutterPaintContext *paint_context) -{ - ClutterEffectClass *parent_class; - - if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL)) - { - /* if we don't have support for GLSL shaders then we - * forcibly disable the ActorMeta - */ - g_warning ("Unable to use the ShaderEffect: the graphics hardware " - "or the current GL driver does not implement support " - "for the GLSL shading language."); - clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE); - return FALSE; - } - - parent_class = CLUTTER_EFFECT_CLASS (shell_glsl_effect_parent_class); - return parent_class->pre_paint (effect, node, paint_context); -} - static CoglPipeline * shell_glsl_effect_create_pipeline (ClutterOffscreenEffect *effect, CoglTexture *texture) @@ -156,15 +133,12 @@ shell_glsl_effect_constructed (GObject *object) static void shell_glsl_effect_class_init (ShellGLSLEffectClass *klass) { - ClutterEffectClass *effect_class = CLUTTER_EFFECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterOffscreenEffectClass *offscreen_class; offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass); offscreen_class->create_pipeline = shell_glsl_effect_create_pipeline; - effect_class->pre_paint = shell_glsl_effect_pre_paint; - gobject_class->constructed = shell_glsl_effect_constructed; gobject_class->dispose = shell_glsl_effect_dispose; } diff --git a/src/shell-invert-lightness-effect.c b/src/shell-invert-lightness-effect.c index c9521ea49..f856ede61 100644 --- a/src/shell-invert-lightness-effect.c +++ b/src/shell-invert-lightness-effect.c @@ -72,32 +72,6 @@ G_DEFINE_TYPE (ShellInvertLightnessEffect, shell_invert_lightness_effect, CLUTTER_TYPE_OFFSCREEN_EFFECT); -static gboolean -shell_invert_lightness_effect_pre_paint (ClutterEffect *effect, - ClutterPaintNode *node, - ClutterPaintContext *paint_context) -{ - ShellInvertLightnessEffect *self = SHELL_INVERT_LIGHTNESS_EFFECT (effect); - ClutterEffectClass *parent_class; - - if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL)) - { - /* if we don't have support for GLSL shaders then we - * forcibly disable the ActorMeta - */ - g_warning ("Unable to use the ShellInvertLightnessEffect: the " - "graphics hardware or the current GL driver does not " - "implement support for the GLSL shading language."); - clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (self), FALSE); - return FALSE; - } - - parent_class = - CLUTTER_EFFECT_CLASS (shell_invert_lightness_effect_parent_class); - - return parent_class->pre_paint (effect, node, paint_context); -} - static CoglPipeline * shell_glsl_effect_create_pipeline (ClutterOffscreenEffect *effect, CoglTexture *texture) @@ -126,15 +100,12 @@ shell_invert_lightness_effect_dispose (GObject *gobject) static void shell_invert_lightness_effect_class_init (ShellInvertLightnessEffectClass *klass) { - ClutterEffectClass *effect_class = CLUTTER_EFFECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterOffscreenEffectClass *offscreen_class; offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass); offscreen_class->create_pipeline = shell_glsl_effect_create_pipeline; - effect_class->pre_paint = shell_invert_lightness_effect_pre_paint; - gobject_class->dispose = shell_invert_lightness_effect_dispose; } diff --git a/src/st/st-scroll-view-fade.c b/src/st/st-scroll-view-fade.c index 6c0176f5d..7dba2df42 100644 --- a/src/st/st-scroll-view-fade.c +++ b/src/st/st-scroll-view-fade.c @@ -214,15 +214,6 @@ st_scroll_view_fade_set_actor (ClutterActorMeta *meta, g_return_if_fail (actor == NULL || ST_IS_SCROLL_VIEW (actor)); - if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL)) - { - /* if we don't have support for GLSL shaders then we - * forcibly disable the ActorMeta - */ - clutter_actor_meta_set_enabled (meta, FALSE); - return; - } - if (self->vadjustment) { g_signal_handlers_disconnect_by_func (self->vadjustment,