mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
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:
parent
a4a688ed83
commit
ef3b000050
@ -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.;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user