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

Andrea Canciani ranma42 at kemper.freedesktop.org
Fri Aug 6 11:25:58 PDT 2010


 src/cairo-quartz-surface.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit bdeade14ea86fb5f3ff17accd71711d2c40b1b33
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Wed Jul 28 19:33:53 2010 +0200

    quartz: fix stroking with unbounded operators
    
    Self-intersecting strokes were drawn incorrectly when an unbounded
    operator was used, since the fixup operation also cleared the
    intersection.
    
    Fixes clip-stroke-unbounded.

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 06fe181..70cddeb 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -2408,21 +2408,23 @@ _cairo_quartz_surface_stroke_cg (void *abstract_surface,
     CGContextRestoreGState (surface->cgContext);
 
     if (path_for_unbounded) {
-	CGContextSaveGState (surface->cgContext);
+	unbounded_op_data_t ub;
+	ub.op = UNBOUNDED_STROKE_FILL;
+	ub.u.stroke_fill.fill_rule = CAIRO_FILL_RULE_WINDING;
 
 	CGContextBeginPath (surface->cgContext);
 	CGContextAddPath (surface->cgContext, path_for_unbounded);
 	CGPathRelease (path_for_unbounded);
 
+	CGContextSaveGState (surface->cgContext);
 	CGContextConcatCTM (surface->cgContext, strokeTransform);
 	CGContextReplacePathWithStrokedPath (surface->cgContext);
+	CGContextRestoreGState (surface->cgContext);
 
-	CGContextAddRect (surface->cgContext, CGContextGetClipBoundingBox (surface->cgContext));
-
-	CGContextSetRGBFillColor (surface->cgContext, 0., 0., 0., 0.);
-	CGContextEOFillPath (surface->cgContext);
+	ub.u.stroke_fill.cgPath = CGContextCopyPathPtr (surface->cgContext);
 
-	CGContextRestoreGState (surface->cgContext);
+	_cairo_quartz_fixup_unbounded_operation (surface, &ub, antialias);
+	CGPathRelease (ub.u.stroke_fill.cgPath);
     }
 
     ND((stderr, "-- stroke\n"));


More information about the cairo-commit mailing list