This enables tracking of ARGB values for image masks, since some machines do
not use ARGB values.
See Mozilla bug #716462 - Performance regression with xBGR visual and no
RENDER extension.
We would like to try to get this upstream in the future.
diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c
--- a/gfx/cairo/cairo/src/cairo-xlib-surface.c
+++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c
@@ -2325,6 +2325,7 @@
cairo_region_t *clip_region)
{
cairo_image_surface_t *image;
+ cairo_format_masks_t image_masks;
cairo_rectangle_int_t extents;
cairo_status_t status;
int tx, ty;
@@ -2341,6 +2342,16 @@
(image->base.content & CAIRO_CONTENT_ALPHA) == 0)))
return CAIRO_INT_STATUS_UNSUPPORTED;
+ if (image->base.backend->type == CAIRO_SURFACE_TYPE_IMAGE) {
+ if (_pixman_format_to_masks (image->pixman_format, &image_masks)) {
+ if (! ((image_masks.alpha_mask == surface->a_mask || surface->a_mask == 0) &&
+ (image_masks.red_mask == surface->r_mask || surface->r_mask == 0) &&
+ (image_masks.green_mask == surface->g_mask || surface->g_mask == 0) &&
+ (image_masks.blue_mask == surface->b_mask || surface->b_mask == 0)))
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+ }
+ }
+
if (image->base.backend->type != CAIRO_SURFACE_TYPE_IMAGE) {
if (image->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
image = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) image)->target;