rendernode: Remove renderer argument

It's not needed to create Cairo nodes anymore.
This commit is contained in:
Benjamin Otte 2018-03-24 21:33:08 +01:00
parent df600669a2
commit e84c6acc4f
4 changed files with 6 additions and 27 deletions

View File

@ -178,8 +178,7 @@ float gsk_outset_shadow_node_get_blur_radius (GskRenderNode
GDK_AVAILABLE_IN_ALL
GskRenderNode * gsk_cairo_node_new (const graphene_rect_t *bounds);
GDK_AVAILABLE_IN_ALL
cairo_t * gsk_cairo_node_get_draw_context (GskRenderNode *node,
GskRenderer *renderer);
cairo_t * gsk_cairo_node_get_draw_context (GskRenderNode *node);
GDK_AVAILABLE_IN_ALL
const cairo_surface_t * gsk_cairo_node_peek_surface (GskRenderNode *node);

View File

@ -1903,7 +1903,6 @@ gsk_cairo_node_new (const graphene_rect_t *bounds)
/**
* gsk_cairo_node_get_draw_context:
* @node: a cairo #GskRenderNode
* @renderer: (nullable): Renderer to optimize for or %NULL for any
*
* Creates a Cairo context for drawing using the surface associated
* to the render node.
@ -1914,15 +1913,13 @@ gsk_cairo_node_new (const graphene_rect_t *bounds)
* cairo_destroy() when done drawing
*/
cairo_t *
gsk_cairo_node_get_draw_context (GskRenderNode *node,
GskRenderer *renderer)
gsk_cairo_node_get_draw_context (GskRenderNode *node)
{
GskCairoNode *self = (GskCairoNode *) node;
int width, height;
cairo_t *res;
g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_CAIRO_NODE), NULL);
g_return_val_if_fail (renderer == NULL || GSK_IS_RENDERER (renderer), NULL);
width = ceilf (node->bounds.size.width);
height = ceilf (node->bounds.size.height);
@ -1954,23 +1951,6 @@ gsk_cairo_node_get_draw_context (GskRenderNode *node,
node->bounds.size.width, node->bounds.size.height);
cairo_clip (res);
if (renderer && GSK_RENDERER_DEBUG_CHECK (renderer, SURFACE))
{
const char *prefix;
prefix = g_getenv ("GSK_DEBUG_PREFIX");
if (!prefix || g_str_has_prefix (node->name, prefix))
{
cairo_save (res);
cairo_rectangle (res,
node->bounds.origin.x + 1, node->bounds.origin.y + 1,
node->bounds.size.width - 2, node->bounds.size.height - 2);
cairo_set_line_width (res, 2);
cairo_set_source_rgb (res, 1, 0, 0);
cairo_stroke (res);
cairo_restore (res);
}
}
return res;
}

View File

@ -1372,7 +1372,7 @@ gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
gtk_snapshot_append_node (snapshot, node);
gsk_render_node_unref (node);
cr = gsk_cairo_node_get_draw_context (node, snapshot->renderer);
cr = gsk_cairo_node_get_draw_context (node);
cairo_translate (cr, current_state->translate_x, current_state->translate_y);

View File

@ -134,7 +134,7 @@ cairo (void)
cairo_t *cr;
node = gsk_cairo_node_new (&GRAPHENE_RECT_INIT (0, 0, 200, 600));
cr = gsk_cairo_node_get_draw_context (node, NULL);
cr = gsk_cairo_node_get_draw_context (node);
cairo_set_source_rgb (cr, 1, 0, 0);
cairo_rectangle (cr, 0, 0, 200, 200);
@ -159,7 +159,7 @@ cairo2 (void)
int i, j;
node = gsk_cairo_node_new (&GRAPHENE_RECT_INIT (0, 0, 200, 200));
cr = gsk_cairo_node_get_draw_context (node, NULL);
cr = gsk_cairo_node_get_draw_context (node);
cairo_set_source_rgb (cr, 1, 1, 1);
@ -263,7 +263,7 @@ ducky (void)
node = gsk_cairo_node_new (&GRAPHENE_RECT_INIT (0, 0,
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf)));
cr = gsk_cairo_node_get_draw_context (node, NULL);
cr = gsk_cairo_node_get_draw_context (node);
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
cairo_paint (cr);
cairo_destroy (cr);