[mutter] clutter: Simplify clutter_state_change
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter: Simplify clutter_state_change
- Date: Wed, 27 Feb 2019 03:38:06 +0000 (UTC)
commit 7f3fda6df69e5a4de15d37f998bdfe944235b3e4
Author: Adam Jackson <ajax redhat com>
Date: Wed Feb 20 12:11:46 2019 -0500
clutter: Simplify clutter_state_change
clutter_state_get_animator now always returns NULL, because
_set_animator is never called.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
clutter/clutter/deprecated/clutter-state.c | 65 +++++++++++-------------------
1 file changed, 23 insertions(+), 42 deletions(-)
---
diff --git a/clutter/clutter/deprecated/clutter-state.c b/clutter/clutter/deprecated/clutter-state.c
index ef041f58f..5bb9fb6ca 100644
--- a/clutter/clutter/deprecated/clutter-state.c
+++ b/clutter/clutter/deprecated/clutter-state.c
@@ -649,7 +649,6 @@ clutter_state_change (ClutterState *state,
gboolean animate)
{
ClutterStatePrivate *priv;
- ClutterAnimator *animator;
State *new_state;
guint duration;
GList *k;
@@ -718,55 +717,37 @@ clutter_state_change (ClutterState *state,
return NULL;
}
- animator = clutter_state_get_animator (state,
- priv->source_state_name,
- priv->target_state_name);
- priv->target_state = new_state;
-
- if (animator == NULL && new_state->keys == NULL)
- animator = clutter_state_get_animator (state, NULL,
- priv->target_state_name);
-
- if (animator != NULL)
- {
- /* we've got an animator overriding the tweened animation */
- priv->current_animator = animator;
- clutter_animator_set_timeline (animator, priv->timeline);
- }
- else
+ for (k = new_state->keys; k != NULL; k = k->next)
{
- for (k = new_state->keys; k != NULL; k = k->next)
- {
- ClutterStateKey *key = k->data;
- GValue initial = G_VALUE_INIT;
+ ClutterStateKey *key = k->data;
+ GValue initial = G_VALUE_INIT;
- /* Reset the pre-pre-delay - this is only used for setting keys
- * during transitions.
- */
- key->pre_pre_delay = 0;
+ /* Reset the pre-pre-delay - this is only used for setting keys
+ * during transitions.
+ */
+ key->pre_pre_delay = 0;
- g_value_init (&initial, clutter_interval_get_value_type (key->interval));
+ g_value_init (&initial, clutter_interval_get_value_type (key->interval));
- if (key->is_animatable)
- {
- ClutterAnimatable *animatable;
+ if (key->is_animatable)
+ {
+ ClutterAnimatable *animatable;
- animatable = CLUTTER_ANIMATABLE (key->object);
- clutter_animatable_get_initial_state (animatable,
- key->property_name,
- &initial);
- }
- else
- g_object_get_property (key->object, key->property_name, &initial);
+ animatable = CLUTTER_ANIMATABLE (key->object);
+ clutter_animatable_get_initial_state (animatable,
+ key->property_name,
+ &initial);
+ }
+ else
+ g_object_get_property (key->object, key->property_name, &initial);
- if (clutter_alpha_get_mode (key->alpha) != key->mode)
- clutter_alpha_set_mode (key->alpha, key->mode);
+ if (clutter_alpha_get_mode (key->alpha) != key->mode)
+ clutter_alpha_set_mode (key->alpha, key->mode);
- clutter_interval_set_initial_value (key->interval, &initial);
- clutter_interval_set_final_value (key->interval, &key->value);
+ clutter_interval_set_initial_value (key->interval, &initial);
+ clutter_interval_set_final_value (key->interval, &key->value);
- g_value_unset (&initial);
- }
+ g_value_unset (&initial);
}
if (!animate)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]