[mutter] clutter/actor: Use priv->allocation instead of get_allocation_box()
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/actor: Use priv->allocation instead of get_allocation_box()
- Date: Sat, 23 May 2020 21:14:42 +0000 (UTC)
commit e12b2c417e17dde7df13fb96d4020a55f41280fc
Author: Jonas Dreßler <verdre v0yd nl>
Date: Wed May 20 21:47:34 2020 +0200
clutter/actor: Use priv->allocation instead of get_allocation_box()
The comment in _clutter_actor_get_allocation_clip() explicitely notices
that it doesn't need the behavior of doing an immediate relayout as
clutter_actor_get_allocation_box() does. The comment is also still valid
since the code calling _clutter_actor_get_allocation_clip() checks for
priv->needs_allocation just before.
So let's just use the allocation directly here instead of going through
that function.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1264
clutter/clutter/clutter-actor.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 0aa696042..e60e87f71 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -8750,26 +8750,15 @@ static void
_clutter_actor_get_allocation_clip (ClutterActor *self,
ClutterActorBox *clip)
{
- ClutterActorBox allocation;
-
- /* XXX: we don't care if we get an out of date allocation here
- * because clutter_actor_queue_redraw_with_clip knows to ignore
- * the clip if the actor's allocation is invalid.
- *
- * This is noted because clutter_actor_get_allocation_box does some
- * unnecessary work to support buggy code with a comment suggesting
- * that it could be changed later which would be good for this use
- * case!
- */
- clutter_actor_get_allocation_box (self, &allocation);
+ ClutterActorPrivate *priv = self->priv;
/* NB: clutter_actor_queue_redraw_with_clip expects a box in the
* actor's own coordinate space but the allocation is in parent
* coordinates */
clip->x1 = 0;
clip->y1 = 0;
- clip->x2 = allocation.x2 - allocation.x1;
- clip->y2 = allocation.y2 - allocation.y1;
+ clip->x2 = priv->allocation.x2 - priv->allocation.x1;
+ clip->y2 = priv->allocation.y2 - priv->allocation.y1;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]