diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-09-28 13:34:50 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-09-28 14:57:12 +0100 |
commit | 9841d9d58ea286f798626d325d50a85bf3f02c8f (patch) | |
tree | d42133d4101b98bbde056f8fdee6e72ab3ef19a8 /boilerplate/cairo-boilerplate-test-surfaces.c | |
parent | cca1fc6358e9d0213dd2b41a5bfd1629eec6511e (diff) | |
download | cairo-9841d9d58ea286f798626d325d50a85bf3f02c8f.tar.gz |
Automate error checking for fallback-resolution.
For this we extend the boilerplate get_image() routines to extract a
single page out of a paginated document and then proceed to manually
check each page of the fallback-resolution test.
(Well that's the theory, in practice SVG doesn't support multiple pages
and so we just generate a new surface for each resolution. But the
infrastructure is in place so that we can automate other tests,
e.g. test/multi-pages.)
Diffstat (limited to 'boilerplate/cairo-boilerplate-test-surfaces.c')
-rw-r--r-- | boilerplate/cairo-boilerplate-test-surfaces.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c index 297faffe7..f6fd63af8 100644 --- a/boilerplate/cairo-boilerplate-test-surfaces.c +++ b/boilerplate/cairo-boilerplate-test-surfaces.c @@ -166,6 +166,7 @@ _cairo_boilerplate_test_paginated_surface_write_to_png (cairo_surface_t *surface cairo_surface_t * _cairo_boilerplate_test_paginated_get_image_surface (cairo_surface_t *surface, + int page, int width, int height) { @@ -173,6 +174,10 @@ _cairo_boilerplate_test_paginated_get_image_surface (cairo_surface_t *surface, test_paginated_closure_t *tpc; cairo_status_t status; + /* XXX separate finish as per PDF */ + if (page != 0) + return cairo_boilerplate_surface_create_in_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH); + /* show page first. the automatic show_page is too late for us */ cairo_surface_show_page (surface); status = cairo_surface_status (surface); @@ -200,7 +205,7 @@ _cairo_boilerplate_test_paginated_get_image_surface (cairo_surface_t *surface, cairo_surface_set_device_offset (image, tpc->width - width, tpc->height - height); - surface = _cairo_boilerplate_get_image_surface (image, width, height); + surface = _cairo_boilerplate_get_image_surface (image, 0, width, height); cairo_surface_destroy (image); return surface; } |