[cairo-commit] src/cairo-xlib-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Wed May 2 13:17:45 PDT 2007


 src/cairo-xlib-surface.c |   10 ++++++++++
 1 files changed, 10 insertions(+)

New commits:
diff-tree c412e42c72c0ff53c678119638357ed95897ed78 (from f3153091b742daffa853f2c31b76aa9689c5165a)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed May 2 21:17:39 2007 +0100

    [cairo-xlib-surface] Check that the acquire surfaces are xlib surfaces
    
    _cairo_pattern_acquire_surfaces() may substitute an image surface for
    either the source or the mask should the backend not support creation
    of similar scratch surfaces or an error occurs during creation. For
    composition we require xlib surfaces and so we must trigger the
    fallback path if this happens.

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index de019e7..8ad9f73 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1287,6 +1287,16 @@ _cairo_xlib_surface_composite (cairo_ope
     if (status)
 	return status;
 
+    /* check for fallback surfaces that we cannot handle ... */
+    if (!_cairo_surface_is_xlib (&src->base)) {
+	status = CAIRO_INT_STATUS_UNSUPPORTED;
+	goto BAIL;
+    }
+    if (mask != NULL && !_cairo_surface_is_xlib (&mask->base)) {
+	status = CAIRO_INT_STATUS_UNSUPPORTED;
+	goto BAIL;
+    }
+
     operation = _recategorize_composite_operation (dst, op, src, &src_attr,
 						   mask_pattern != NULL);
     if (operation == DO_UNSUPPORTED) {


More information about the cairo-commit mailing list