gfx/cairo/quartz-fallback.patch

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 # HG changeset patch
michael@0 2 # User Robert O'Callahan <robert@ocallahan.org>
michael@0 3 # Date 1250204857 -43200
michael@0 4 # Node ID cc6bebbd93bb9d8606fe06b997f890acc17996fb
michael@0 5 # Parent caea8b548962f0df38e8e9032e9f57ef0fd099ec
michael@0 6 Bug 507939 - Remove erroneous clip rect fixup which caused repainting errors with repeating radial gradients on Mac. r=jmuizelaar
michael@0 7
michael@0 8 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
michael@0 9 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
michael@0 10 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
michael@0 11 @@ -1033,38 +1033,29 @@ typedef enum {
michael@0 12 DO_TILED_IMAGE
michael@0 13 } cairo_quartz_action_t;
michael@0 14
michael@0 15 static cairo_quartz_action_t
michael@0 16 _cairo_quartz_setup_fallback_source (cairo_quartz_surface_t *surface,
michael@0 17 const cairo_pattern_t *source)
michael@0 18 {
michael@0 19 CGRect clipBox = CGContextGetClipBoundingBox (surface->cgContext);
michael@0 20 - CGAffineTransform ctm;
michael@0 21 double x0, y0, w, h;
michael@0 22
michael@0 23 cairo_surface_t *fallback;
michael@0 24 cairo_t *fallback_cr;
michael@0 25 CGImageRef img;
michael@0 26 cairo_pattern_t *source_copy;
michael@0 27
michael@0 28 cairo_status_t status;
michael@0 29
michael@0 30 if (clipBox.size.width == 0.0f ||
michael@0 31 clipBox.size.height == 0.0f)
michael@0 32 return DO_NOTHING;
michael@0 33
michael@0 34 - // the clipBox is in userspace, so:
michael@0 35 - ctm = CGContextGetCTM (surface->cgContext);
michael@0 36 - ctm = CGAffineTransformInvert (ctm);
michael@0 37 - clipBox = CGRectApplyAffineTransform (clipBox, ctm);
michael@0 38 -
michael@0 39 - // get the Y flip right -- the CTM will always have a Y flip in place
michael@0 40 - clipBox.origin.y = surface->extents.height - (clipBox.origin.y + clipBox.size.height);
michael@0 41 -
michael@0 42 x0 = floor(clipBox.origin.x);
michael@0 43 y0 = floor(clipBox.origin.y);
michael@0 44 w = ceil(clipBox.origin.x + clipBox.size.width) - x0;
michael@0 45 h = ceil(clipBox.origin.y + clipBox.size.height) - y0;
michael@0 46
michael@0 47 /* Create a temporary the size of the clip surface, and position
michael@0 48 * it so that the device origin coincides with the original surface */
michael@0 49 fallback = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, (int) w, (int) h);
michael@0 50 @@ -1717,18 +1708,20 @@ _cairo_quartz_surface_paint (void *abstr
michael@0 51 action = _cairo_quartz_setup_source (surface, source);
michael@0 52
michael@0 53 if (action == DO_SOLID || action == DO_PATTERN) {
michael@0 54 CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x,
michael@0 55 surface->extents.y,
michael@0 56 surface->extents.width,
michael@0 57 surface->extents.height));
michael@0 58 } else if (action == DO_SHADING) {
michael@0 59 + CGContextSaveGState (surface->cgContext);
michael@0 60 CGContextConcatCTM (surface->cgContext, surface->sourceTransform);
michael@0 61 CGContextDrawShading (surface->cgContext, surface->sourceShading);
michael@0 62 + CGContextRestoreGState (surface->cgContext);
michael@0 63 } else if (action == DO_IMAGE || action == DO_TILED_IMAGE) {
michael@0 64 CGContextSaveGState (surface->cgContext);
michael@0 65
michael@0 66 CGContextConcatCTM (surface->cgContext, surface->sourceTransform);
michael@0 67 CGContextTranslateCTM (surface->cgContext, 0, surface->sourceImageRect.size.height);
michael@0 68 CGContextScaleCTM (surface->cgContext, 1, -1);
michael@0 69
michael@0 70 if (action == DO_IMAGE)

mercurial