michael@0: # HG changeset patch michael@0: # User Robert O'Callahan michael@0: # Date 1250204857 -43200 michael@0: # Node ID cc6bebbd93bb9d8606fe06b997f890acc17996fb michael@0: # Parent caea8b548962f0df38e8e9032e9f57ef0fd099ec michael@0: Bug 507939 - Remove erroneous clip rect fixup which caused repainting errors with repeating radial gradients on Mac. r=jmuizelaar michael@0: michael@0: diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c michael@0: @@ -1033,38 +1033,29 @@ typedef enum { michael@0: DO_TILED_IMAGE michael@0: } cairo_quartz_action_t; michael@0: michael@0: static cairo_quartz_action_t michael@0: _cairo_quartz_setup_fallback_source (cairo_quartz_surface_t *surface, michael@0: const cairo_pattern_t *source) michael@0: { michael@0: CGRect clipBox = CGContextGetClipBoundingBox (surface->cgContext); michael@0: - CGAffineTransform ctm; michael@0: double x0, y0, w, h; michael@0: michael@0: cairo_surface_t *fallback; michael@0: cairo_t *fallback_cr; michael@0: CGImageRef img; michael@0: cairo_pattern_t *source_copy; michael@0: michael@0: cairo_status_t status; michael@0: michael@0: if (clipBox.size.width == 0.0f || michael@0: clipBox.size.height == 0.0f) michael@0: return DO_NOTHING; michael@0: michael@0: - // the clipBox is in userspace, so: michael@0: - ctm = CGContextGetCTM (surface->cgContext); michael@0: - ctm = CGAffineTransformInvert (ctm); michael@0: - clipBox = CGRectApplyAffineTransform (clipBox, ctm); michael@0: - michael@0: - // get the Y flip right -- the CTM will always have a Y flip in place michael@0: - clipBox.origin.y = surface->extents.height - (clipBox.origin.y + clipBox.size.height); michael@0: - michael@0: x0 = floor(clipBox.origin.x); michael@0: y0 = floor(clipBox.origin.y); michael@0: w = ceil(clipBox.origin.x + clipBox.size.width) - x0; michael@0: h = ceil(clipBox.origin.y + clipBox.size.height) - y0; michael@0: michael@0: /* Create a temporary the size of the clip surface, and position michael@0: * it so that the device origin coincides with the original surface */ michael@0: fallback = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, (int) w, (int) h); michael@0: @@ -1717,18 +1708,20 @@ _cairo_quartz_surface_paint (void *abstr michael@0: action = _cairo_quartz_setup_source (surface, source); michael@0: michael@0: if (action == DO_SOLID || action == DO_PATTERN) { michael@0: CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x, michael@0: surface->extents.y, michael@0: surface->extents.width, michael@0: surface->extents.height)); michael@0: } else if (action == DO_SHADING) { michael@0: + CGContextSaveGState (surface->cgContext); michael@0: CGContextConcatCTM (surface->cgContext, surface->sourceTransform); michael@0: CGContextDrawShading (surface->cgContext, surface->sourceShading); michael@0: + CGContextRestoreGState (surface->cgContext); michael@0: } else if (action == DO_IMAGE || action == DO_TILED_IMAGE) { michael@0: CGContextSaveGState (surface->cgContext); michael@0: michael@0: CGContextConcatCTM (surface->cgContext, surface->sourceTransform); michael@0: CGContextTranslateCTM (surface->cgContext, 0, surface->sourceImageRect.size.height); michael@0: CGContextScaleCTM (surface->cgContext, 1, -1); michael@0: michael@0: if (action == DO_IMAGE)