|
1 # HG changeset patch |
|
2 # User Matt Woodrow <mwoodrow@mozilla.com> |
|
3 # Date 1314162877 -43200 |
|
4 # Node ID 87458c4670dcd16be5a5715d741ee2ca4cf18d0f |
|
5 # Parent 95eb700a64591cda694c284a9f8ad08c11e3dd97 |
|
6 Bug 675837 - Only flush Quartz surfaces on the success paths during cairo_quartz_get_image. r=roc |
|
7 |
|
8 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
|
9 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c |
|
10 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
|
11 @@ -1909,30 +1909,30 @@ _cairo_quartz_get_image (cairo_quartz_su |
|
12 unsigned char *imageData; |
|
13 cairo_image_surface_t *isurf; |
|
14 |
|
15 if (IS_EMPTY(surface)) { |
|
16 *image_out = (cairo_image_surface_t*) cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); |
|
17 return CAIRO_STATUS_SUCCESS; |
|
18 } |
|
19 |
|
20 - CGContextFlush(surface->cgContext); |
|
21 - |
|
22 if (surface->imageSurfaceEquiv) { |
|
23 + CGContextFlush(surface->cgContext); |
|
24 *image_out = (cairo_image_surface_t*) cairo_surface_reference(surface->imageSurfaceEquiv); |
|
25 return CAIRO_STATUS_SUCCESS; |
|
26 } |
|
27 |
|
28 if (_cairo_quartz_is_cgcontext_bitmap_context(surface->cgContext)) { |
|
29 unsigned int stride; |
|
30 unsigned int bitinfo; |
|
31 unsigned int bpc, bpp; |
|
32 CGColorSpaceRef colorspace; |
|
33 unsigned int color_comps; |
|
34 |
|
35 + CGContextFlush(surface->cgContext); |
|
36 imageData = (unsigned char *) CGBitmapContextGetData(surface->cgContext); |
|
37 |
|
38 #ifdef USE_10_3_WORKAROUNDS |
|
39 bitinfo = CGBitmapContextGetAlphaInfo (surface->cgContext); |
|
40 #else |
|
41 bitinfo = CGBitmapContextGetBitmapInfo (surface->cgContext); |
|
42 #endif |
|
43 stride = CGBitmapContextGetBytesPerRow (surface->cgContext); |