From 6c7610067f8a131a4fbba8d2b6a88c27ef229bbe Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Fri, 7 Mar 2008 15:35:31 -0800 Subject: [PATCH] [quartz] handle antialiasing correctly in stroke() and clip() A CoreGraphics bug was fixed so strokes are no longer incorrectly drawn with antialiasing disabled; we no longer have to ignore antialiasing for stroke(). Also, antialiasing was not being correctly set for clip(). This fixes both issues. --- src/cairo-quartz-surface.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 2ea5aef13..4f8937815 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -1390,9 +1390,10 @@ _cairo_quartz_surface_stroke (void *abstract_surface, CGContextSaveGState (surface->cgContext); - // Turning antialiasing off causes misrendering with - // single-pixel lines (e.g. 20,10.5 -> 21,10.5 end up being rendered as 2 pixels) - //CGContextSetShouldAntialias (surface->cgContext, (antialias != CAIRO_ANTIALIAS_NONE)); + // Turning antialiasing off used to cause misrendering with + // single-pixel lines (e.g. 20,10.5 -> 21,10.5 end up being rendered as 2 pixels). + // That's been since fixed in at least 10.5, and in the latest 10.4 dot releases. + CGContextSetShouldAntialias (surface->cgContext, (antialias != CAIRO_ANTIALIAS_NONE)); CGContextSetLineWidth (surface->cgContext, style->line_width); CGContextSetLineCap (surface->cgContext, _cairo_quartz_cairo_line_cap_to_quartz (style->line_cap)); CGContextSetLineJoin (surface->cgContext, _cairo_quartz_cairo_line_join_to_quartz (style->line_join)); @@ -1798,6 +1799,8 @@ _cairo_quartz_surface_intersect_clip_path (void *abstract_surface, stroke.cgContext = surface->cgContext; stroke.ctm_inverse = NULL; + CGContextSetShouldAntialias (surface->cgContext, (antialias != CAIRO_ANTIALIAS_NONE)); + /* path must not be empty. */ CGContextMoveToPoint (surface->cgContext, 0, 0); status = _cairo_quartz_cairo_path_to_quartz_context (path, &stroke);