1 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
2 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
3 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
4 @@ -2856,117 +2856,6 @@ cairo_quartz_surface_create (cairo_forma
8 - * cairo_quartz_surface_create_for_data
9 - * @data: a pointer to a buffer supplied by the application in which
10 - * to write contents. This pointer must be suitably aligned for any
11 - * kind of variable, (for example, a pointer returned by malloc).
12 - * @format: format of pixels in the surface to create
13 - * @width: width of the surface, in pixels
14 - * @height: height of the surface, in pixels
16 - * Creates a Quartz surface backed by a CGBitmap. The surface is
17 - * created using the Device RGB (or Device Gray, for A8) color space.
18 - * All Cairo operations, including those that require software
19 - * rendering, will succeed on this surface.
21 - * Return value: the newly created surface.
23 - * Since: 1.12 [Mozilla addition]
26 -cairo_quartz_surface_create_for_data (unsigned char *data,
27 - cairo_format_t format,
29 - unsigned int height,
30 - unsigned int stride)
32 - cairo_quartz_surface_t *surf;
34 - CGColorSpaceRef cgColorspace;
35 - CGBitmapInfo bitinfo;
36 - void *imageData = data;
37 - int bitsPerComponent;
40 - // verify width and height of surface
41 - if (!_cairo_quartz_verify_surface_size(width, height))
42 - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
44 - if (width == 0 || height == 0) {
45 - return (cairo_surface_t*) _cairo_quartz_surface_create_internal (NULL, _cairo_content_from_format (format),
49 - if (format == CAIRO_FORMAT_ARGB32 ||
50 - format == CAIRO_FORMAT_RGB24)
52 - cgColorspace = CGColorSpaceCreateDeviceRGB();
53 - bitinfo = kCGBitmapByteOrder32Host;
54 - if (format == CAIRO_FORMAT_ARGB32)
55 - bitinfo |= kCGImageAlphaPremultipliedFirst;
57 - bitinfo |= kCGImageAlphaNoneSkipFirst;
58 - bitsPerComponent = 8;
59 - } else if (format == CAIRO_FORMAT_A8) {
60 - cgColorspace = NULL;
61 - bitinfo = kCGImageAlphaOnly;
62 - bitsPerComponent = 8;
63 - } else if (format == CAIRO_FORMAT_A1) {
64 - /* I don't think we can usefully support this, as defined by
65 - * cairo_format_t -- these are 1-bit pixels stored in 32-bit
68 - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
70 - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
73 - cgc = CGBitmapContextCreate (imageData,
80 - CGColorSpaceRelease (cgColorspace);
84 - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
87 - /* flip the Y axis */
88 - CGContextTranslateCTM (cgc, 0.0, height);
89 - CGContextScaleCTM (cgc, 1.0, -1.0);
91 - surf = _cairo_quartz_surface_create_internal (cgc, _cairo_content_from_format (format),
93 - if (surf->base.status) {
94 - CGContextRelease (cgc);
96 - // create_internal will have set an error
97 - return (cairo_surface_t*) surf;
100 - surf->imageData = imageData;
102 - cairo_surface_t* tmpImageSurfaceEquiv =
103 - cairo_image_surface_create_for_data (imageData, format,
104 - width, height, stride);
106 - if (cairo_surface_status (tmpImageSurfaceEquiv)) {
107 - // Tried & failed to create an imageSurfaceEquiv!
108 - cairo_surface_destroy (tmpImageSurfaceEquiv);
109 - surf->imageSurfaceEquiv = NULL;
111 - surf->imageSurfaceEquiv = tmpImageSurfaceEquiv;
112 - surf->ownsData = FALSE;
115 - return (cairo_surface_t *) surf;
119 * cairo_quartz_surface_get_cg_context:
120 * @surface: the Cairo Quartz surface
122 diff --git a/gfx/cairo/cairo/src/cairo-quartz.h b/gfx/cairo/cairo/src/cairo-quartz.h
123 --- a/gfx/cairo/cairo/src/cairo-quartz.h
124 +++ b/gfx/cairo/cairo/src/cairo-quartz.h
125 @@ -54,13 +54,6 @@ cairo_quartz_surface_create_for_cg_conte
127 unsigned int height);
130 -cairo_quartz_surface_create_for_data (unsigned char *data,
131 - cairo_format_t format,
132 - unsigned int width,
133 - unsigned int height,
134 - unsigned int stride);
136 cairo_public cairo_surface_t *
137 cairo_quartz_surface_create_cg_layer (cairo_surface_t *surface,
138 cairo_content_t content,