mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
meta-background-actor: Rename brightness to vignette_brightness
The brightness is about the vignette. Add a 'vignette_' prefix in order to give more context. Keep the property name as it is, doing so we don't break any plugin (e.g., gnome-shell). https://bugzilla.gnome.org/show_bug.cgi?id=786618
This commit is contained in:
parent
f381d7c3bf
commit
cbc4563b30
@ -90,7 +90,7 @@ enum
|
|||||||
PROP_BACKGROUND,
|
PROP_BACKGROUND,
|
||||||
PROP_VIGNETTE,
|
PROP_VIGNETTE,
|
||||||
PROP_VIGNETTE_SHARPNESS,
|
PROP_VIGNETTE_SHARPNESS,
|
||||||
PROP_BRIGHTNESS
|
PROP_VIGNETTE_BRIGHTNESS
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -133,7 +133,7 @@ struct _MetaBackgroundActorPrivate
|
|||||||
MetaBackground *background;
|
MetaBackground *background;
|
||||||
|
|
||||||
gboolean vignette;
|
gboolean vignette;
|
||||||
double brightness;
|
double vignette_brightness;
|
||||||
double vignette_sharpness;
|
double vignette_sharpness;
|
||||||
|
|
||||||
ChangedFlags changed;
|
ChangedFlags changed;
|
||||||
@ -329,7 +329,7 @@ setup_pipeline (MetaBackgroundActor *self,
|
|||||||
|
|
||||||
if (priv->vignette)
|
if (priv->vignette)
|
||||||
{
|
{
|
||||||
color_component = priv->brightness * opacity / 255.;
|
color_component = priv->vignette_brightness * opacity / 255.;
|
||||||
|
|
||||||
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
|
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
|
||||||
{
|
{
|
||||||
@ -492,16 +492,16 @@ meta_background_actor_set_property (GObject *object,
|
|||||||
case PROP_VIGNETTE:
|
case PROP_VIGNETTE:
|
||||||
meta_background_actor_set_vignette (self,
|
meta_background_actor_set_vignette (self,
|
||||||
g_value_get_boolean (value),
|
g_value_get_boolean (value),
|
||||||
priv->brightness,
|
priv->vignette_brightness,
|
||||||
priv->vignette_sharpness);
|
priv->vignette_sharpness);
|
||||||
break;
|
break;
|
||||||
case PROP_VIGNETTE_SHARPNESS:
|
case PROP_VIGNETTE_SHARPNESS:
|
||||||
meta_background_actor_set_vignette (self,
|
meta_background_actor_set_vignette (self,
|
||||||
priv->vignette,
|
priv->vignette,
|
||||||
priv->brightness,
|
priv->vignette_brightness,
|
||||||
g_value_get_double (value));
|
g_value_get_double (value));
|
||||||
break;
|
break;
|
||||||
case PROP_BRIGHTNESS:
|
case PROP_VIGNETTE_BRIGHTNESS:
|
||||||
meta_background_actor_set_vignette (self,
|
meta_background_actor_set_vignette (self,
|
||||||
priv->vignette,
|
priv->vignette,
|
||||||
g_value_get_double (value),
|
g_value_get_double (value),
|
||||||
@ -535,8 +535,8 @@ meta_background_actor_get_property (GObject *object,
|
|||||||
case PROP_VIGNETTE:
|
case PROP_VIGNETTE:
|
||||||
g_value_set_boolean (value, priv->vignette);
|
g_value_set_boolean (value, priv->vignette);
|
||||||
break;
|
break;
|
||||||
case PROP_BRIGHTNESS:
|
case PROP_VIGNETTE_BRIGHTNESS:
|
||||||
g_value_set_double (value, priv->brightness);
|
g_value_set_double (value, priv->vignette_brightness);
|
||||||
break;
|
break;
|
||||||
case PROP_VIGNETTE_SHARPNESS:
|
case PROP_VIGNETTE_SHARPNESS:
|
||||||
g_value_set_double (value, priv->vignette_sharpness);
|
g_value_set_double (value, priv->vignette_sharpness);
|
||||||
@ -606,13 +606,13 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
|
|||||||
param_spec);
|
param_spec);
|
||||||
|
|
||||||
param_spec = g_param_spec_double ("brightness",
|
param_spec = g_param_spec_double ("brightness",
|
||||||
"Brightness",
|
"Vignette Brightness",
|
||||||
"Brightness of vignette effect",
|
"Brightness of vignette effect",
|
||||||
0.0, 1.0, 1.0,
|
0.0, 1.0, 1.0,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_BRIGHTNESS,
|
PROP_VIGNETTE_BRIGHTNESS,
|
||||||
param_spec);
|
param_spec);
|
||||||
|
|
||||||
param_spec = g_param_spec_double ("vignette-sharpness",
|
param_spec = g_param_spec_double ("vignette-sharpness",
|
||||||
@ -636,7 +636,7 @@ meta_background_actor_init (MetaBackgroundActor *self)
|
|||||||
MetaBackgroundActorPrivate);
|
MetaBackgroundActorPrivate);
|
||||||
|
|
||||||
priv->vignette = FALSE;
|
priv->vignette = FALSE;
|
||||||
priv->brightness = 1.0;
|
priv->vignette_brightness = 1.0;
|
||||||
priv->vignette_sharpness = 0.0;
|
priv->vignette_sharpness = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,9 +775,9 @@ meta_background_actor_set_vignette (MetaBackgroundActor *self,
|
|||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (brightness != priv->brightness || sharpness != priv->vignette_sharpness)
|
if (brightness != priv->vignette_brightness || sharpness != priv->vignette_sharpness)
|
||||||
{
|
{
|
||||||
priv->brightness = brightness;
|
priv->vignette_brightness = brightness;
|
||||||
priv->vignette_sharpness = sharpness;
|
priv->vignette_sharpness = sharpness;
|
||||||
invalidate_pipeline (self, CHANGED_VIGNETTE_PARAMETERS);
|
invalidate_pipeline (self, CHANGED_VIGNETTE_PARAMETERS);
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user