mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-04 15:20:28 +01:00
record tests: fix when builddir != srcdir
When builddir != srcdir, cairo_test_create_pattern_from_png needs a non-NULL ctx to work with.
This commit is contained in:
parent
aee96d175d
commit
4645ecf3f8
7 changed files with 16 additions and 5 deletions
|
|
@ -1662,6 +1662,14 @@ cairo_test_get_context (cairo_t *cr)
|
|||
return cairo_get_user_data (cr, &_cairo_test_context_key);
|
||||
}
|
||||
|
||||
cairo_t *
|
||||
cairo_test_create (cairo_surface_t *surface, cairo_test_context_t *ctx)
|
||||
{
|
||||
cairo_t *cr = cairo_create(surface);
|
||||
cairo_set_user_data(cr, &_cairo_test_context_key, ctx, NULL);
|
||||
return cr;
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
cairo_test_create_surface_from_png (const cairo_test_context_t *ctx,
|
||||
const char *filename)
|
||||
|
|
|
|||
|
|
@ -317,6 +317,9 @@ cairo_test_get_reference_image (cairo_test_context_t *ctx,
|
|||
cairo_bool_t
|
||||
cairo_test_mkdir (const char *path);
|
||||
|
||||
cairo_t *
|
||||
cairo_test_create (cairo_surface_t *surface, cairo_test_context_t *ctx);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ record_create (cairo_t *target)
|
|||
cairo_t *cr;
|
||||
|
||||
surface = cairo_recording_surface_create (cairo_surface_get_content (cairo_get_target (target)), NULL);
|
||||
cr = cairo_create (surface);
|
||||
cr = cairo_test_create (surface, cairo_test_get_context (target));
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cr;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ record_create (cairo_t *target)
|
|||
cairo_t *cr;
|
||||
|
||||
surface = cairo_recording_surface_create (cairo_surface_get_content (cairo_get_target (target)), NULL);
|
||||
cr = cairo_create (surface);
|
||||
cr = cairo_test_create (surface, cairo_test_get_context (target));
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cr;
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ record_create (cairo_t *target)
|
|||
cairo_t *cr;
|
||||
|
||||
surface = cairo_recording_surface_create (cairo_surface_get_content (cairo_get_target (target)), NULL);
|
||||
cr = cairo_create (surface);
|
||||
cr = cairo_test_create (surface, cairo_test_get_context (target));
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cr;
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ record_create (cairo_t *target)
|
|||
cairo_t *cr;
|
||||
|
||||
surface = cairo_recording_surface_create (cairo_surface_get_content (cairo_get_target (target)), NULL);
|
||||
cr = cairo_create (surface);
|
||||
cr = cairo_test_create (surface, cairo_test_get_context (target));
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cr;
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ record_create (cairo_t *target)
|
|||
cairo_t *cr;
|
||||
|
||||
surface = cairo_recording_surface_create (cairo_surface_get_content (cairo_get_target (target)), NULL);
|
||||
cr = cairo_create (surface);
|
||||
cr = cairo_test_create (surface, cairo_test_get_context (target));
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return cr;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue