[cairo] [PATCH 2/3] quartz: Mark surfaces created clear as is_clear

Andrea Canciani ranma42 at gmail.com
Thu May 17 13:33:43 PDT 2012


This might provide a speedup when clearing an already clear surface
and is required by cairo_surface_create_similar().

Fixes zero-mask.
---
 src/cairo-quartz-surface.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 832e9fc..994b92f 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -2275,6 +2275,7 @@ _cairo_quartz_surface_create_internal (CGContextRef cgContext,
 	surface->cgContext = NULL;
 	surface->cgContextBaseCTM = CGAffineTransformIdentity;
 	surface->imageData = NULL;
+	surface->base.is_clear = TRUE;
 	return surface;
     }
 
@@ -2438,6 +2439,8 @@ cairo_quartz_surface_create (cairo_format_t format,
 	return &surf->base;
     }
 
+    surf->base.is_clear = TRUE;
+
     surf->imageData = imageData;
     surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride);
 
-- 
1.7.7.5 (Apple Git-26)



More information about the cairo mailing list