1
0
Fork 0

Remove checks for GLSL

The Cogl feature was removed a while back, while Clutter just hard coded
it to TRUE. Lets remove the confusion that GLSL isn't supported and just
remove the (dead) fallback paths.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2015>
This commit is contained in:
Jonas Ådahl 2021-09-17 23:01:37 +02:00 committed by Marge Bot
parent b988fd73c9
commit 74230038c9
8 changed files with 5 additions and 125 deletions

View file

@ -122,29 +122,6 @@ clutter_blur_effect_create_pipeline (ClutterOffscreenEffect *effect,
return cogl_object_ref (blur_effect->pipeline);
}
static gboolean
clutter_blur_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 (clutter_blur_effect_parent_class);
return parent_class->pre_paint (effect, node, paint_context);
}
static gboolean
clutter_blur_effect_modify_paint_volume (ClutterEffect *effect,
ClutterPaintVolume *volume)
@ -190,7 +167,6 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass)
gobject_class->dispose = clutter_blur_effect_dispose;
effect_class->pre_paint = clutter_blur_effect_pre_paint;
effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume;
offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass);

View file

@ -147,19 +147,6 @@ clutter_brightness_contrast_effect_pre_paint (ClutterEffect *effect,
if (will_have_no_effect (self))
return FALSE;
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 ClutterBrightnessContrastEffect: the "
"graphics hardware or the current GL driver does not "
"implement support for the GLSL shading language. The "
"effect will be disabled.");
clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (effect), FALSE);
return FALSE;
}
parent_class =
CLUTTER_EFFECT_CLASS (clutter_brightness_contrast_effect_parent_class);

View file

@ -110,29 +110,6 @@ clutter_colorize_effect_create_pipeline (ClutterOffscreenEffect *effect,
return cogl_object_ref (colorize_effect->pipeline);
}
static gboolean
clutter_colorize_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 (clutter_colorize_effect_parent_class);
return parent_class->pre_paint (effect, node, paint_context);
}
static void
clutter_colorize_effect_dispose (GObject *gobject)
{
@ -191,15 +168,12 @@ clutter_colorize_effect_get_property (GObject *gobject,
static void
clutter_colorize_effect_class_init (ClutterColorizeEffectClass *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 = clutter_colorize_effect_create_pipeline;
effect_class->pre_paint = clutter_colorize_effect_pre_paint;
gobject_class->set_property = clutter_colorize_effect_set_property;
gobject_class->get_property = clutter_colorize_effect_get_property;
gobject_class->dispose = clutter_colorize_effect_dispose;

View file

@ -121,29 +121,6 @@ clutter_desaturate_effect_create_pipeline (ClutterOffscreenEffect *effect,
return cogl_object_ref (desaturate_effect->pipeline);
}
static gboolean
clutter_desaturate_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 (clutter_desaturate_effect_parent_class);
return parent_class->pre_paint (effect, node, paint_context);
}
static void
clutter_desaturate_effect_dispose (GObject *gobject)
{
@ -211,15 +188,12 @@ update_factor_uniform (ClutterDesaturateEffect *self)
static void
clutter_desaturate_effect_class_init (ClutterDesaturateEffectClass *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 = clutter_desaturate_effect_create_pipeline;
effect_class->pre_paint = clutter_desaturate_effect_pre_paint;
/**
* ClutterDesaturateEffect:factor:
*

View file

@ -292,18 +292,6 @@ clutter_shader_effect_set_actor (ClutterActorMeta *meta,
ClutterShaderEffectPrivate *priv = self->priv;
ClutterActorMetaClass *parent;
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 (meta, FALSE);
return;
}
parent = CLUTTER_ACTOR_META_CLASS (clutter_shader_effect_parent_class);
parent->set_actor (meta, actor);

View file

@ -400,11 +400,11 @@ setup_pipeline (MetaBackgroundContent *self,
opacity = clutter_actor_get_paint_opacity (actor);
if (opacity < 255)
pipeline_flags |= PIPELINE_BLEND;
if (self->vignette && clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
if (self->vignette)
pipeline_flags |= PIPELINE_VIGNETTE;
if (self->gradient && clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
if (self->gradient)
pipeline_flags |= PIPELINE_GRADIENT;
if (self->has_rounded_clip && clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
if (self->has_rounded_clip)
pipeline_flags |= PIPELINE_ROUNDED_CLIP | PIPELINE_BLEND;
if (pipeline_flags != self->pipeline_flags)
@ -532,22 +532,9 @@ setup_pipeline (MetaBackgroundContent *self,
}
if (self->vignette)
{
color_component = self->vignette_brightness * opacity / 255.;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* Darken everything to match the average brightness that would
* be there if we were drawing the vignette, which is
* (1 - (pi/12.) * vignette_sharpness) [exercise for the reader :]
*/
color_component *= (1 - 0.74 * self->vignette_sharpness);
}
}
color_component = self->vignette_brightness * opacity / 255.;
else
{
color_component = opacity / 255.;
}
color_component = opacity / 255.;
cogl_pipeline_set_color4f (self->pipeline,
color_component,

View file

@ -92,9 +92,6 @@ on_timeout (gpointer data)
}
else if (test_num == 3)
{
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
continue;
clutter_actor_hide (over_actor);
clutter_actor_add_effect_with_name (CLUTTER_ACTOR (state->stage),

View file

@ -259,9 +259,6 @@ actor_shader_effect (void)
gboolean was_painted;
GList *actors = NULL;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
return;
stage = clutter_test_get_stage ();
rect = make_actor (foo_old_shader_effect_get_type ());