components/desktop/firefox/patches/firefox-01-cairo-perf.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Mon, 14 Nov 2016 04:25:50 -0800
branchs11u3-sru
changeset 7364 1ac24a377555
parent 7035 4c2f26e9d5ab
permissions -rw-r--r--
25034529 Upgrade Firefox to version 45.5.0 ESR 25099456 problem in FIREFOX/BROWSER

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;