From bf19d895108be6f80fd0b050b811e14cb2c885dc Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 Sep 2012 18:56:32 +0200 Subject: [PATCH] animation: Don't set the changed properties anymore The code is not needed anymore. And it looked wrong, too, so I'm glad it's gone. --- gtk/gtkcssanimation.c | 9 ++------- gtk/gtkcsscomputedvalues.c | 11 +++-------- gtk/gtkcsstransition.c | 5 +---- gtk/gtkstyleanimation.c | 13 +++++-------- gtk/gtkstyleanimationprivate.h | 8 +++----- 5 files changed, 14 insertions(+), 32 deletions(-) diff --git a/gtk/gtkcssanimation.c b/gtk/gtkcssanimation.c index 48ef62bc49..e4c692a19c 100644 --- a/gtk/gtkcssanimation.c +++ b/gtk/gtkcssanimation.c @@ -97,9 +97,8 @@ gtk_css_animation_get_progress_from_iteration (GtkCssAnimation *animation, } } -static GtkBitmask * +static void gtk_css_animation_set_values (GtkStyleAnimation *style_animation, - GtkBitmask *changed, gint64 for_time_us, GtkCssComputedValues *values) { @@ -110,7 +109,7 @@ gtk_css_animation_set_values (GtkStyleAnimation *style_animation, iteration = gtk_css_animation_get_iteration (animation, for_time_us); if (!gtk_css_animation_is_executing_at_iteration (animation, iteration)) - return changed; + return; progress = gtk_css_animation_get_progress_from_iteration (animation, iteration); progress = _gtk_css_ease_value_transform (animation->ease, progress); @@ -128,11 +127,7 @@ gtk_css_animation_set_values (GtkStyleAnimation *style_animation, _gtk_css_computed_values_get_intrinsic_value (values, i)); _gtk_css_computed_values_set_animated_value (values, property_id, value); _gtk_css_value_unref (value); - - changed = _gtk_bitmask_set (changed, property_id, TRUE); } - - return changed; } static gboolean diff --git a/gtk/gtkcsscomputedvalues.c b/gtk/gtkcsscomputedvalues.c index 98d827da9f..283412404d 100644 --- a/gtk/gtkcsscomputedvalues.c +++ b/gtk/gtkcsscomputedvalues.c @@ -513,8 +513,6 @@ _gtk_css_computed_values_advance (GtkCssComputedValues *values, g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), NULL); g_return_val_if_fail (timestamp >= values->current_time, NULL); - changed = _gtk_bitmask_new (); - values->current_time = timestamp; old_computed_values = values->animated_values; values->animated_values = NULL; @@ -526,10 +524,9 @@ _gtk_css_computed_values_advance (GtkCssComputedValues *values, list = list->next; - changed = _gtk_style_animation_set_values (animation, - changed, - timestamp, - GTK_CSS_COMPUTED_VALUES (values)); + _gtk_style_animation_set_values (animation, + timestamp, + GTK_CSS_COMPUTED_VALUES (values)); if (_gtk_style_animation_is_finished (animation, timestamp)) { @@ -538,8 +535,6 @@ _gtk_css_computed_values_advance (GtkCssComputedValues *values, } } - _gtk_bitmask_free (changed); - /* figure out changes */ changed = _gtk_bitmask_new (); diff --git a/gtk/gtkcsstransition.c b/gtk/gtkcsstransition.c index bc50e66c77..8aa7737a2f 100644 --- a/gtk/gtkcsstransition.c +++ b/gtk/gtkcsstransition.c @@ -25,9 +25,8 @@ G_DEFINE_TYPE (GtkCssTransition, _gtk_css_transition, GTK_TYPE_STYLE_ANIMATION) -static GtkBitmask * +static void gtk_css_transition_set_values (GtkStyleAnimation *animation, - GtkBitmask *changed, gint64 for_time_us, GtkCssComputedValues *values) { @@ -54,8 +53,6 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation, _gtk_css_computed_values_set_animated_value (values, transition->property, value); _gtk_css_value_unref (value); - - return _gtk_bitmask_set (changed, transition->property, TRUE); } static gboolean diff --git a/gtk/gtkstyleanimation.c b/gtk/gtkstyleanimation.c index ac74851c59..2ee49f3fa8 100644 --- a/gtk/gtkstyleanimation.c +++ b/gtk/gtkstyleanimation.c @@ -23,13 +23,11 @@ G_DEFINE_ABSTRACT_TYPE (GtkStyleAnimation, _gtk_style_animation, G_TYPE_OBJECT) -static GtkBitmask * +static void gtk_style_animation_real_set_values (GtkStyleAnimation *animation, - GtkBitmask *changed, gint64 for_time_us, GtkCssComputedValues *values) { - return changed; } static gboolean @@ -59,20 +57,19 @@ _gtk_style_animation_init (GtkStyleAnimation *animation) { } -GtkBitmask * +void _gtk_style_animation_set_values (GtkStyleAnimation *animation, - GtkBitmask *changed, gint64 for_time_us, GtkCssComputedValues *values) { GtkStyleAnimationClass *klass; - g_return_val_if_fail (GTK_IS_STYLE_ANIMATION (animation), changed); - g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), changed); + g_return_if_fail (GTK_IS_STYLE_ANIMATION (animation)); + g_return_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values)); klass = GTK_STYLE_ANIMATION_GET_CLASS (animation); - return klass->set_values (animation, changed, for_time_us, values); + return klass->set_values (animation, for_time_us, values); } gboolean diff --git a/gtk/gtkstyleanimationprivate.h b/gtk/gtkstyleanimationprivate.h index b4f2c69595..4db2a0792e 100644 --- a/gtk/gtkstyleanimationprivate.h +++ b/gtk/gtkstyleanimationprivate.h @@ -48,18 +48,16 @@ struct _GtkStyleAnimationClass gint64 at_time_us); gboolean (* is_static) (GtkStyleAnimation *animation, gint64 at_time_us); - GtkBitmask * (* set_values) (GtkStyleAnimation *animation, - GtkBitmask *changed, + void (* set_values) (GtkStyleAnimation *animation, gint64 for_time_us, GtkCssComputedValues *values); }; GType _gtk_style_animation_get_type (void) G_GNUC_CONST; -GtkBitmask * _gtk_style_animation_set_values (GtkStyleAnimation *animation, - GtkBitmask *changed, +void _gtk_style_animation_set_values (GtkStyleAnimation *animation, gint64 for_time_us, - GtkCssComputedValues *values) G_GNUC_WARN_UNUSED_RESULT; + GtkCssComputedValues *values); gboolean _gtk_style_animation_is_finished (GtkStyleAnimation *animation, gint64 at_time_us); gboolean _gtk_style_animation_is_static (GtkStyleAnimation *animation,