From 242fbb010efffb3a75f2e824bbdbb3a75ad51d12 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 16 Sep 2011 21:55:05 +0100 Subject: [PATCH] image: Use the recording surface content for the recording source The previous commit should have been a enormous warning that something was horribly wrong. I was determined to preserve the optimisation of replaying onto the matching format, however, we need to provide an alpha channel if required. Signed-off-by: Chris Wilson --- src/cairo-image-source.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cairo-image-source.c b/src/cairo-image-source.c index 53423ef03..c6c53457e 100644 --- a/src/cairo-image-source.c +++ b/src/cairo-image-source.c @@ -642,8 +642,13 @@ _pixman_image_for_recording (cairo_image_surface_t *dst, if (extend == CAIRO_EXTEND_NONE) limit = *extents; - clone = cairo_image_surface_create (is_mask ? CAIRO_FORMAT_A8 : dst->format, - limit.width, limit.height); + if (dst->base.content == source->content) + clone = cairo_image_surface_create (dst->format, + limit.width, limit.height); + else + clone = _cairo_image_surface_create_with_content (source->content, + limit.width, + limit.height); cairo_surface_set_device_offset (clone, limit.x, limit.y); m = NULL;