[cairo-commit] test/cairo-test.c

Emmanuel Pacaud emmanuel at kemper.freedesktop.org
Thu May 4 05:20:39 PDT 2006


 test/cairo-test.c |    9 +++++++++
 1 files changed, 9 insertions(+)

New commits:
diff-tree a428f11738a52ffabbde3925254278585a72aadb (from 1431a9d4d3655f488b6f6698fdc18c6d65d733b5)
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date:   Thu May 4 14:18:59 2006 +0200

    SVG: Fix bug in test suite causing SVG to fail with rgb24 and device offsets.
    
    Same fix as for PDF and PS surfaces.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index d0052de..a1b3376 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1389,6 +1389,15 @@ svg_surface_write_to_png (cairo_surface_
     svg_target_closure_t *ptc = cairo_surface_get_user_data (surface, &svg_closure_key);
     char    command[4096];
 
+    /* Both surface and ptc->target were originally created at the
+     * same dimensions. We want a 1:1 copy here, so we first clear any
+     * device offset on surface.
+     *
+     * In a more realistic use case of device offsets, the target of
+     * this copying would be of a different size than the source, and
+     * the offset would be desirable during the copy operation. */
+    cairo_surface_set_device_offset (surface, 0, 0);
+
     if (ptc->target) {
 	cairo_t *cr;
 	cr = cairo_create (ptc->target);


More information about the cairo-commit mailing list