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