[gtk+/wip/ebassi/gsk-renderer: 121/135] Don't create render nodes for empty backgrounds
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gsk-renderer: 121/135] Don't create render nodes for empty backgrounds
- Date: Mon, 17 Oct 2016 16:32:03 +0000 (UTC)
commit a21409c61b6f7237834d42d4d190a0c507a158ef
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Aug 12 18:23:25 2016 -0400
Don't create render nodes for empty backgrounds
gtk/gtkrenderbackground.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index b877245..1189e4c 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]