From ef3b0000508d30e15aaee6c7ee9ae58275246062 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Sep 2014 18:09:29 -0400 Subject: [PATCH] MetaBackgroundActor: match total dimming if GLSL is not present Without GLSL, we didn't apply the vignetting, which not only made the background uniform in color, it made it much lighter. Adjust for this and make the average brightness with the vignette effect the same with or without GLSL. https://bugzilla.gnome.org/show_bug.cgi?id=735637 --- src/compositor/meta-background-actor.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compositor/meta-background-actor.c b/src/compositor/meta-background-actor.c index ad82f201e..4423b14f1 100644 --- a/src/compositor/meta-background-actor.c +++ b/src/compositor/meta-background-actor.c @@ -319,7 +319,18 @@ setup_pipeline (MetaBackgroundActor *self, } if (priv->vignette) - color_component = priv->brightness * opacity / 255.; + { + color_component = priv->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 * priv->vignette_sharpness); + } + } else color_component = opacity / 255.;