[cairo-commit] src/cairo-mask-compositor.c src/cairo-traps-compositor.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Feb 24 04:15:29 PST 2012


 src/cairo-mask-compositor.c  |    3 ++-
 src/cairo-traps-compositor.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 080bcfcb1a8f1c17340529e51b0d9dfaa9a66fa7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Feb 24 12:12:24 2012 +0000

    {mask,traps}-composite: Restore unsetting of the is-clear flags for the mask
    
    I forgot that creating any image by defaults results in pixman
    calloc'ing the pixel data and so cairo helpfully sets the is-clear flag
    on the surface.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-mask-compositor.c b/src/cairo-mask-compositor.c
index 34e5fbb..7bee372 100644
--- a/src/cairo-mask-compositor.c
+++ b/src/cairo-mask-compositor.c
@@ -174,7 +174,7 @@ create_composite_mask (const cairo_mask_compositor_t *compositor,
 	return _cairo_surface_create_in_error (status);
     }
 
-    {
+    if (!surface->is_clear) {
 	cairo_rectangle_int_t rect;
 
 	rect.x = rect.y = 0;
@@ -231,6 +231,7 @@ create_composite_mask (const cairo_mask_compositor_t *compositor,
 
 out:
     compositor->release (surface);
+    surface->is_clear = FALSE;
     return surface;
 
 error:
diff --git a/src/cairo-traps-compositor.c b/src/cairo-traps-compositor.c
index 146089d..a822f8e 100644
--- a/src/cairo-traps-compositor.c
+++ b/src/cairo-traps-compositor.c
@@ -356,7 +356,7 @@ create_composite_mask (const cairo_traps_compositor_t *compositor,
 	return _cairo_surface_create_in_error (status);
     }
 
-    {
+    if (!surface->is_clear) {
 	cairo_boxes_t clear;
 
 	_cairo_boxes_init_from_rectangle (&clear,
@@ -423,6 +423,7 @@ create_composite_mask (const cairo_traps_compositor_t *compositor,
 out:
     compositor->release (surface);
     cairo_surface_destroy (src);
+    surface->is_clear = FALSE;
     return surface;
 
 error:


More information about the cairo-commit mailing list