gfx/cairo/quartz-fallback.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/cairo/quartz-fallback.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     1.4 +# HG changeset patch
     1.5 +# User Robert O'Callahan <robert@ocallahan.org>
     1.6 +# Date 1250204857 -43200
     1.7 +# Node ID cc6bebbd93bb9d8606fe06b997f890acc17996fb
     1.8 +# Parent  caea8b548962f0df38e8e9032e9f57ef0fd099ec
     1.9 +Bug 507939 - Remove erroneous clip rect fixup which caused repainting errors with repeating radial gradients on Mac. r=jmuizelaar
    1.10 +
    1.11 +diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
    1.12 +--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
    1.13 ++++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
    1.14 +@@ -1033,38 +1033,29 @@ typedef enum {
    1.15 +     DO_TILED_IMAGE
    1.16 + } cairo_quartz_action_t;
    1.17 + 
    1.18 + static cairo_quartz_action_t
    1.19 + _cairo_quartz_setup_fallback_source (cairo_quartz_surface_t *surface,
    1.20 + 				     const cairo_pattern_t *source)
    1.21 + {
    1.22 +     CGRect clipBox = CGContextGetClipBoundingBox (surface->cgContext);
    1.23 +-    CGAffineTransform ctm;
    1.24 +     double x0, y0, w, h;
    1.25 + 
    1.26 +     cairo_surface_t *fallback;
    1.27 +     cairo_t *fallback_cr;
    1.28 +     CGImageRef img;
    1.29 +     cairo_pattern_t *source_copy;
    1.30 + 
    1.31 +     cairo_status_t status;
    1.32 + 
    1.33 +     if (clipBox.size.width == 0.0f ||
    1.34 + 	clipBox.size.height == 0.0f)
    1.35 + 	return DO_NOTHING;
    1.36 + 
    1.37 +-    // the clipBox is in userspace, so:
    1.38 +-    ctm = CGContextGetCTM (surface->cgContext);
    1.39 +-    ctm = CGAffineTransformInvert (ctm);
    1.40 +-    clipBox = CGRectApplyAffineTransform (clipBox, ctm);
    1.41 +-
    1.42 +-    // get the Y flip right -- the CTM will always have a Y flip in place
    1.43 +-    clipBox.origin.y = surface->extents.height - (clipBox.origin.y + clipBox.size.height);
    1.44 +-
    1.45 +     x0 = floor(clipBox.origin.x);
    1.46 +     y0 = floor(clipBox.origin.y);
    1.47 +     w = ceil(clipBox.origin.x + clipBox.size.width) - x0;
    1.48 +     h = ceil(clipBox.origin.y + clipBox.size.height) - y0;
    1.49 + 
    1.50 +     /* Create a temporary the size of the clip surface, and position
    1.51 +      * it so that the device origin coincides with the original surface */
    1.52 +     fallback = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, (int) w, (int) h);
    1.53 +@@ -1717,18 +1708,20 @@ _cairo_quartz_surface_paint (void *abstr
    1.54 +     action = _cairo_quartz_setup_source (surface, source);
    1.55 + 
    1.56 +     if (action == DO_SOLID || action == DO_PATTERN) {
    1.57 + 	CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x,
    1.58 + 							  surface->extents.y,
    1.59 + 							  surface->extents.width,
    1.60 + 							  surface->extents.height));
    1.61 +     } else if (action == DO_SHADING) {
    1.62 ++	CGContextSaveGState (surface->cgContext);
    1.63 + 	CGContextConcatCTM (surface->cgContext, surface->sourceTransform);
    1.64 + 	CGContextDrawShading (surface->cgContext, surface->sourceShading);
    1.65 ++	CGContextRestoreGState (surface->cgContext);
    1.66 +     } else if (action == DO_IMAGE || action == DO_TILED_IMAGE) {
    1.67 + 	CGContextSaveGState (surface->cgContext);
    1.68 + 
    1.69 + 	CGContextConcatCTM (surface->cgContext, surface->sourceTransform);
    1.70 + 	CGContextTranslateCTM (surface->cgContext, 0, surface->sourceImageRect.size.height);
    1.71 + 	CGContextScaleCTM (surface->cgContext, 1, -1);
    1.72 + 
    1.73 + 	if (action == DO_IMAGE)

mercurial