mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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
This commit is contained in:
parent
0fbda366e8
commit
e12b2c417e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user