[cairo-commit] src/cairo-image-source.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 16 14:01:34 PDT 2011


 src/cairo-image-source.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 242fbb010efffb3a75f2e824bbdbb3a75ad51d12
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 16 21:55:05 2011 +0100

    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 <chris at chris-wilson.co.uk>

diff --git a/src/cairo-image-source.c b/src/cairo-image-source.c
index 53423ef..c6c5345 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;


More information about the cairo-commit mailing list