Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 From: Daniel Holbert <dholbert@cs.stanford.edu>
2 Bug 612662 patch 3: Drop cairo_quartz_surface_t's "imageSurfaceEquiv" member if we fail to create it. r=roc a=blocking-final+
4 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
5 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
6 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
7 @@ -3152,17 +3152,28 @@ cairo_quartz_surface_create (cairo_forma
8 if (surf->base.status) {
9 CGContextRelease (cgc);
10 free (imageData);
11 // create_internal will have set an error
12 return (cairo_surface_t*) surf;
13 }
15 surf->imageData = imageData;
16 - surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride);
17 +
18 + cairo_surface_t* tmpImageSurfaceEquiv =
19 + cairo_image_surface_create_for_data (imageData, format,
20 + width, height, stride);
21 +
22 + if (cairo_surface_status (tmpImageSurfaceEquiv)) {
23 + // Tried & failed to create an imageSurfaceEquiv!
24 + cairo_surface_destroy (tmpImageSurfaceEquiv);
25 + surf->imageSurfaceEquiv = NULL;
26 + } else {
27 + surf->imageSurfaceEquiv = tmpImageSurfaceEquiv;
28 + }
30 return (cairo_surface_t *) surf;
31 }
33 /**
34 * cairo_quartz_surface_get_cg_context
35 * @surface: the Cairo Quartz surface
36 *