[cairo-commit] src/cairo-quartz-surface.c

Brian Ewins brianewins at kemper.freedesktop.org
Thu Nov 15 16:02:41 PST 2007


 src/cairo-quartz-surface.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit 58e828a9a31b91c80336fc4ce323b061226dde2b
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date:   Sun Jul 1 16:11:07 2007 +0100

    [quartz] fill with alpha for EXTEND_NONE
    
    The implementation of EXTEND_NONE was not filling areas outside
    the image with rgba(0,0,0,0). This showed up on the operator-source
    test, the fix makes the quartz and image renderings identical.

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 37053a4..80d352e 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -1211,7 +1211,13 @@ _cairo_quartz_surface_paint (void *abstract_surface,
 	cairo_surface_pattern_t *surface_pattern =
 	    (cairo_surface_pattern_t *) source;
 	cairo_surface_t *pat_surf = surface_pattern->surface;
+
 	CGContextSaveGState (surface->cgContext);
+	CGContextSetRGBFillColor (surface->cgContext, 0.0, 0.0, 0.0, 0.0);
+	CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x,
+							  surface->extents.y,
+							  surface->extents.width,
+							  surface->extents.height));
 	CGContextConcatCTM (surface->cgContext, surface->sourceImageTransform);
 	if (cairo_surface_get_type(pat_surf) == CAIRO_SURFACE_TYPE_QUARTZ) {
 	    CGContextTranslateCTM (surface->cgContext, 0, CGImageGetHeight(surface->sourceImage));
@@ -1291,6 +1297,12 @@ _cairo_quartz_surface_fill (void *abstract_surface,
 	    CGContextClip (surface->cgContext);
 	else
 	    CGContextEOClip (surface->cgContext);
+
+	CGContextSetRGBFillColor (surface->cgContext, 0.0, 0.0, 0.0, 0.0);
+	CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x,
+							  surface->extents.y,
+							  surface->extents.width,
+							  surface->extents.height));
 	CGContextConcatCTM (surface->cgContext, surface->sourceImageTransform);
 	if (cairo_surface_get_type(pat_surf) == CAIRO_SURFACE_TYPE_QUARTZ) {
 	    CGContextTranslateCTM (surface->cgContext, 0, CGImageGetHeight(surface->sourceImage));
@@ -1389,6 +1401,11 @@ _cairo_quartz_surface_stroke (void *abstract_surface,
 	CGContextReplacePathWithStrokedPath (surface->cgContext);
 	CGContextClip (surface->cgContext);
 
+	CGContextSetRGBFillColor (surface->cgContext, 0.0, 0.0, 0.0, 0.0);
+	CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x,
+							  surface->extents.y,
+							  surface->extents.width,
+							  surface->extents.height));
 	CGContextConcatCTM (surface->cgContext, surface->sourceImageTransform);
 	if (cairo_surface_get_type(((cairo_surface_pattern_t*)source)->surface) == CAIRO_SURFACE_TYPE_QUARTZ) {
 	    CGContextTranslateCTM (surface->cgContext, 0, CGImageGetHeight(surface->sourceImage));
@@ -1540,6 +1557,11 @@ _cairo_quartz_surface_show_glyphs (void *abstract_surface,
 				     num_glyphs);
 
     if (action == DO_IMAGE) {
+	CGContextSetRGBFillColor (surface->cgContext, 0.0, 0.0, 0.0, 0.0);
+	CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x,
+							  surface->extents.y,
+							  surface->extents.width,
+							  surface->extents.height));
 	CGContextConcatCTM (surface->cgContext, surface->sourceImageTransform);
 	if (cairo_surface_get_type(((cairo_surface_pattern_t*)source)->surface) == CAIRO_SURFACE_TYPE_QUARTZ) {
 	    CGContextTranslateCTM (surface->cgContext, 0, CGImageGetHeight(surface->sourceImage));


More information about the cairo-commit mailing list