[gtk+] csscomputedvalues: Handle starting animations differently
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] csscomputedvalues: Handle starting animations differently
- Date: Mon, 17 Sep 2012 19:16:33 +0000 (UTC)
commit e2cc9f3afc7a04e5d9afc319578ff42225c8be2d
Author: Benjamin Otte <otte redhat com>
Date: Sun Sep 16 19:07:40 2012 +0200
csscomputedvalues: Handle starting animations differently
gtk/gtkcsscomputedvalues.c | 29 ++++++++++++-----------------
gtk/gtkcsscomputedvaluesprivate.h | 2 +-
gtk/gtkstylecontext.c | 23 +++++++++++++----------
3 files changed, 26 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtkcsscomputedvalues.c b/gtk/gtkcsscomputedvalues.c
index 2834124..f9ec618 100644
--- a/gtk/gtkcsscomputedvalues.c
+++ b/gtk/gtkcsscomputedvalues.c
@@ -364,9 +364,9 @@ gtk_css_computed_values_find_transition (GtkCssComputedValues *values,
}
static void
-gtk_css_computed_values_start_transitions (GtkCssComputedValues *values,
- gint64 timestamp,
- GtkCssComputedValues *source)
+gtk_css_computed_values_create_css_transitions (GtkCssComputedValues *values,
+ gint64 timestamp,
+ GtkCssComputedValues *source)
{
TransitionInfo transitions[GTK_CSS_PROPERTY_N_PROPERTIES] = { { 0, } };
GtkCssValue *durations, *delays, *timing_functions;
@@ -432,9 +432,9 @@ gtk_css_computed_values_find_animation (GtkCssComputedValues *values,
}
static void
-gtk_css_computed_values_start_css_animations (GtkCssComputedValues *values,
- gint64 timestamp,
- GtkStyleContext *context)
+gtk_css_computed_values_create_css_animations (GtkCssComputedValues *values,
+ gint64 timestamp,
+ GtkStyleContext *context)
{
GtkStyleProviderPrivate *provider;
GtkCssValue *durations, *delays, *timing_functions, *animations;
@@ -487,18 +487,13 @@ gtk_css_computed_values_start_css_animations (GtkCssComputedValues *values,
/* PUBLIC API */
void
-_gtk_css_computed_values_start_animations (GtkCssComputedValues *values,
- gint64 timestamp,
- GtkCssComputedValues *source,
- GtkStyleContext *context)
+_gtk_css_computed_values_create_animations (GtkCssComputedValues *values,
+ gint64 timestamp,
+ GtkCssComputedValues *source,
+ GtkStyleContext *context)
{
- GtkBitmask *ignore;
-
- gtk_css_computed_values_start_transitions (values, timestamp, source);
- gtk_css_computed_values_start_css_animations (values, timestamp, context);
-
- ignore = _gtk_css_computed_values_advance (values, timestamp);
- _gtk_bitmask_free (ignore);
+ gtk_css_computed_values_create_css_transitions (values, timestamp, source);
+ gtk_css_computed_values_create_css_animations (values, timestamp, context);
}
GtkBitmask *
diff --git a/gtk/gtkcsscomputedvaluesprivate.h b/gtk/gtkcsscomputedvaluesprivate.h
index a79fc6c..32b70bc 100644
--- a/gtk/gtkcsscomputedvaluesprivate.h
+++ b/gtk/gtkcsscomputedvaluesprivate.h
@@ -88,7 +88,7 @@ GtkCssValue * _gtk_css_computed_values_get_intrinsic_value (GtkCssCom
GtkBitmask * _gtk_css_computed_values_get_difference (GtkCssComputedValues *values,
GtkCssComputedValues *other);
-void _gtk_css_computed_values_start_animations (GtkCssComputedValues *values,
+void _gtk_css_computed_values_create_animations (GtkCssComputedValues *values,
gint64 timestamp,
GtkCssComputedValues *source,
GtkStyleContext *context);
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 07cb1b4..239dd55 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3041,10 +3041,10 @@ gtk_style_context_should_animate (GtkStyleContext *context)
}
static void
-gtk_style_context_start_animations (GtkStyleContext *context,
- GtkCssComputedValues *values,
- GtkCssComputedValues *previous,
- gint64 timestamp)
+gtk_style_context_create_animations (GtkStyleContext *context,
+ GtkCssComputedValues *values,
+ GtkCssComputedValues *previous,
+ gint64 timestamp)
{
if (!gtk_style_context_should_animate (context))
{
@@ -3052,10 +3052,10 @@ gtk_style_context_start_animations (GtkStyleContext *context,
return;
}
- _gtk_css_computed_values_start_animations (values,
- timestamp,
- previous,
- context);
+ _gtk_css_computed_values_create_animations (values,
+ timestamp,
+ previous,
+ context);
if (_gtk_css_computed_values_is_static (values))
{
@@ -3168,8 +3168,11 @@ _gtk_style_context_validate (GtkStyleContext *context,
data = style_data_lookup (context);
- gtk_style_context_start_animations (context, data->store, current->store, timestamp);
- change &= ~GTK_CSS_CHANGE_ANIMATE;
+ gtk_style_context_create_animations (context, data->store, current->store, timestamp);
+ if (_gtk_css_computed_values_is_static (data->store))
+ change &= ~GTK_CSS_CHANGE_ANIMATE;
+ else
+ change |= GTK_CSS_CHANGE_ANIMATE;
changes = _gtk_css_computed_values_get_difference (data->store, current->store);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]