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: @@ -2040,17 +2040,18 @@ _cairo_quartz_surface_create_similar (vo michael@0: cairo_content_t content, michael@0: int width, michael@0: int height) michael@0: { michael@0: cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; michael@0: cairo_format_t format; michael@0: michael@0: if (surface->cgLayer) michael@0: - return cairo_quartz_surface_create_cg_layer (abstract_surface, width, height); michael@0: + return cairo_quartz_surface_create_cg_layer (abstract_surface, content, michael@0: + width, height); michael@0: michael@0: if (content == CAIRO_CONTENT_COLOR_ALPHA) michael@0: format = CAIRO_FORMAT_ARGB32; michael@0: else if (content == CAIRO_CONTENT_COLOR) michael@0: format = CAIRO_FORMAT_RGB24; michael@0: else if (content == CAIRO_CONTENT_ALPHA) michael@0: format = CAIRO_FORMAT_A8; michael@0: else michael@0: @@ -2960,54 +2961,55 @@ cairo_quartz_surface_create_for_cg_conte michael@0: michael@0: return (cairo_surface_t *) surf; michael@0: } michael@0: michael@0: /** michael@0: * cairo_quartz_cglayer_surface_create_similar michael@0: * @surface: The returned surface can be efficiently drawn into this michael@0: * destination surface (if tiling is not used)." michael@0: + * @content: the content type of the surface michael@0: * @width: width of the surface, in pixels michael@0: * @height: height of the surface, in pixels michael@0: * michael@0: * Creates a Quartz surface backed by a CGLayer, if the given surface michael@0: * is a Quartz surface; the CGLayer is created to match the surface's michael@0: - * Quartz context. Otherwise just calls cairo_surface_create_similar michael@0: - * with CAIRO_CONTENT_COLOR_ALPHA. michael@0: + * Quartz context. Otherwise just calls cairo_surface_create_similar. michael@0: * The returned surface can be efficiently blitted to the given surface, michael@0: * but tiling and 'extend' modes other than NONE are not so efficient. michael@0: * michael@0: * Return value: the newly created surface. michael@0: * michael@0: * Since: 1.10 michael@0: **/ michael@0: cairo_surface_t * michael@0: cairo_quartz_surface_create_cg_layer (cairo_surface_t *surface, michael@0: + cairo_content_t content, michael@0: unsigned int width, michael@0: unsigned int height) michael@0: { michael@0: cairo_quartz_surface_t *surf; michael@0: CGLayerRef layer; michael@0: CGContextRef ctx; michael@0: CGContextRef cgContext; michael@0: michael@0: cgContext = cairo_quartz_surface_get_cg_context (surface); michael@0: if (!cgContext) michael@0: - return cairo_surface_create_similar (surface, CAIRO_CONTENT_COLOR_ALPHA, michael@0: + return cairo_surface_create_similar (surface, content, michael@0: width, height); michael@0: michael@0: if (!_cairo_quartz_verify_surface_size(width, height)) michael@0: return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE)); michael@0: michael@0: /* If we pass zero width or height into CGLayerCreateWithContext below, michael@0: * it will fail. michael@0: */ michael@0: if (width == 0 || height == 0) { michael@0: return (cairo_surface_t*) michael@0: - _cairo_quartz_surface_create_internal (NULL, CAIRO_CONTENT_COLOR_ALPHA, michael@0: + _cairo_quartz_surface_create_internal (NULL, content, michael@0: width, height); michael@0: } michael@0: michael@0: layer = CGLayerCreateWithContext (cgContext, michael@0: CGSizeMake (width, height), michael@0: NULL); michael@0: if (!layer) michael@0: return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); michael@0: @@ -3016,18 +3018,18 @@ cairo_quartz_surface_create_cg_layer (ca michael@0: /* Flip it when we draw into it, so that when we finally composite it michael@0: * to a flipped target, the directions match and Quartz will optimize michael@0: * the composition properly michael@0: */ michael@0: CGContextTranslateCTM (ctx, 0, height); michael@0: CGContextScaleCTM (ctx, 1, -1); michael@0: michael@0: CGContextRetain (ctx); michael@0: - surf = _cairo_quartz_surface_create_internal (ctx, CAIRO_CONTENT_COLOR_ALPHA, michael@0: - width, height); michael@0: + surf = _cairo_quartz_surface_create_internal (ctx, content, michael@0: + width, height); michael@0: if (surf->base.status) { michael@0: CGLayerRelease (layer); michael@0: // create_internal will have set an error michael@0: return (cairo_surface_t*) surf; michael@0: } michael@0: surf->cgLayer = layer; michael@0: michael@0: return (cairo_surface_t *) surf; michael@0: diff --git a/gfx/cairo/cairo/src/cairo-quartz.h b/gfx/cairo/cairo/src/cairo-quartz.h michael@0: --- a/gfx/cairo/cairo/src/cairo-quartz.h michael@0: +++ b/gfx/cairo/cairo/src/cairo-quartz.h michael@0: @@ -46,16 +46,17 @@ CAIRO_BEGIN_DECLS michael@0: michael@0: cairo_public cairo_surface_t * michael@0: cairo_quartz_surface_create (cairo_format_t format, michael@0: unsigned int width, michael@0: unsigned int height); michael@0: michael@0: cairo_public cairo_surface_t * michael@0: cairo_quartz_surface_create_cg_layer (cairo_surface_t *surface, michael@0: + cairo_content_t content, michael@0: unsigned int width, michael@0: unsigned int height); michael@0: michael@0: cairo_public cairo_surface_t * michael@0: cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext, michael@0: unsigned int width, michael@0: unsigned int height); michael@0: