diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-03-03 16:46:26 +0000 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2011-03-03 16:54:52 +0000 |
commit | d306b4bb7d7a9c8b0b02c7e940b66f51ec62e18d (patch) | |
tree | 8149039856249c3a6d144834e1976ca4fc5fb786 /clutter/clutter-offscreen-effect.c | |
parent | 3fab04805ea4b7ae584fcfe425bc8355a64d2c36 (diff) | |
download | clutter-d306b4bb7d7a9c8b0b02c7e940b66f51ec62e18d.tar.gz |
clutter-offscreen-effect: Preserve the old opacity override
When removing the opacity override in the post_paint implementation,
ClutterOffscreenEffect would always set the override back to -1. This
ends up cancelling out the effect of any overrides from outer effects
which means that if any actor has multiple effects attached then it
would apply the opacity multiple times.
To fix this, the effect now preserves the old value of the opacity
override and restores that instead of setting -1.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2541
Diffstat (limited to 'clutter/clutter-offscreen-effect.c')
-rw-r--r-- | clutter/clutter-offscreen-effect.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index 804a36288..be2c2d19a 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -87,6 +87,8 @@ struct _ClutterOffscreenEffectPrivate gfloat target_width; gfloat target_height; + + gint old_opacity_override; }; G_DEFINE_ABSTRACT_TYPE (ClutterOffscreenEffect, @@ -296,6 +298,8 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect) * texture with the actor's paint opacity, so we need to do this to avoid * multiplying the opacity twice. */ + priv->old_opacity_override = + _clutter_actor_get_opacity_override (priv->actor); _clutter_actor_set_opacity_override (priv->actor, 0xff); return TRUE; @@ -354,8 +358,8 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect) cogl_matrix_translate (&modelview, priv->x_offset, priv->y_offset, 0.0f); cogl_set_modelview_matrix (&modelview); - /* Remove the opacity override */ - _clutter_actor_set_opacity_override (priv->actor, -1); + /* Restore the previous opacity override */ + _clutter_actor_set_opacity_override (priv->actor, priv->old_opacity_override); /* paint the target material; this is virtualized for * sub-classes that require special hand-holding |