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

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 16 11:33:24 PDT 2011


 src/cairo-image-source.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ab924b11a805caaa6e7a1e39ce69f0a9a31e1405
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 16 19:29:27 2011 +0100

    image: Use A8 for creating a mask from a recording surface
    
    When applying masks, typically it is useful to have an alpha channel.
    
    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 63fcc2f..53423ef 100644
--- a/src/cairo-image-source.c
+++ b/src/cairo-image-source.c
@@ -642,7 +642,8 @@ _pixman_image_for_recording (cairo_image_surface_t *dst,
     if (extend == CAIRO_EXTEND_NONE)
 	limit = *extents;
 
-    clone = cairo_image_surface_create (dst->format, limit.width, limit.height);
+    clone = cairo_image_surface_create (is_mask ? CAIRO_FORMAT_A8 : dst->format,
+					limit.width, limit.height);
     cairo_surface_set_device_offset (clone, limit.x, limit.y);
 
     m = NULL;


More information about the cairo-commit mailing list