[cairo-commit] 2 commits - src/cairo-image-compositor.c src/cairo-image-mask-compositor.c src/cairo-mesh-pattern-rasterizer.c

Uli Schlachter psychon at kemper.freedesktop.org
Fri Mar 21 06:11:24 PDT 2014

 src/cairo-image-compositor.c        |    2 +-
 src/cairo-image-mask-compositor.c   |    3 +++
 src/cairo-mesh-pattern-rasterizer.c |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit bb17403622e9ea474017e0039af8ee48b2b285db
Author: Uli Schlachter <psychon at znc.in>
Date:   Fri Mar 14 15:31:34 2014 +0100

    mesh-rasterize: Fix number of iterations
    Commit 44a09f462c fixed a compiler warning, but changed the result of this code.
    This is because the old 'for' loop did one more iteration than the new 'while'
    loop. Fix this by incrementing the loop counter once before the loop.
    Fixes: mesh-pattern mesh-pattern-accuracy mesh-pattern-conical
    mesh-pattern-control-points mesh-pattern-fold mesh-pattern-overlap
    mesh-pattern-transformed record-mesh
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Tested-by: Bryce Harrington <b.harrington at samsung.com>

diff --git a/src/cairo-mesh-pattern-rasterizer.c b/src/cairo-mesh-pattern-rasterizer.c
index 548e880..1b63ca8 100644
--- a/src/cairo-mesh-pattern-rasterizer.c
+++ b/src/cairo-mesh-pattern-rasterizer.c
@@ -728,6 +728,7 @@ rasterize_bezier_patch (unsigned char *data, int width, int height, int stride,
 	dcend[i]   = (col[3][i] - col[1][i]) / v;
+    v++;
     while (v--) {
 	cairo_point_double_t nodes[4];
 	for (i = 0; i < 4; ++i) {
commit 372c8c314a93e0efba53319a120a9ccc2c99658b
Author: Uli Schlachter <psychon at znc.in>
Date:   Fri Mar 14 13:47:38 2014 +0100

    mask compositor: Set a check_composite method
    Commit 503b6b9e2ea6 added a check_composite method to the mask compositor, but
    only added it to one of the existing implementations. This commit fixes that.
    In cairo-image-compositor.c, there is already a check_composite method which
    just returns success for the traps compositor. This commit makes the mask
    compositor use that one.
    I don't want to say much about cairo-image-mask-compositor.c except that I
    wondered why this file and the file above both define a non-static function
    called _cairo_image_mask_compositor_get(). In my opinion, that file should just
    be deleted, since it confuses e.g. ctags, but I'll let someone else clean this
    Fixes 493 crashes in the test suite for the test-mask target.
    Signed-off-by: Uli Schlachter <psychon at znc.in>
    Tested-by: Bryce Harrington <b.harrington at samsung.com>

diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
index 03468a6..51ffc34 100644
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -1257,7 +1257,7 @@ _cairo_image_mask_compositor_get (void)
 	compositor.draw_image_boxes = draw_image_boxes;
 	compositor.fill_rectangles = fill_rectangles;
 	compositor.fill_boxes = fill_boxes;
-	//compositor.check_composite = check_composite;
+	compositor.check_composite = check_composite;
 	compositor.composite = composite;
 	//compositor.lerp = lerp;
 	//compositor.check_composite_boxes = check_composite_boxes;
diff --git a/src/cairo-image-mask-compositor.c b/src/cairo-image-mask-compositor.c
index 33fd6dd..bb990dd 100644
--- a/src/cairo-image-mask-compositor.c
+++ b/src/cairo-image-mask-compositor.c
@@ -48,6 +48,8 @@
 #include "cairo-compositor-private.h"
 #include "cairo-region-private.h"
+#error This file isn't included in any Makefile
 static cairo_int_status_t
 acquire (void *abstract_dst)
@@ -398,6 +400,7 @@ _cairo_image_mask_compositor_get (void)
 	compositor.draw_image = draw_image;
 	compositor.fill_rectangles = fill_rectangles;
 	compositor.fill_boxes = fill_boxes;
+#error check_composite must never be NULL, because it gets called without a NULL pointer check
 	//compositor.check_composite = check_composite;
 	compositor.composite = composite;
 	//compositor.check_composite_boxes = check_composite_boxes;

More information about the cairo-commit mailing list