Commit a21409c6 authored by Matthias Clasen's avatar Matthias Clasen Committed by Emmanuele Bassi

Don't create render nodes for empty backgrounds

parent e825ca92
......@@ -442,6 +442,20 @@ gtk_css_style_add_background_render_nodes (GtkCssStyle *style,
{
GskRenderNode *bg_node;
cairo_t *cr;
GtkCssValue *background_image;
GtkCssValue *box_shadow;
const GdkRGBA *bg_color;
background_image = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_IMAGE);
bg_color = _gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
box_shadow = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BOX_SHADOW);
/* This is the common default case of no background */
if (gtk_rgba_is_clear (bg_color) &&
_gtk_css_array_value_get_n_values (background_image) == 1 &&
_gtk_css_image_value_get_image (_gtk_css_array_value_get_nth (background_image, 0)) == NULL &&
_gtk_css_shadows_value_is_none (box_shadow))
return;
bg_node = gsk_renderer_create_render_node (renderer);
gsk_render_node_set_name (bg_node, name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment