Bug 572912. Fix surface type passed to cairo_quartz_surface_create during fallback for CGLayers. r=jrmuizel

This commit is contained in:
Robert O'Callahan 2010-06-18 21:24:15 +12:00
parent d6302b247b
commit 8c0f73eb30
3 changed files with 46 additions and 1 deletions

View File

@ -72,6 +72,8 @@ quartz-remove-snapshot.patch: remove broken implementation of backend snapshot
quartz-cglayers.patch: add support for cairo surfaces backed by CGLayers
quartz-cglayers-fix-fallback.patch: Bug 572912; fix bug in fallback code in previous patch
premultiply-alpha-solid-gradients.patch: bug 539165; multiply the solid color by the alpha component before using it for a solid surface
xlib-initialize-members.path: bug 548793; initialize XRender version if the server doesn't have the extension

View File

@ -2031,7 +2031,7 @@ _cairo_quartz_surface_acquire_image (void *abstract_surface,
if (status == CAIRO_INT_STATUS_UNSUPPORTED && surface->cgLayer) {
/* copy the layer into a Quartz bitmap context so we can get the data */
cairo_surface_t *tmp =
cairo_quartz_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
cairo_quartz_surface_create (CAIRO_FORMAT_ARGB32,
surface->extents.width,
surface->extents.height);
cairo_quartz_surface_t *tmp_surface = (cairo_quartz_surface_t *) tmp;
@ -2054,6 +2054,7 @@ _cairo_quartz_surface_acquire_image (void *abstract_surface,
*image_out = (cairo_image_surface_t*)
cairo_surface_reference(tmp_surface->imageSurfaceEquiv);
*image_extra = tmp;
status = CAIRO_STATUS_SUCCESS;
} else {
cairo_surface_destroy (tmp);
}

View File

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