mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-01 12:03:08 +00:00
Bug 612662 patch 3: Drop cairo_quartz_surface_t's "imageSurfaceEquiv" member if we fail to create it. r=roc a=blocking-final+
This commit is contained in:
parent
309b385495
commit
dfa701e0fd
@ -152,6 +152,8 @@ quartz-layers-content.patch: Store cairo content type in CGLayer surfaces
|
||||
|
||||
quartz-optimize-OVER.patch: Optimize OVER to SOURCE for opaque patterns
|
||||
|
||||
quartz-check-imageSurfaceEquiv.patch: Drop cairo_quartz_surface_t's "imageSurfaceEquiv" member variable if we have problems creating it
|
||||
|
||||
==== pixman patches ====
|
||||
|
||||
pixman-android-cpu-detect.patch: Add CPU detection support for Android, where we can't reliably access /proc/self/auxv.
|
||||
|
@ -3157,7 +3157,18 @@ cairo_quartz_surface_create (cairo_format_t format,
|
||||
}
|
||||
|
||||
surf->imageData = imageData;
|
||||
surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride);
|
||||
|
||||
cairo_surface_t* tmpImageSurfaceEquiv =
|
||||
cairo_image_surface_create_for_data (imageData, format,
|
||||
width, height, stride);
|
||||
|
||||
if (cairo_surface_status (tmpImageSurfaceEquiv)) {
|
||||
// Tried & failed to create an imageSurfaceEquiv!
|
||||
cairo_surface_destroy (tmpImageSurfaceEquiv);
|
||||
surf->imageSurfaceEquiv = NULL;
|
||||
} else {
|
||||
surf->imageSurfaceEquiv = tmpImageSurfaceEquiv;
|
||||
}
|
||||
|
||||
return (cairo_surface_t *) surf;
|
||||
}
|
||||
|
36
gfx/cairo/quartz-check-imageSurfaceEquiv.patch
Normal file
36
gfx/cairo/quartz-check-imageSurfaceEquiv.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From: Daniel Holbert <dholbert@cs.stanford.edu>
|
||||
Bug 612662 patch 3: Drop cairo_quartz_surface_t's "imageSurfaceEquiv" member if we fail to create it. r=roc a=blocking-final+
|
||||
|
||||
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
|
||||
@@ -3152,17 +3152,28 @@ cairo_quartz_surface_create (cairo_forma
|
||||
if (surf->base.status) {
|
||||
CGContextRelease (cgc);
|
||||
free (imageData);
|
||||
// create_internal will have set an error
|
||||
return (cairo_surface_t*) surf;
|
||||
}
|
||||
|
||||
surf->imageData = imageData;
|
||||
- surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride);
|
||||
+
|
||||
+ cairo_surface_t* tmpImageSurfaceEquiv =
|
||||
+ cairo_image_surface_create_for_data (imageData, format,
|
||||
+ width, height, stride);
|
||||
+
|
||||
+ if (cairo_surface_status (tmpImageSurfaceEquiv)) {
|
||||
+ // Tried & failed to create an imageSurfaceEquiv!
|
||||
+ cairo_surface_destroy (tmpImageSurfaceEquiv);
|
||||
+ surf->imageSurfaceEquiv = NULL;
|
||||
+ } else {
|
||||
+ surf->imageSurfaceEquiv = tmpImageSurfaceEquiv;
|
||||
+ }
|
||||
|
||||
return (cairo_surface_t *) surf;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_quartz_surface_get_cg_context
|
||||
* @surface: the Cairo Quartz surface
|
||||
*
|
Loading…
x
Reference in New Issue
Block a user