[cairo] [PATCH] mask compositor: Set a check_composite method
Bryce W. Harrington
b.harrington at samsung.com
Tue Mar 18 18:09:39 PDT 2014
On Fri, Mar 14, 2014 at 02:26:58PM +0100, Uli Schlachter wrote:
> 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
> up.
>
> Fixes 493 crashes in the test suite for the test-mask target.
>
> Signed-off-by: Uli Schlachter <psychon at znc.in>
No insights from me about cairo-image-mask-compositor.c but +1 to
deleting it if it's entirely unused. Can always be resurrected from VCS
if someone needs it.
Tested-by: Bryce Harrington <b.harrington at samsung.com>
> ---
> src/cairo-image-compositor.c | 2 +-
> src/cairo-image-mask-compositor.c | 3 +++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> 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;
> --
> 1.9.0
>
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
More information about the cairo
mailing list