[test] Add group-unaligned

Test case for:
   Bug 22441 -- Unexpected shift with push_group and pop_group
   https://bugs.freedesktop.org/show_bug.cgi?id=22441

This is a test that demonstrates the error in the pdf backend when using
groups on surfaces with non-integer sizes. In order to create such a
surface, we need to update the boilerplate to use doubles instead of
integers when specifying the surface size.
This commit is contained in:
Chris Wilson 2009-06-27 17:53:18 +01:00
parent c506ddb586
commit 86624627e4
42 changed files with 312 additions and 235 deletions

View file

@ -10,10 +10,10 @@ CAIRO_BEGIN_DECLS
extern cairo_surface_t *
_cairo_boilerplate_beos_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -24,10 +24,10 @@ _cairo_boilerplate_beos_cleanup (void* closure);
extern cairo_surface_t *
_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -172,8 +172,8 @@ struct beos_boilerplate_closure
cairo_surface_t *
_cairo_boilerplate_beos_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
double width,
double height,
cairo_boilerplate_mode_t mode,
void **closure)
{
@ -207,8 +207,8 @@ _cairo_boilerplate_beos_cleanup (void* closure)
cairo_surface_t *
_cairo_boilerplate_beos_create_surface_for_bitmap (const char *name,
cairo_content_t content,
int width,
int height,
double width,
double height,
cairo_boilerplate_mode_t mode,
void **closure)
{

View file

@ -10,10 +10,10 @@ CAIRO_BEGIN_DECLS
extern cairo_surface_t *
_cairo_boilerplate_directfb_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -171,10 +171,10 @@ ERROR:
cairo_surface_t *
_cairo_boilerplate_directfb_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -101,10 +101,10 @@ _cairo_boilerplate_glitz_agl_create_surface_internal (glitz_format_name_t form
cairo_surface_t *
_cairo_boilerplate_glitz_agl_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -153,11 +153,11 @@ _cairo_boilerplate_glitz_glx_create_surface_internal (glitz_format_name_t form
cairo_surface_t *
_cairo_boilerplate_glitz_glx_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
cairo_content_t content,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -41,10 +41,10 @@ typedef struct _glitz_target_closure_base {
cairo_surface_t *
_cairo_boilerplate_glitz_glx_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -57,10 +57,10 @@ _cairo_boilerplate_glitz_glx_cleanup (void *closure);
cairo_surface_t *
_cairo_boilerplate_glitz_agl_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -73,10 +73,10 @@ _cairo_boilerplate_glitz_agl_cleanup (void *closure);
cairo_surface_t *
_cairo_boilerplate_glitz_wgl_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -100,10 +100,10 @@ _cairo_boilerplate_glitz_wgl_create_surface_internal (glitz_format_name_t form
cairo_surface_t *
_cairo_boilerplate_glitz_wgl_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_pdf_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -51,10 +51,10 @@ typedef struct _pdf_target_closure
cairo_surface_t *
_cairo_boilerplate_pdf_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -69,8 +69,8 @@ _cairo_boilerplate_pdf_create_surface (const char *name,
*closure = ptc = xmalloc (sizeof (pdf_target_closure_t));
ptc->width = width;
ptc->height = height;
ptc->width = ceil (width);
ptc->height = ceil (height);
xasprintf (&ptc->filename, "%s.out.pdf", name);
xunlink (ptc->filename);
@ -85,7 +85,7 @@ _cairo_boilerplate_pdf_create_surface (const char *name,
ptc->target = surface;
surface = cairo_surface_create_similar (ptc->target,
CAIRO_CONTENT_COLOR,
width, height);
ptc->width, ptc->height);
if (cairo_surface_status (surface))
goto CLEANUP_TARGET;
} else {

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_ps2_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -41,10 +41,10 @@ _cairo_boilerplate_ps2_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_ps3_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -68,10 +68,10 @@ static cairo_surface_t *
_cairo_boilerplate_ps_create_surface (const char *name,
cairo_content_t content,
cairo_ps_level_t level,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -90,8 +90,8 @@ _cairo_boilerplate_ps_create_surface (const char *name,
xunlink (ptc->filename);
ptc->level = level;
ptc->width = width;
ptc->height = height;
ptc->width = ceil (width);
ptc->height = ceil (height);
surface = cairo_ps_surface_create (ptc->filename, width, height);
if (cairo_surface_status (surface))
@ -105,7 +105,7 @@ _cairo_boilerplate_ps_create_surface (const char *name,
ptc->target = surface;
surface = cairo_surface_create_similar (ptc->target,
CAIRO_CONTENT_COLOR,
width, height);
ptc->width, ptc->height);
if (cairo_surface_status (surface))
goto CLEANUP_TARGET;
} else {
@ -130,10 +130,10 @@ _cairo_boilerplate_ps_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_ps2_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -149,10 +149,10 @@ _cairo_boilerplate_ps2_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_ps3_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -39,11 +39,11 @@ CAIRO_BEGIN_DECLS
extern cairo_surface_t *
_cairo_boilerplate_qt_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
cairo_content_t content,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -56,10 +56,10 @@ _cairo_boilerplate_qt_cleanup (void *closure)
cairo_surface_t *
_cairo_boilerplate_qt_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_quartz_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -32,10 +32,10 @@
cairo_surface_t *
_cairo_boilerplate_quartz_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_script_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -33,17 +33,17 @@ cairo_user_data_key_t script_closure_key;
typedef struct _script_target_closure {
char *filename;
int width;
int height;
double width;
double height;
} script_target_closure_t;
cairo_surface_t *
_cairo_boilerplate_script_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_svg11_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -41,10 +41,10 @@ _cairo_boilerplate_svg11_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_svg12_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -48,10 +48,10 @@ static cairo_surface_t *
_cairo_boilerplate_svg_create_surface (const char *name,
cairo_content_t content,
cairo_svg_version_t version,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -62,8 +62,8 @@ _cairo_boilerplate_svg_create_surface (const char *name,
*closure = ptc = xmalloc (sizeof (svg_target_closure_t));
ptc->width = width;
ptc->height = height;
ptc->width = ceil (width);
ptc->height = ceil (height);
xasprintf (&ptc->filename, "%s.out.svg", name);
xunlink (ptc->filename);
@ -79,7 +79,7 @@ _cairo_boilerplate_svg_create_surface (const char *name,
ptc->target = surface;
surface = cairo_surface_create_similar (ptc->target,
CAIRO_CONTENT_COLOR,
width, height);
ptc->width, ptc->height);
if (cairo_surface_status (surface))
goto CLEANUP_TARGET;
} else
@ -103,10 +103,10 @@ _cairo_boilerplate_svg_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_svg11_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -123,10 +123,10 @@ _cairo_boilerplate_svg11_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_svg12_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_test_fallback_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -41,10 +41,10 @@ _cairo_boilerplate_test_fallback_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_fallback16_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -53,10 +53,10 @@ _cairo_boilerplate_test_fallback16_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_meta_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -64,10 +64,10 @@ _cairo_boilerplate_test_meta_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_null_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -75,10 +75,10 @@ _cairo_boilerplate_test_null_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_paginated_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -38,10 +38,10 @@
cairo_surface_t *
_cairo_boilerplate_test_fallback_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -53,10 +53,10 @@ _cairo_boilerplate_test_fallback_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_fallback16_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -68,10 +68,10 @@ _cairo_boilerplate_test_fallback16_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_meta_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -83,10 +83,10 @@ _cairo_boilerplate_test_meta_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_test_null_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -108,10 +108,10 @@ typedef struct {
cairo_surface_t *
_cairo_boilerplate_test_paginated_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -164,10 +164,10 @@ create_printer_dc (win32_target_closure_t *ptc)
cairo_surface_t *
_cairo_boilerplate_win32_printing_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_win32_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -41,10 +41,10 @@ _cairo_boilerplate_win32_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_win32_printing_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -32,10 +32,10 @@
cairo_surface_t *
_cairo_boilerplate_win32_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -30,10 +30,10 @@
cairo_surface_t *
_cairo_boilerplate_xcb_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -50,10 +50,10 @@ _cairo_boilerplate_xcb_synchronize (void *closure)
cairo_surface_t *
_cairo_boilerplate_xcb_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)

View file

@ -31,10 +31,10 @@
cairo_surface_t *
_cairo_boilerplate_xlib_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -43,10 +43,10 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_xlib_reference_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);
@ -54,10 +54,10 @@ _cairo_boilerplate_xlib_reference_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_xlib_fallback_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -188,10 +188,10 @@ _cairo_boilerplate_xlib_perf_create_surface (Display *dpy,
cairo_surface_t *
_cairo_boilerplate_xlib_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -202,9 +202,12 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
*closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t));
if (width == 0)
width = ceil (width);
if (width < 1)
width = 1;
if (height == 0)
height = ceil (height);
if (height < 1)
height = 1;
xtc->dpy = dpy = XOpenDisplay (NULL);
@ -228,10 +231,10 @@ _cairo_boilerplate_xlib_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_xlib_reference_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -253,9 +256,12 @@ _cairo_boilerplate_xlib_reference_create_surface (const char *name,
*closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t));
if (width == 0)
width = ceil (width);
if (width < 1)
width = 1;
if (height == 0)
height = ceil (height);
if (height < 1)
height = 1;
xtc->dpy = dpy = XOpenDisplay (display);
@ -289,10 +295,10 @@ _cairo_boilerplate_xlib_reference_create_surface (const char *name,
cairo_surface_t *
_cairo_boilerplate_xlib_fallback_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -316,9 +322,12 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char *name,
*closure = xtc = xmalloc (sizeof (xlib_target_closure_t));
if (width == 0)
width = ceil (width);
if (width < 1)
width = 1;
if (height == 0)
height = ceil (height);
if (height < 1)
height = 1;
xtc->dpy = dpy = XOpenDisplay (NULL);

View file

@ -141,10 +141,10 @@ cairo_boilerplate_format_from_content (cairo_content_t content)
static cairo_surface_t *
_cairo_boilerplate_image_create_surface (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure)
@ -162,7 +162,7 @@ _cairo_boilerplate_image_create_surface (const char *name,
return NULL;
}
return cairo_image_surface_create (format, width, height);
return cairo_image_surface_create (format, ceil (width), ceil (height));
}
cairo_surface_t *

View file

@ -116,10 +116,10 @@ typedef enum {
typedef cairo_surface_t *
(*cairo_boilerplate_create_surface_t) (const char *name,
cairo_content_t content,
int width,
int height,
int max_width,
int max_height,
double width,
double height,
double max_width,
double max_height,
cairo_boilerplate_mode_t mode,
int id,
void **closure);

View file

@ -502,6 +502,13 @@ REFERENCE_IMAGES = \
gradient-zero-stops.rgb24.ref.png \
group-clip.ref.png \
group-paint.ref.png \
group-unaligned.ref.png \
group-unaligned.pdf.ref.png \
group-unaligned.ps.ref.png \
group-unaligned.svg.argb32.ref.png \
group-unaligned.svg.rgb24.ref.png \
group-unaligned.xlib.ref.png \
group-unaligned.xlib-fallback.ref.png \
huge-linear.ps3.ref.png \
huge-linear.ref.png \
huge-radial.ps3.ref.png \

View file

@ -81,6 +81,7 @@ test_sources = \
gradient-zero-stops.c \
group-clip.c \
group-paint.c \
group-unaligned.c \
huge-linear.c \
huge-radial.c \
image-surface-source.c \

View file

@ -663,7 +663,7 @@ cairo_test_for_target (cairo_test_context_t *ctx,
cairo_bool_t have_output = FALSE;
cairo_bool_t have_result = FALSE;
void *closure;
int width, height;
double width, height;
cairo_bool_t have_output_dir;
#if HAVE_MEMFAULT
int malloc_failure_iterations = ctx->malloc_failure;

View file

@ -101,8 +101,8 @@ struct _cairo_test {
const char *description;
const char *keywords;
const char *requirements;
int width;
int height;
double width;
double height;
cairo_test_preamble_function_t *preamble;
cairo_test_draw_function_t *draw;
};

60
test/group-unaligned.c Normal file
View file

@ -0,0 +1,60 @@
/*
* Copyright © Chris Wilson, 2008
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of
* Chris Wilson not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Red Hat, Inc. makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* CHRIS WILSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors: Chris Wilson <chris@chris-wilson.co.uk>
* Stefan Röllin <stefan.roellin@gmx.ch>
*/
#include "cairo-test.h"
static void
circle (cairo_t* cr, double xc, double yc, double radius)
{
cairo_arc (cr, xc, yc, radius, 0.0, 2*M_PI);
}
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
cairo_set_source_rgb (cr, 1, 0, 0);
circle (cr, 12.5, 12.5, 10.);
cairo_fill (cr);
cairo_push_group (cr);
cairo_set_source_rgb (cr, 0, 0, 1);
circle (cr, 12.5, 12.5, 10.);
cairo_fill (cr);
cairo_pop_group_to_source (cr);
cairo_paint (cr);
return CAIRO_TEST_SUCCESS;
}
CAIRO_TEST (group_unaligned,
"test non-integer sized sub-surface",
"group", /* keywords */
NULL, /* requirements */
35.5, 35.5,
NULL, draw)

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B