[cairo-commit] 2 commits - src/cairo-image-surface.c test/operator-source.c test/operator-source.image16.ref.png test/operator-source.pdf.rgb24.ref.png test/operator-source.quartz.argb32.ref.png test/operator-source.quartz.rgb24.ref.png test/operator-source.ref.png test/operator-source.rgb24.ref.png test/operator-source.svg12.argb32.xfail.png test/operator-source.svg12.rgb24.xfail.png test/operator-source.xlib-fallback.ref.png test/operator-source.xlib.ref.png test/operator-source.xlib.rgb24.ref.png

Uli Schlachter psychon at kemper.freedesktop.org
Thu Mar 31 06:48:19 PDT 2011


 dev/null                                   |binary
 src/cairo-image-surface.c                  |    5 +++++
 test/operator-source.c                     |   25 +++++++++++++++++++++----
 test/operator-source.image16.ref.png       |binary
 test/operator-source.ref.png               |binary
 test/operator-source.rgb24.ref.png         |binary
 test/operator-source.xlib-fallback.ref.png |binary
 test/operator-source.xlib.ref.png          |binary
 test/operator-source.xlib.rgb24.ref.png    |binary
 9 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit a80bf9ed43ebb510027f95f623a012c55f7566b3
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Mar 21 18:46:32 2011 +0100

    image: Don't use the fast path if it's wrong
    
    Fixes the new "operator-source" test and the original report from:
    http://lists.cairographics.org/archives/cairo/2011-March/021827.html
    
    I tested this code path with all operators and "source" is the only one which
    causes issues with rendering outside of the boxes.
    
    Possibly fixes: https://bugs.freedesktop.org/show_bug.cgi?id=35407
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 2a421b7..7097fa4 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -2781,6 +2781,11 @@ _composite_unaligned_boxes (cairo_image_surface_t *dst,
     const struct _cairo_boxes_chunk *chunk;
     int i, src_x, src_y;
 
+    /* The below code breaks for operator source. This can best be seen with
+     * multiple boxes where black is drawn to dst outside of the boxes. */
+    if (op == CAIRO_OPERATOR_SOURCE)
+	return CAIRO_INT_STATUS_UNSUPPORTED;
+
     i = CAIRO_STRIDE_FOR_WIDTH_BPP (extents->bounded.width, 8) * extents->bounded.height;
     if ((unsigned) i <= sizeof (buf)) {
 	mask = pixman_image_create_bits (PIXMAN_a8,
commit 532cbcfbc7d1b710daf7b506bfd87048dd8d44db
Author: Uli Schlachter <psychon at znc.in>
Date:   Mon Mar 21 18:42:27 2011 +0100

    Add unaligned boxes to "operator-source" test
    
    These ref images might be wrong. Since the test failed here already before this
    change, I took the old ref images and copied the new part from the test output
    underneath it. For the backends that I don't have, I deleted the images (sorry).
    
    After this, the "operator-source" test still fails for me on all backends, but
    much more prominently so for the image backend. xcb-render-0.0/argb32 gets
    compared against a rgb24 ref image, but apparently this was already the case
    before(?). The rest are minor differences.
    
    This reveals a bug in the image backend. This was originally reported here:
    http://lists.cairographics.org/archives/cairo/2011-March/021827.html
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/test/operator-source.c b/test/operator-source.c
index d734167..3dee570 100644
--- a/test/operator-source.c
+++ b/test/operator-source.c
@@ -22,6 +22,7 @@
  *
  * Authors: Kristian Høgsberg <krh at redhat.com>
  *          Owen Taylor <otaylor at redhat.com>
+ *          Uli Schlachter <psychon at znc.in>
  */
 
 #include <math.h>
@@ -145,12 +146,15 @@ draw_polygon (cairo_t *cr, int x, int y)
 }
 
 static void
-draw_rects (cairo_t *cr, int x, int y)
+draw_rects (cairo_t *cr, int x, int y, double offset)
 {
-    double block_width = (int)(0.33 * WIDTH + 0.5);
-    double block_height = (int)(0.33 * HEIGHT + 0.5);
+    double block_width = (int)(0.33 * WIDTH + 0.5) - offset/3;
+    double block_height = (int)(0.33 * HEIGHT + 0.5) - offset/3;
     int i, j;
 
+    x += offset/2;
+    y += offset/2;
+
     for (i = 0; i < 3; i++)
 	for (j = 0; j < 3; j++)
 	    if ((i + j) % 2 == 0)
@@ -161,6 +165,18 @@ draw_rects (cairo_t *cr, int x, int y)
     cairo_fill (cr);
 }
 
+static void
+draw_aligned_rects (cairo_t *cr, int x, int y)
+{
+    draw_rects (cr, x, y, 0);
+}
+
+static void
+draw_unaligned_rects (cairo_t *cr, int x, int y)
+{
+    draw_rects (cr, x, y, 2.1);
+}
+
 static void (* const pattern_funcs[])(cairo_t *cr, int x, int y) = {
     set_solid_pattern,
     set_translucent_pattern,
@@ -172,7 +188,8 @@ static void (* const draw_funcs[])(cairo_t *cr, int x, int y) = {
     draw_mask,
     draw_glyphs,
     draw_polygon,
-    draw_rects
+    draw_aligned_rects,
+    draw_unaligned_rects
 };
 
 #define IMAGE_WIDTH (ARRAY_LENGTH (pattern_funcs) * (WIDTH + PAD) + PAD)
diff --git a/test/operator-source.image16.ref.png b/test/operator-source.image16.ref.png
index 09173e0..4556260 100644
Binary files a/test/operator-source.image16.ref.png and b/test/operator-source.image16.ref.png differ
diff --git a/test/operator-source.pdf.rgb24.ref.png b/test/operator-source.pdf.rgb24.ref.png
deleted file mode 100644
index 9482ed8..0000000
Binary files a/test/operator-source.pdf.rgb24.ref.png and /dev/null differ
diff --git a/test/operator-source.quartz.argb32.ref.png b/test/operator-source.quartz.argb32.ref.png
deleted file mode 100644
index 83d788c..0000000
Binary files a/test/operator-source.quartz.argb32.ref.png and /dev/null differ
diff --git a/test/operator-source.quartz.rgb24.ref.png b/test/operator-source.quartz.rgb24.ref.png
deleted file mode 100644
index 038662f..0000000
Binary files a/test/operator-source.quartz.rgb24.ref.png and /dev/null differ
diff --git a/test/operator-source.ref.png b/test/operator-source.ref.png
index 376a707..c8a2b2e 100644
Binary files a/test/operator-source.ref.png and b/test/operator-source.ref.png differ
diff --git a/test/operator-source.rgb24.ref.png b/test/operator-source.rgb24.ref.png
index 013d8a4..59ad742 100644
Binary files a/test/operator-source.rgb24.ref.png and b/test/operator-source.rgb24.ref.png differ
diff --git a/test/operator-source.svg12.argb32.xfail.png b/test/operator-source.svg12.argb32.xfail.png
deleted file mode 100644
index ccf4315..0000000
Binary files a/test/operator-source.svg12.argb32.xfail.png and /dev/null differ
diff --git a/test/operator-source.svg12.rgb24.xfail.png b/test/operator-source.svg12.rgb24.xfail.png
deleted file mode 100644
index 827521b..0000000
Binary files a/test/operator-source.svg12.rgb24.xfail.png and /dev/null differ
diff --git a/test/operator-source.xlib-fallback.ref.png b/test/operator-source.xlib-fallback.ref.png
index 79fb2c5..4527ce7 100644
Binary files a/test/operator-source.xlib-fallback.ref.png and b/test/operator-source.xlib-fallback.ref.png differ
diff --git a/test/operator-source.xlib.ref.png b/test/operator-source.xlib.ref.png
index 8e2f5e6..4732f52 100644
Binary files a/test/operator-source.xlib.ref.png and b/test/operator-source.xlib.ref.png differ
diff --git a/test/operator-source.xlib.rgb24.ref.png b/test/operator-source.xlib.rgb24.ref.png
index a762d60..09209af 100644
Binary files a/test/operator-source.xlib.rgb24.ref.png and b/test/operator-source.xlib.rgb24.ref.png differ


More information about the cairo-commit mailing list