[mutter/wip/carlosg/queue-redraw-fix: 1/2] clutter: Refactor code marking actors dirty for paint()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/queue-redraw-fix: 1/2] clutter: Refactor code marking actors dirty for paint()
- Date: Wed, 30 Mar 2022 19:38:01 +0000 (UTC)
commit a949734a7a9fd86316eb575e7f55183a8156401c
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Mar 30 20:59:37 2022 +0200
clutter: Refactor code marking actors dirty for paint()
Simplify the function arguments (the origin is just the actor that
the function is originally called from), and make it also handle
marking as dirty the actor that got the redraw queued up explicitly.
This makes it a single place where priv->is_dirty is being enabled.
clutter/clutter/clutter-actor.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 59345a7252..2e4b30effc 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -2646,9 +2646,10 @@ _clutter_actor_queue_redraw_on_clones (ClutterActor *self)
}
static void
-_clutter_actor_propagate_queue_redraw (ClutterActor *self,
- ClutterActor *origin)
+_clutter_actor_propagate_queue_redraw (ClutterActor *self)
{
+ ClutterActor *origin = self;
+
while (self)
{
/* no point in queuing a redraw on a destroyed actor */
@@ -2657,13 +2658,12 @@ _clutter_actor_propagate_queue_redraw (ClutterActor *self,
_clutter_actor_queue_redraw_on_clones (self);
+ self->priv->is_dirty = TRUE;
+
/* If the queue redraw is coming from a child then the actor has
become dirty and any queued effect is no longer valid */
if (self != origin)
- {
- self->priv->is_dirty = TRUE;
- self->priv->effect_to_redraw = NULL;
- }
+ self->priv->effect_to_redraw = NULL;
/* If the actor isn't visible, we still had to emit the signal
* to allow for a ClutterClone, but the appearance of the parent
@@ -8105,10 +8105,8 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
priv->effect_to_redraw = NULL;
}
- priv->is_dirty = TRUE;
-
if (!priv->propagated_one_redraw)
- _clutter_actor_propagate_queue_redraw (self, self);
+ _clutter_actor_propagate_queue_redraw (self);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]