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
This commit is contained in:
Owen W. Taylor 2014-09-02 18:09:29 -04:00
parent a4a688ed83
commit ef3b000050

View File

@ -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.;