css: Avoid more type checks in hot paths

This commit is contained in:
Timm Bäder 2019-08-17 18:55:35 +02:00
parent 4f3e65e745
commit 6837e80d14
5 changed files with 9 additions and 9 deletions

View File

@ -494,8 +494,8 @@ static gboolean
gtk_css_image_builtin_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
GtkCssImageBuiltin *builtin1 = GTK_CSS_IMAGE_BUILTIN (image1);
GtkCssImageBuiltin *builtin2 = GTK_CSS_IMAGE_BUILTIN (image2);
GtkCssImageBuiltin *builtin1 = (GtkCssImageBuiltin *) image1;
GtkCssImageBuiltin *builtin2 = (GtkCssImageBuiltin *) image2;
return gdk_rgba_equal (&builtin1->fg_color, &builtin2->fg_color)
&& gdk_rgba_equal (&builtin1->bg_color, &builtin2->bg_color);

View File

@ -187,8 +187,8 @@ static gboolean
gtk_css_image_icon_theme_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
GtkCssImageIconTheme *icon_theme1 = GTK_CSS_IMAGE_ICON_THEME (image1);
GtkCssImageIconTheme *icon_theme2 = GTK_CSS_IMAGE_ICON_THEME (image2);
GtkCssImageIconTheme *icon_theme1 = (GtkCssImageIconTheme *) image1;
GtkCssImageIconTheme *icon_theme2 = (GtkCssImageIconTheme *) image2;
return g_str_equal (icon_theme1->name, icon_theme2->name);
}

View File

@ -577,8 +577,8 @@ static gboolean
gtk_css_image_linear_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
GtkCssImageLinear *linear1 = GTK_CSS_IMAGE_LINEAR (image1);
GtkCssImageLinear *linear2 = GTK_CSS_IMAGE_LINEAR (image2);
GtkCssImageLinear *linear1 = (GtkCssImageLinear *) image1;
GtkCssImageLinear *linear2 = (GtkCssImageLinear *) image2;
guint i;
if (linear1->repeating != linear2->repeating ||

View File

@ -629,8 +629,8 @@ static gboolean
gtk_css_image_radial_equal (GtkCssImage *image1,
GtkCssImage *image2)
{
GtkCssImageRadial *radial1 = GTK_CSS_IMAGE_RADIAL (image1);
GtkCssImageRadial *radial2 = GTK_CSS_IMAGE_RADIAL (image2);
GtkCssImageRadial *radial1 = (GtkCssImageRadial *) image1;
GtkCssImageRadial *radial2 = (GtkCssImageRadial *) image2;
guint i;
if (radial1->repeating != radial2->repeating ||

View File

@ -225,7 +225,7 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
else
_gtk_css_value_ref (specified);
value = _gtk_css_value_compute (specified, id, provider, GTK_CSS_STYLE (style), parent_style);
value = _gtk_css_value_compute (specified, id, provider, (GtkCssStyle *)style, parent_style);
gtk_css_static_style_set_value (style, id, value, section);