summaryrefslogtreecommitdiff
path: root/testsuite/gsk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-10-20 08:52:02 +0200
committerMatthias Clasen <mclasen@redhat.com>2017-10-20 13:54:01 +0200
commit243bd4f0c818715387155ea3d579c17dd93d6da6 (patch)
tree11f0c328f7d6f61ae4b94920210d20bae72dbd60 /testsuite/gsk
parenteee89587c3afe0c8c240e2bf26cad4719c6bf39a (diff)
downloadgtk+-243bd4f0c818715387155ea3d579c17dd93d6da6.tar.gz
gsk: Tweak cairo node apis
Rename the surface getter to peek, following other render node getters, and make the surface-based constructor private, since it is not something we want to encourage. Update all callers.
Diffstat (limited to 'testsuite/gsk')
-rw-r--r--testsuite/gsk/test-render-nodes.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/testsuite/gsk/test-render-nodes.c b/testsuite/gsk/test-render-nodes.c
index 29119aec96..befbf9ee4f 100644
--- a/testsuite/gsk/test-render-nodes.c
+++ b/testsuite/gsk/test-render-nodes.c
@@ -255,17 +255,18 @@ static GskRenderNode *
ducky (void)
{
GdkPixbuf *pixbuf;
- cairo_surface_t *surface;
GskRenderNode *node;
+ cairo_t *cr;
pixbuf = gdk_pixbuf_new_from_file_at_size ("ducky.png", 100, 100, NULL);
- surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL);
- node = gsk_cairo_node_new_for_surface (&GRAPHENE_RECT_INIT (0, 0,
- cairo_image_surface_get_width (surface),
- cairo_image_surface_get_height (surface)),
- surface);
+ 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);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
+ cairo_paint (cr);
+ cairo_destroy (cr);
g_object_unref (pixbuf);
- cairo_surface_destroy (surface);
return node;
}