diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-10-20 08:52:02 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-10-20 13:54:01 +0200 |
commit | 243bd4f0c818715387155ea3d579c17dd93d6da6 (patch) | |
tree | 11f0c328f7d6f61ae4b94920210d20bae72dbd60 /tests/rendernode-create-tests.c | |
parent | eee89587c3afe0c8c240e2bf26cad4719c6bf39a (diff) | |
download | gtk+-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 'tests/rendernode-create-tests.c')
-rw-r--r-- | tests/rendernode-create-tests.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/tests/rendernode-create-tests.c b/tests/rendernode-create-tests.c index 2621c264f5..013188ea65 100644 --- a/tests/rendernode-create-tests.c +++ b/tests/rendernode-create-tests.c @@ -430,10 +430,7 @@ cairo_node (guint n) { GskRenderNode **nodes = g_newa (GskRenderNode *, n); GskRenderNode *container; - cairo_surface_t *surface; graphene_rect_t bounds; - gint offset = 0, height, width, stride; - guchar *buf; guint i; for (i = 0; i < n; i++) @@ -442,25 +439,7 @@ cairo_node (guint n) bounds.origin.x = g_random_int_range (0, 1000 - bounds.size.width); bounds.size.height = g_random_int_range (20, 100); bounds.origin.y = g_random_int_range (0, 1000 - bounds.size.height); - - height = g_random_int_range (1, 100); - width = g_random_int_range (1, 100); - stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, width + offset); - - buf = g_malloc (stride * height); - - if (i % 3 == 0) - surface = NULL; - else - surface = cairo_image_surface_create_for_data (buf, CAIRO_FORMAT_ARGB32, width, height, stride); - - nodes[i] = gsk_cairo_node_new_for_surface (&bounds, surface); - - /* Offset in stride helps to test when image is not 'tightly packed' condition */ - offset = offset ? 0 : 3; - - cairo_surface_destroy (surface); - g_free (buf); + nodes [i] = gsk_cairo_node_new (&bounds); } container = gsk_container_node_new (nodes, n); |