[mutter/cherry-pick-5d19aee2: 4/4] actor: Also recompute paint volume if we recently dropped effects
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/cherry-pick-5d19aee2: 4/4] actor: Also recompute paint volume if we recently dropped effects
- Date: Wed, 19 Sep 2018 14:21:09 +0000 (UTC)
commit 037d9915d55b11bac5ec2b41de7151f98c7bd268
Author: Sam Spilsbury <sam endlessm com>
Date: Sun Sep 2 22:17:43 2018 +0800
actor: Also recompute paint volume if we recently dropped effects
Otherwise we'll be stuck with the same paint volume on the last
frame of the given effect, which could be wrong.
(cherry picked from commit a8a3c1017fd8604f4f7db272a867ae17b0214cf7)
clutter/clutter/clutter-actor.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 843e04abb..e70892308 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -841,6 +841,7 @@ struct _ClutterActorPrivate
guint needs_x_expand : 1;
guint needs_y_expand : 1;
guint needs_paint_volume_update : 1;
+ guint had_effects_on_last_paint_volume_update : 1;
};
enum
@@ -17557,23 +17558,33 @@ _clutter_actor_has_active_paint_volume_override_effects (ClutterActor *self)
static ClutterPaintVolume *
_clutter_actor_get_paint_volume_mutable (ClutterActor *self)
{
+ gboolean has_paint_volume_override_effects;
ClutterActorPrivate *priv;
priv = self->priv;
+ has_paint_volume_override_effects = _clutter_actor_has_active_paint_volume_override_effects (self);
+
if (priv->paint_volume_valid)
{
/* If effects are applied, the actor paint volume
* needs to be recomputed on each paint, since those
* paint volumes could change over the duration of the
- * effect. */
+ * effect.
+ *
+ * We also need to update the paint volume if we went
+ * from having effects to not having effects on the last
+ * paint volume update. */
if (!priv->needs_paint_volume_update &&
priv->current_effect == NULL &&
- !_clutter_actor_has_active_paint_volume_override_effects (self))
+ !has_paint_volume_override_effects &&
+ !priv->had_effects_on_last_paint_volume_update)
return &priv->paint_volume;
clutter_paint_volume_free (&priv->paint_volume);
}
+ priv->had_effects_on_last_paint_volume_update = has_paint_volume_override_effects;
+
if (_clutter_actor_get_paint_volume_real (self, &priv->paint_volume))
{
priv->paint_volume_valid = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]