diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c index 825ee90d1..d143b21b0 100644 --- a/src/compositor/meta-background.c +++ b/src/compositor/meta-background.c @@ -498,7 +498,8 @@ set_brightness (MetaBackground *self, priv->brightness = brightness; - if (priv->effects & META_BACKGROUND_EFFECTS_VIGNETTE) + if (clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL) && + priv->effects & META_BACKGROUND_EFFECTS_VIGNETTE) { ensure_pipeline (self); cogl_pipeline_set_uniform_1f (priv->pipeline, @@ -506,6 +507,14 @@ set_brightness (MetaBackground *self, "brightness"), priv->brightness); } + else + { + ensure_pipeline (self); + CoglColor blend_color; + cogl_color_init_from_4f (&blend_color, brightness, brightness, brightness, 1.0); + cogl_pipeline_set_layer_combine (priv->pipeline, 1, "RGB=MODULATE(PREVIOUS, CONSTANT) A=REPLACE(PREVIOUS)", NULL); + cogl_pipeline_set_layer_combine_constant (priv->pipeline, 1, &blend_color); + } clutter_content_invalidate (CLUTTER_CONTENT (self)); @@ -523,6 +532,9 @@ set_vignette_sharpness (MetaBackground *self, priv->vignette_sharpness = sharpness; + if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL)) + return; + if (priv->effects & META_BACKGROUND_EFFECTS_VIGNETTE) { ensure_pipeline (self); @@ -543,6 +555,9 @@ add_vignette (MetaBackground *self) MetaBackgroundPrivate *priv = self->priv; static CoglSnippet *snippet = NULL; + if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL)) + return; + ensure_pipeline (self); /* Cogl automatically caches pipelines with no eviction policy,