[cairo-commit] 5 commits - boilerplate/cairo-boilerplate-beos.cpp boilerplate/cairo-boilerplate-beos-private.h boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-directfb.c boilerplate/cairo-boilerplate-directfb-private.h boilerplate/cairo-boilerplate-glitz-agl.c boilerplate/cairo-boilerplate-glitz-glx.c boilerplate/cairo-boilerplate-glitz-private.h boilerplate/cairo-boilerplate-glitz-wgl.c boilerplate/cairo-boilerplate.h boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-pdf-private.h boilerplate/cairo-boilerplate-ps.c boilerplate/cairo-boilerplate-ps-private.h boilerplate/cairo-boilerplate-qt.cpp boilerplate/cairo-boilerplate-qt-private.h boilerplate/cairo-boilerplate-quartz.c boilerplate/cairo-boilerplate-quartz-private.h boilerplate/cairo-boilerplate-script.c boilerplate/cairo-boilerplate-script-private.h boilerplate/cairo-boilerplate-svg.c boilerplate/cairo-boilerplate-svg-private.h boilerplate/cairo-boilerplate-test-surfaces.c boilerplate/cairo-boilerplate-test-surfaces-private.h boilerplate/cairo-boilerplate-win32.c boilerplate/cairo-boilerplate-win32-printing.c boilerplate/cairo-boilerplate-win32-private.h boilerplate/cairo-boilerplate-xcb.c boilerplate/cairo-boilerplate-xcb-private.h boilerplate/cairo-boilerplate-xlib.c boilerplate/cairo-boilerplate-xlib-private.h src/cairo.c src/cairo-pdf-surface.c test/cairo-test.c test/cairo-test.h test/group-unaligned.c test/group-unaligned.pdf.ref.png test/group-unaligned.ps.ref.png test/group-unaligned.svg.argb32.ref.png test/group-unaligned.svg.rgb24.ref.png test/group-unaligned.xlib-fallback.ref.png test/group-unaligned.xlib.ref.png test/Makefile.am test/Makefile.sources test/push-group.pdf.argb32.ref.png test/push-group.pdf.ref.png test/push-group.pdf.rgb24.ref.png test/smask-fill.pdf.argb32.ref.png test/smask-fill.pdf.ref.png test/smask-fill.pdf.rgb24.ref.png test/smask-image-mask.pdf.argb32.ref.png test/smask-image-mask.pdf.ref.png test/smask-image-mask.pdf.rgb24.ref.png test/smask-mask.pdf.argb32.ref.png test/smask-mask.pdf.ref.png test/smask-mask.pdf.rgb24.ref.png test/smask-paint.pdf.argb32.ref.png test/smask-paint.pdf.ref.png test/smask-paint.pdf.rgb24.ref.png test/smask.pdf.argb32.ref.png test/smask.pdf.ref.png test/smask.pdf.rgb24.ref.png test/smask-stroke.pdf.argb32.ref.png test/smask-stroke.pdf.ref.png test/smask-stroke.pdf.rgb24.ref.png test/smask-text.pdf.ref.png

Chris Wilson ickle at kemper.freedesktop.org
Sat Jun 27 10:09:26 PDT 2009


 boilerplate/cairo-boilerplate-beos-private.h          |   16 ++--
 boilerplate/cairo-boilerplate-beos.cpp                |    8 +-
 boilerplate/cairo-boilerplate-directfb-private.h      |    8 +-
 boilerplate/cairo-boilerplate-directfb.c              |    8 +-
 boilerplate/cairo-boilerplate-glitz-agl.c             |    8 +-
 boilerplate/cairo-boilerplate-glitz-glx.c             |   10 +--
 boilerplate/cairo-boilerplate-glitz-private.h         |   24 +++----
 boilerplate/cairo-boilerplate-glitz-wgl.c             |    8 +-
 boilerplate/cairo-boilerplate-pdf-private.h           |    8 +-
 boilerplate/cairo-boilerplate-pdf.c                   |   14 ++--
 boilerplate/cairo-boilerplate-ps-private.h            |   16 ++--
 boilerplate/cairo-boilerplate-ps.c                    |   30 ++++-----
 boilerplate/cairo-boilerplate-qt-private.h            |   10 +--
 boilerplate/cairo-boilerplate-qt.cpp                  |    8 +-
 boilerplate/cairo-boilerplate-quartz-private.h        |    8 +-
 boilerplate/cairo-boilerplate-quartz.c                |    8 +-
 boilerplate/cairo-boilerplate-script-private.h        |    8 +-
 boilerplate/cairo-boilerplate-script.c                |   12 +--
 boilerplate/cairo-boilerplate-svg-private.h           |   16 ++--
 boilerplate/cairo-boilerplate-svg.c                   |   30 ++++-----
 boilerplate/cairo-boilerplate-test-surfaces-private.h |   40 ++++++------
 boilerplate/cairo-boilerplate-test-surfaces.c         |   40 ++++++------
 boilerplate/cairo-boilerplate-win32-printing.c        |    8 +-
 boilerplate/cairo-boilerplate-win32-private.h         |   16 ++--
 boilerplate/cairo-boilerplate-win32.c                 |    8 +-
 boilerplate/cairo-boilerplate-xcb-private.h           |    8 +-
 boilerplate/cairo-boilerplate-xcb.c                   |    8 +-
 boilerplate/cairo-boilerplate-xlib-private.h          |   24 +++----
 boilerplate/cairo-boilerplate-xlib.c                  |   45 ++++++++-----
 boilerplate/cairo-boilerplate.c                       |   10 +--
 boilerplate/cairo-boilerplate.h                       |    8 +-
 dev/null                                              |binary
 src/cairo-pdf-surface.c                               |    7 +-
 src/cairo.c                                           |    2 
 test/Makefile.am                                      |   29 ++------
 test/Makefile.sources                                 |    1 
 test/cairo-test.c                                     |    2 
 test/cairo-test.h                                     |    4 -
 test/group-unaligned.c                                |   60 ++++++++++++++++++
 test/group-unaligned.pdf.ref.png                      |binary
 test/group-unaligned.ps.ref.png                       |binary
 test/group-unaligned.svg.argb32.ref.png               |binary
 test/group-unaligned.svg.rgb24.ref.png                |binary
 test/group-unaligned.xlib-fallback.ref.png            |binary
 test/group-unaligned.xlib.ref.png                     |binary
 45 files changed, 318 insertions(+), 260 deletions(-)

New commits:
commit ddadd41a6c3d6a7cdaa07373b24325f59d3436e3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 27 18:07:36 2009 +0100

    [test] Remove broken PDF reference images for push-group
    
    More XFAIL reference images that are now invalidated by changes in
    poppler.

diff --git a/test/Makefile.am b/test/Makefile.am
index ea47220..63a24cc 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -725,9 +725,6 @@ REFERENCE_IMAGES = \
 	pixman-rotate.ref.png \
 	pixman-rotate.rgb24.ref.png \
 	ps-surface-source.ref.png \
-	push-group.pdf.argb32.ref.png \
-	push-group.pdf.ref.png \
-	push-group.pdf.rgb24.ref.png \
 	push-group.ref.png \
 	push-group.rgb24.ref.png \
 	push-group.svg11.argb32.ref.png \
diff --git a/test/push-group.pdf.argb32.ref.png b/test/push-group.pdf.argb32.ref.png
deleted file mode 100644
index 9cb59c9..0000000
Binary files a/test/push-group.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/push-group.pdf.ref.png b/test/push-group.pdf.ref.png
deleted file mode 100644
index e016dbd..0000000
Binary files a/test/push-group.pdf.ref.png and /dev/null differ
diff --git a/test/push-group.pdf.rgb24.ref.png b/test/push-group.pdf.rgb24.ref.png
deleted file mode 100644
index 34d7f74..0000000
Binary files a/test/push-group.pdf.rgb24.ref.png and /dev/null differ
commit 4d233fa4a6a16d400ba959f4c1c5d84fdd26d8fc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 27 18:04:37 2009 +0100

    [test] Remove invalid smask PDF reference images
    
    These need to be recorded using an XFAIL reference. In the meantime, as
    the poppler output has changed, just remove all the invalid PDF reference
    images.

diff --git a/test/Makefile.am b/test/Makefile.am
index 82417c4..ea47220 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -816,9 +816,6 @@ REFERENCE_IMAGES = \
 	skew-extreme.ps2.ref.png \
 	skew-extreme.ps3.ref.png \
 	skew-extreme.ref.png \
-	smask-fill.pdf.argb32.ref.png \
-	smask-fill.pdf.ref.png \
-	smask-fill.pdf.rgb24.ref.png \
 	smask-fill.ref.png \
 	smask-fill.svg11.argb32.ref.png \
 	smask-fill.svg11.ref.png \
@@ -830,35 +827,19 @@ REFERENCE_IMAGES = \
 	smask-fill.test-fallback.rgb24.ref.png \
 	smask-fill.xlib-fallback.ref.png \
 	smask-fill.xlib.ref.png \
-	smask-image-mask.pdf.argb32.ref.png \
-	smask-image-mask.pdf.ref.png \
-	smask-image-mask.pdf.rgb24.ref.png \
 	smask-image-mask.ref.png \
-	smask-mask.pdf.argb32.ref.png \
-	smask-mask.pdf.ref.png \
-	smask-mask.pdf.rgb24.ref.png \
 	smask-mask.ref.png \
 	smask-mask.svg11.ref.png \
 	smask-mask.svg12.ref.png \
-	smask-paint.pdf.argb32.ref.png \
-	smask-paint.pdf.ref.png \
-	smask-paint.pdf.rgb24.ref.png \
 	smask-paint.ref.png \
 	smask-paint.svg11.ref.png \
 	smask-paint.svg12.ref.png \
-	smask.pdf.argb32.ref.png \
-	smask.pdf.ref.png \
-	smask.pdf.rgb24.ref.png \
 	smask.ps2.ref.png \
 	smask.ps3.ref.png \
 	smask.ref.png \
-	smask-stroke.pdf.argb32.ref.png \
-	smask-stroke.pdf.ref.png \
-	smask-stroke.pdf.rgb24.ref.png \
 	smask-stroke.ref.png \
 	smask.svg11.ref.png \
 	smask.svg12.ref.png \
-	smask-text.pdf.ref.png \
 	smask-text.ps2.ref.png \
 	smask-text.ps3.ref.png \
 	smask-text.ref.png \
diff --git a/test/smask-fill.pdf.argb32.ref.png b/test/smask-fill.pdf.argb32.ref.png
deleted file mode 100644
index 51d34d4..0000000
Binary files a/test/smask-fill.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/smask-fill.pdf.ref.png b/test/smask-fill.pdf.ref.png
deleted file mode 100644
index dc87a5f..0000000
Binary files a/test/smask-fill.pdf.ref.png and /dev/null differ
diff --git a/test/smask-fill.pdf.rgb24.ref.png b/test/smask-fill.pdf.rgb24.ref.png
deleted file mode 100644
index 51d34d4..0000000
Binary files a/test/smask-fill.pdf.rgb24.ref.png and /dev/null differ
diff --git a/test/smask-image-mask.pdf.argb32.ref.png b/test/smask-image-mask.pdf.argb32.ref.png
deleted file mode 100644
index 19a20f4..0000000
Binary files a/test/smask-image-mask.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/smask-image-mask.pdf.ref.png b/test/smask-image-mask.pdf.ref.png
deleted file mode 100644
index 54baefd..0000000
Binary files a/test/smask-image-mask.pdf.ref.png and /dev/null differ
diff --git a/test/smask-image-mask.pdf.rgb24.ref.png b/test/smask-image-mask.pdf.rgb24.ref.png
deleted file mode 100644
index 19a20f4..0000000
Binary files a/test/smask-image-mask.pdf.rgb24.ref.png and /dev/null differ
diff --git a/test/smask-mask.pdf.argb32.ref.png b/test/smask-mask.pdf.argb32.ref.png
deleted file mode 100644
index 0dc2135..0000000
Binary files a/test/smask-mask.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/smask-mask.pdf.ref.png b/test/smask-mask.pdf.ref.png
deleted file mode 100644
index 94dac1d..0000000
Binary files a/test/smask-mask.pdf.ref.png and /dev/null differ
diff --git a/test/smask-mask.pdf.rgb24.ref.png b/test/smask-mask.pdf.rgb24.ref.png
deleted file mode 100644
index 0dc2135..0000000
Binary files a/test/smask-mask.pdf.rgb24.ref.png and /dev/null differ
diff --git a/test/smask-paint.pdf.argb32.ref.png b/test/smask-paint.pdf.argb32.ref.png
deleted file mode 100644
index c6b1731..0000000
Binary files a/test/smask-paint.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/smask-paint.pdf.ref.png b/test/smask-paint.pdf.ref.png
deleted file mode 100644
index 7d82db9..0000000
Binary files a/test/smask-paint.pdf.ref.png and /dev/null differ
diff --git a/test/smask-paint.pdf.rgb24.ref.png b/test/smask-paint.pdf.rgb24.ref.png
deleted file mode 100644
index c6b1731..0000000
Binary files a/test/smask-paint.pdf.rgb24.ref.png and /dev/null differ
diff --git a/test/smask-stroke.pdf.argb32.ref.png b/test/smask-stroke.pdf.argb32.ref.png
deleted file mode 100644
index 41321f2..0000000
Binary files a/test/smask-stroke.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/smask-stroke.pdf.ref.png b/test/smask-stroke.pdf.ref.png
deleted file mode 100644
index ac9b5a1..0000000
Binary files a/test/smask-stroke.pdf.ref.png and /dev/null differ
diff --git a/test/smask-stroke.pdf.rgb24.ref.png b/test/smask-stroke.pdf.rgb24.ref.png
deleted file mode 100644
index 41321f2..0000000
Binary files a/test/smask-stroke.pdf.rgb24.ref.png and /dev/null differ
diff --git a/test/smask-text.pdf.ref.png b/test/smask-text.pdf.ref.png
deleted file mode 100644
index 7542d3d..0000000
Binary files a/test/smask-text.pdf.ref.png and /dev/null differ
diff --git a/test/smask.pdf.argb32.ref.png b/test/smask.pdf.argb32.ref.png
deleted file mode 100644
index c6b1731..0000000
Binary files a/test/smask.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/smask.pdf.ref.png b/test/smask.pdf.ref.png
deleted file mode 100644
index 7d82db9..0000000
Binary files a/test/smask.pdf.ref.png and /dev/null differ
diff --git a/test/smask.pdf.rgb24.ref.png b/test/smask.pdf.rgb24.ref.png
deleted file mode 100644
index c6b1731..0000000
Binary files a/test/smask.pdf.rgb24.ref.png and /dev/null differ
commit 86624627e4b196a78cfd9bd642299441e838e0f2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 27 17:53:18 2009 +0100

    [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.

diff --git a/boilerplate/cairo-boilerplate-beos-private.h b/boilerplate/cairo-boilerplate-beos-private.h
index 1d800c2..4505d73 100644
--- a/boilerplate/cairo-boilerplate-beos-private.h
+++ b/boilerplate/cairo-boilerplate-beos-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-beos.cpp b/boilerplate/cairo-boilerplate-beos.cpp
index 497d927..f527627 100644
--- a/boilerplate/cairo-boilerplate-beos.cpp
+++ b/boilerplate/cairo-boilerplate-beos.cpp
@@ -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)
 {
diff --git a/boilerplate/cairo-boilerplate-directfb-private.h b/boilerplate/cairo-boilerplate-directfb-private.h
index 87d1b8b..a34edcb 100644
--- a/boilerplate/cairo-boilerplate-directfb-private.h
+++ b/boilerplate/cairo-boilerplate-directfb-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c
index 7a6462f..ea7a8ad 100644
--- a/boilerplate/cairo-boilerplate-directfb.c
+++ b/boilerplate/cairo-boilerplate-directfb.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-glitz-agl.c b/boilerplate/cairo-boilerplate-glitz-agl.c
index dd10a00..03d0423 100644
--- a/boilerplate/cairo-boilerplate-glitz-agl.c
+++ b/boilerplate/cairo-boilerplate-glitz-agl.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-glitz-glx.c b/boilerplate/cairo-boilerplate-glitz-glx.c
index 4c26b87..a1981eb 100644
--- a/boilerplate/cairo-boilerplate-glitz-glx.c
+++ b/boilerplate/cairo-boilerplate-glitz-glx.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-glitz-private.h b/boilerplate/cairo-boilerplate-glitz-private.h
index 052c7e0..62904c7 100644
--- a/boilerplate/cairo-boilerplate-glitz-private.h
+++ b/boilerplate/cairo-boilerplate-glitz-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-glitz-wgl.c b/boilerplate/cairo-boilerplate-glitz-wgl.c
index dfd764f..9cd11b6 100644
--- a/boilerplate/cairo-boilerplate-glitz-wgl.c
+++ b/boilerplate/cairo-boilerplate-glitz-wgl.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-pdf-private.h b/boilerplate/cairo-boilerplate-pdf-private.h
index 3c34c3e..f4affe7 100644
--- a/boilerplate/cairo-boilerplate-pdf-private.h
+++ b/boilerplate/cairo-boilerplate-pdf-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index c3289f8..3ac380c 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -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 {
diff --git a/boilerplate/cairo-boilerplate-ps-private.h b/boilerplate/cairo-boilerplate-ps-private.h
index b97c7db..7bcce1c 100644
--- a/boilerplate/cairo-boilerplate-ps-private.h
+++ b/boilerplate/cairo-boilerplate-ps-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index c3efcea..2fb03e8 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-qt-private.h b/boilerplate/cairo-boilerplate-qt-private.h
index 4ac8764..917d63b 100644
--- a/boilerplate/cairo-boilerplate-qt-private.h
+++ b/boilerplate/cairo-boilerplate-qt-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-qt.cpp b/boilerplate/cairo-boilerplate-qt.cpp
index 0e0aa7d..addcb12 100644
--- a/boilerplate/cairo-boilerplate-qt.cpp
+++ b/boilerplate/cairo-boilerplate-qt.cpp
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-quartz-private.h b/boilerplate/cairo-boilerplate-quartz-private.h
index 573e247..ccf8a9a 100644
--- a/boilerplate/cairo-boilerplate-quartz-private.h
+++ b/boilerplate/cairo-boilerplate-quartz-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-quartz.c b/boilerplate/cairo-boilerplate-quartz.c
index 3065213..0b5b49d 100644
--- a/boilerplate/cairo-boilerplate-quartz.c
+++ b/boilerplate/cairo-boilerplate-quartz.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-script-private.h b/boilerplate/cairo-boilerplate-script-private.h
index 480e422..ad01d62 100644
--- a/boilerplate/cairo-boilerplate-script-private.h
+++ b/boilerplate/cairo-boilerplate-script-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-script.c b/boilerplate/cairo-boilerplate-script.c
index ae08cbc..3d78078 100644
--- a/boilerplate/cairo-boilerplate-script.c
+++ b/boilerplate/cairo-boilerplate-script.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-svg-private.h b/boilerplate/cairo-boilerplate-svg-private.h
index d8c0a8f..5a64eaf 100644
--- a/boilerplate/cairo-boilerplate-svg-private.h
+++ b/boilerplate/cairo-boilerplate-svg-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index e6c1355..407214c 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-test-surfaces-private.h b/boilerplate/cairo-boilerplate-test-surfaces-private.h
index 55134fe..57bf62d 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces-private.h
+++ b/boilerplate/cairo-boilerplate-test-surfaces-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c
index 0fc92e3..0fec393 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces.c
+++ b/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c
index 13a6551..7a6dafc 100644
--- a/boilerplate/cairo-boilerplate-win32-printing.c
+++ b/boilerplate/cairo-boilerplate-win32-printing.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-win32-private.h b/boilerplate/cairo-boilerplate-win32-private.h
index fc039ae..b09b9f7 100644
--- a/boilerplate/cairo-boilerplate-win32-private.h
+++ b/boilerplate/cairo-boilerplate-win32-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index 4b54a54..83bc7c2 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-xcb-private.h b/boilerplate/cairo-boilerplate-xcb-private.h
index 998e6b9..969b761 100644
--- a/boilerplate/cairo-boilerplate-xcb-private.h
+++ b/boilerplate/cairo-boilerplate-xcb-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index 306f874..23e1b5a 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -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)
diff --git a/boilerplate/cairo-boilerplate-xlib-private.h b/boilerplate/cairo-boilerplate-xlib-private.h
index 265ee97..e4f24ce 100644
--- a/boilerplate/cairo-boilerplate-xlib-private.h
+++ b/boilerplate/cairo-boilerplate-xlib-private.h
@@ -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);
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 03febe9..f40f927 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -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);
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 39a1a4a..0ab45ee 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -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 *
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index 99dc5ce..626ee2e 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -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);
diff --git a/test/Makefile.am b/test/Makefile.am
index 8df6c8e..82417c4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -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 \
diff --git a/test/Makefile.sources b/test/Makefile.sources
index 64c6d04..e37b3e8 100644
--- a/test/Makefile.sources
+++ b/test/Makefile.sources
@@ -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				\
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 715210f..45b644b 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -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;
diff --git a/test/cairo-test.h b/test/cairo-test.h
index b16f340..d644d96 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -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;
 };
diff --git a/test/group-unaligned.c b/test/group-unaligned.c
new file mode 100644
index 0000000..9124a03
--- /dev/null
+++ b/test/group-unaligned.c
@@ -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 at chris-wilson.co.uk>
+ *          Stefan Röllin <stefan.roellin at 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)
diff --git a/test/group-unaligned.pdf.ref.png b/test/group-unaligned.pdf.ref.png
new file mode 100644
index 0000000..0eb39c0
Binary files /dev/null and b/test/group-unaligned.pdf.ref.png differ
diff --git a/test/group-unaligned.ps.ref.png b/test/group-unaligned.ps.ref.png
new file mode 100644
index 0000000..79525ac
Binary files /dev/null and b/test/group-unaligned.ps.ref.png differ
diff --git a/test/group-unaligned.svg.argb32.ref.png b/test/group-unaligned.svg.argb32.ref.png
new file mode 100644
index 0000000..91535f9
Binary files /dev/null and b/test/group-unaligned.svg.argb32.ref.png differ
diff --git a/test/group-unaligned.svg.rgb24.ref.png b/test/group-unaligned.svg.rgb24.ref.png
new file mode 100644
index 0000000..42558a6
Binary files /dev/null and b/test/group-unaligned.svg.rgb24.ref.png differ
diff --git a/test/group-unaligned.xlib-fallback.ref.png b/test/group-unaligned.xlib-fallback.ref.png
new file mode 100644
index 0000000..ed615b2
Binary files /dev/null and b/test/group-unaligned.xlib-fallback.ref.png differ
diff --git a/test/group-unaligned.xlib.ref.png b/test/group-unaligned.xlib.ref.png
new file mode 100644
index 0000000..c62aa5a
Binary files /dev/null and b/test/group-unaligned.xlib.ref.png differ
commit c506ddb58612c69b80b08be3a6d14c5bcc1ac21f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Jun 27 16:54:37 2009 +0100

    [pdf] Restore original surface size after emitting group mask
    
    A trivial fix to reset the original surface size after emitting the group.
    The annoying aspect is that this should have been caught by the test suite.
    Alas, no. A gentle reminder that simple line coverage is insufficient. :(

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 961325b..88b1744 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -4694,8 +4694,10 @@ _cairo_pdf_surface_write_smask_group (cairo_pdf_surface_t     *surface,
 					  group->height);
     /* _mask is a special case that requires two groups - source
      * and mask as well as a smask and gstate dictionary */
-    if (group->operation == PDF_MASK)
-	return _cairo_pdf_surface_write_mask_group (surface, group);
+    if (group->operation == PDF_MASK) {
+	status = _cairo_pdf_surface_write_mask_group (surface, group);
+	goto RESTORE_SIZE;
+    }
 
     status = _cairo_pdf_surface_open_group (surface, &group->group_res);
     if (unlikely (status))
@@ -4747,6 +4749,7 @@ _cairo_pdf_surface_write_smask_group (cairo_pdf_surface_t     *surface,
 
     status = _cairo_pdf_surface_close_group (surface, NULL);
 
+RESTORE_SIZE:
     _cairo_pdf_surface_set_size_internal (surface,
 					  old_width,
 					  old_height);
commit f8a2665840f12ae48798b0ffca49681e276823ba
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 26 07:22:49 2009 +0100

    [cairo] Trivial code tidy

diff --git a/src/cairo.c b/src/cairo.c
index c462e42..0913036 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -513,7 +513,7 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content)
     if (unlikely (status))
 	goto bail;
 
-    group_surface = cairo_surface_create_similar (_cairo_gstate_get_target (cr->gstate),
+    group_surface = cairo_surface_create_similar (parent_surface,
 						  content,
 						  extents.width,
 						  extents.height);


More information about the cairo-commit mailing list