[mutter/wip/carlosg/performance-improvements: 8/23] ClutterActor: Optimize away idempotent scale/position updates
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/performance-improvements: 8/23] ClutterActor: Optimize away idempotent scale/position updates
- Date: Tue, 9 May 2017 10:07:56 +0000 (UTC)
commit 213e88458b2c717b732de29a3f3b02b61c81521b
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Apr 30 18:29:19 2017 +0200
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
clutter/clutter/clutter-actor.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index ff4237c..eec61da 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -4831,7 +4831,8 @@ clutter_actor_set_scale_factor (ClutterActor *self,
g_assert (pspec != 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
@@ -10268,9 +10269,10 @@ clutter_actor_set_position (ClutterActor *self,
cur_position.x = clutter_actor_get_x (self);
cur_position.y = clutter_actor_get_y (self);
- _clutter_actor_create_transition (self, obj_props[PROP_POSITION],
- &cur_position,
- &new_position);
+ if (!clutter_point_equals (&cur_position, &new_position))
+ _clutter_actor_create_transition (self, obj_props[PROP_POSITION],
+ &cur_position,
+ &new_position);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]