michael@0: Bug 572912. Fix surface type passed to cairo_quartz_surface_create during fallback for CGLayers. r=jrmuizel 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: @@ -2026,17 +2026,17 @@ _cairo_quartz_surface_acquire_image (voi michael@0: michael@0: /* ND((stderr, "%p _cairo_quartz_surface_acquire_image\n", surface)); */ michael@0: michael@0: status = _cairo_quartz_get_image (surface, image_out); michael@0: michael@0: if (status == CAIRO_INT_STATUS_UNSUPPORTED && surface->cgLayer) { michael@0: /* copy the layer into a Quartz bitmap context so we can get the data */ michael@0: cairo_surface_t *tmp = michael@0: - cairo_quartz_surface_create (CAIRO_CONTENT_COLOR_ALPHA, michael@0: + cairo_quartz_surface_create (CAIRO_FORMAT_ARGB32, michael@0: surface->extents.width, michael@0: surface->extents.height); michael@0: cairo_quartz_surface_t *tmp_surface = (cairo_quartz_surface_t *) tmp; michael@0: michael@0: /* if surface creation failed, we won't have a Quartz surface here */ michael@0: if (cairo_surface_get_type (tmp) == CAIRO_SURFACE_TYPE_QUARTZ && michael@0: tmp_surface->imageSurfaceEquiv) { michael@0: CGContextSaveGState (tmp_surface->cgContext); michael@0: @@ -2049,16 +2049,17 @@ _cairo_quartz_surface_acquire_image (voi michael@0: CGContextDrawLayerAtPoint (tmp_surface->cgContext, michael@0: CGPointMake (0.0, 0.0), michael@0: surface->cgLayer); michael@0: CGContextRestoreGState (tmp_surface->cgContext); michael@0: michael@0: *image_out = (cairo_image_surface_t*) michael@0: cairo_surface_reference(tmp_surface->imageSurfaceEquiv); michael@0: *image_extra = tmp; michael@0: + status = CAIRO_STATUS_SUCCESS; michael@0: } else { michael@0: cairo_surface_destroy (tmp); michael@0: } michael@0: } michael@0: michael@0: if (status) michael@0: return _cairo_error (CAIRO_STATUS_NO_MEMORY); michael@0: