mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-07 01:00:28 +00:00
csscomputedvalues: Handle starting animations differently
This commit is contained in:
parent
bf19d89510
commit
e2cc9f3afc
@ -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 *
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user