summaryrefslogtreecommitdiff
path: root/test/extend-reflect-similar.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/extend-reflect-similar.c')
-rw-r--r--test/extend-reflect-similar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/extend-reflect-similar.c b/test/extend-reflect-similar.c
index 1ff4039e..c1914b31 100644
--- a/test/extend-reflect-similar.c
+++ b/test/extend-reflect-similar.c
@@ -4,7 +4,7 @@ const char png_filename[] = "romedalen.png";
static cairo_test_draw_function_t draw;
-cairo_test_t test = {
+static const cairo_test_t test = {
"extend-reflect-similar",
"Test CAIRO_EXTEND_REFLECT for surface patterns",
256 + 32*2, 192 + 32*2,
@@ -22,9 +22,11 @@ clone_similar_surface (cairo_surface_t * target, cairo_surface_t *surface)
cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface));
cr = cairo_create (similar);
+ cairo_surface_destroy (similar);
cairo_set_source_surface (cr, surface, 0, 0);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
+ similar = cairo_surface_reference (cairo_get_target (cr));
cairo_destroy (cr);
return similar;
@@ -33,10 +35,11 @@ clone_similar_surface (cairo_surface_t * target, cairo_surface_t *surface)
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ const cairo_test_context_t *ctx = cairo_test_get_context (cr);
cairo_surface_t *surface;
cairo_surface_t *similar;
- surface = cairo_test_create_surface_from_png (png_filename);
+ surface = cairo_test_create_surface_from_png (ctx, png_filename);
similar = clone_similar_surface (cairo_get_group_target (cr), surface);
cairo_set_source_surface (cr, similar, 32, 32);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REFLECT);