mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
Skip dynamic type check in css value getters
This gets called a lot during snapshotting, and this change alone brings down snapshot time by almost 10% in a syntethic snapshot test.
This commit is contained in:
parent
249a0b1f22
commit
882290b479
@ -44,7 +44,8 @@ static GtkCssValue *
|
||||
gtk_css_animated_style_get_value (GtkCssStyle *style,
|
||||
guint id)
|
||||
{
|
||||
GtkCssAnimatedStyle *animated = GTK_CSS_ANIMATED_STYLE (style);
|
||||
/* This is called a lot, so we avoid a dynamic type check here */
|
||||
GtkCssAnimatedStyle *animated = (GtkCssAnimatedStyle *) style;
|
||||
|
||||
if (animated->animated_values &&
|
||||
id < animated->animated_values->len &&
|
||||
@ -147,8 +148,6 @@ GtkCssValue *
|
||||
gtk_css_animated_style_get_intrinsic_value (GtkCssAnimatedStyle *style,
|
||||
guint id)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (style), NULL);
|
||||
|
||||
return gtk_css_style_get_value (style->style, id);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,8 @@ static GtkCssValue *
|
||||
gtk_css_static_style_get_value (GtkCssStyle *style,
|
||||
guint id)
|
||||
{
|
||||
GtkCssStaticStyle *sstyle = GTK_CSS_STATIC_STYLE (style);
|
||||
/* This is called a lot, so we avoid a dynamic type check here */
|
||||
GtkCssStaticStyle *sstyle = (GtkCssStaticStyle *) style;
|
||||
|
||||
return sstyle->values[id];
|
||||
}
|
||||
|
@ -69,8 +69,6 @@ GtkCssValue *
|
||||
gtk_css_style_get_value (GtkCssStyle *style,
|
||||
guint id)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
|
||||
return GTK_CSS_STYLE_GET_CLASS (style)->get_value (style, id);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user