summaryrefslogtreecommitdiff
path: root/gtk/gtkrenderbackground.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-08-12 18:13:17 -0400
committerEmmanuele Bassi <ebassi@gnome.org>2016-10-18 11:49:14 +0100
commitcffb8ae4b50a9397c0c953a6e7d86a75fc018dc4 (patch)
tree1136e3747ae76069f1b51f09db5890f893b5a381 /gtk/gtkrenderbackground.c
parentf74dd416d6585a98c90741c174aaad4774e204e9 (diff)
downloadgtk+-cffb8ae4b50a9397c0c953a6e7d86a75fc018dc4.tar.gz
Break out the css background render node in a function
This is in preparation for creating separate render nodes for individual backgrounds.
Diffstat (limited to 'gtk/gtkrenderbackground.c')
-rw-r--r--gtk/gtkrenderbackground.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index b41d3a5876..b87724537f 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -428,6 +428,32 @@ gtk_css_style_render_background (GtkCssStyle *style,
cairo_restore (cr);
}
+void
+gtk_css_style_add_background_render_nodes (GtkCssStyle *style,
+ GskRenderer *renderer,
+ GskRenderNode *parent_node,
+ graphene_rect_t *bounds,
+ const char *name,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height,
+ GtkJunctionSides junction)
+{
+ GskRenderNode *bg_node;
+ cairo_t *cr;
+
+ bg_node = gsk_renderer_create_render_node (renderer);
+ gsk_render_node_set_name (bg_node, name);
+ gsk_render_node_set_bounds (bg_node, bounds);
+ cr = gsk_render_node_get_draw_context (bg_node);
+ gtk_css_style_render_background (style, cr, x, y, width, height, junction);
+ cairo_destroy (cr);
+
+ gsk_render_node_append_child (parent_node, bg_node);
+ gsk_render_node_unref (bg_node);
+}
+
static gboolean
corner_value_is_right_angle (GtkCssValue *value)
{