mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
ClutterActor: Optimize away idempotent scale/position updates
If the actor results in the same scale/position, there's no need to trigger a transition. https://bugzilla.gnome.org/show_bug.cgi?id=782344
This commit is contained in:
parent
d620189ae3
commit
5cb5baa7d4
@ -4828,7 +4828,8 @@ clutter_actor_set_scale_factor (ClutterActor *self,
|
|||||||
g_assert (pspec != NULL);
|
g_assert (pspec != NULL);
|
||||||
g_assert (scale_p != NULL);
|
g_assert (scale_p != NULL);
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
|
if (*scale_p != factor)
|
||||||
|
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@ -10263,9 +10264,10 @@ clutter_actor_set_position (ClutterActor *self,
|
|||||||
cur_position.x = clutter_actor_get_x (self);
|
cur_position.x = clutter_actor_get_x (self);
|
||||||
cur_position.y = clutter_actor_get_y (self);
|
cur_position.y = clutter_actor_get_y (self);
|
||||||
|
|
||||||
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
if (!clutter_point_equals (&cur_position, &new_position))
|
||||||
&cur_position,
|
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
|
||||||
&new_position);
|
&cur_position,
|
||||||
|
&new_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user