From c412e42c72c0ff53c678119638357ed95897ed78 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 2 May 2007 21:17:39 +0100 Subject: [PATCH] [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. --- src/cairo-xlib-surface.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index de019e7c8..8ad9f7311 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -1287,6 +1287,16 @@ _cairo_xlib_surface_composite (cairo_operator_t op, 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) {