gfx/cairo/quartz-cg-layers-fix-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 Bug 572912. Fix surface type passed to cairo_quartz_surface_create during fallback for CGLayers. r=jrmuizel
michael@0 2
michael@0 3 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
michael@0 4 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
michael@0 5 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
michael@0 6 @@ -2026,17 +2026,17 @@ _cairo_quartz_surface_acquire_image (voi
michael@0 7
michael@0 8 /* ND((stderr, "%p _cairo_quartz_surface_acquire_image\n", surface)); */
michael@0 9
michael@0 10 status = _cairo_quartz_get_image (surface, image_out);
michael@0 11
michael@0 12 if (status == CAIRO_INT_STATUS_UNSUPPORTED && surface->cgLayer) {
michael@0 13 /* copy the layer into a Quartz bitmap context so we can get the data */
michael@0 14 cairo_surface_t *tmp =
michael@0 15 - cairo_quartz_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
michael@0 16 + cairo_quartz_surface_create (CAIRO_FORMAT_ARGB32,
michael@0 17 surface->extents.width,
michael@0 18 surface->extents.height);
michael@0 19 cairo_quartz_surface_t *tmp_surface = (cairo_quartz_surface_t *) tmp;
michael@0 20
michael@0 21 /* if surface creation failed, we won't have a Quartz surface here */
michael@0 22 if (cairo_surface_get_type (tmp) == CAIRO_SURFACE_TYPE_QUARTZ &&
michael@0 23 tmp_surface->imageSurfaceEquiv) {
michael@0 24 CGContextSaveGState (tmp_surface->cgContext);
michael@0 25 @@ -2049,16 +2049,17 @@ _cairo_quartz_surface_acquire_image (voi
michael@0 26 CGContextDrawLayerAtPoint (tmp_surface->cgContext,
michael@0 27 CGPointMake (0.0, 0.0),
michael@0 28 surface->cgLayer);
michael@0 29 CGContextRestoreGState (tmp_surface->cgContext);
michael@0 30
michael@0 31 *image_out = (cairo_image_surface_t*)
michael@0 32 cairo_surface_reference(tmp_surface->imageSurfaceEquiv);
michael@0 33 *image_extra = tmp;
michael@0 34 + status = CAIRO_STATUS_SUCCESS;
michael@0 35 } else {
michael@0 36 cairo_surface_destroy (tmp);
michael@0 37 }
michael@0 38 }
michael@0 39
michael@0 40 if (status)
michael@0 41 return _cairo_error (CAIRO_STATUS_NO_MEMORY);
michael@0 42

mercurial