components/desktop/firefox/patches/firefox-01-cairo-perf.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Wed, 02 Nov 2016 08:17:06 -0700
changeset 7309 2655ef11c386
parent 5527 611b2d6efdfe
permissions -rw-r--r--
25034529 Upgrade Firefox to version 45.5.0 ESR 25099456 problem in FIREFOX/BROWSER
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5527
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     1
This enables tracking of ARGB values for image masks, since some machines do
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     2
not use ARGB values.
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     3
See Mozilla bug #716462 - Performance regression with xBGR visual and no
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     4
RENDER extension.
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     5
We would like to try to get this upstream in the future.
5255
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     6
5527
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     7
diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     8
--- a/gfx/cairo/cairo/src/cairo-xlib-surface.c
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
     9
+++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c
5255
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    10
@@ -2325,6 +2325,7 @@
7309
2655ef11c386 25034529 Upgrade Firefox to version 45.5.0 ESR
Petr Sumbera <petr.sumbera@oracle.com>
parents: 5527
diff changeset
    11
 			   cairo_region_t *clip_region)
5255
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    12
 {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    13
     cairo_image_surface_t *image;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    14
+    cairo_format_masks_t image_masks;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    15
     cairo_rectangle_int_t extents;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    16
     cairo_status_t status;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    17
     int tx, ty;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    18
@@ -2341,6 +2342,16 @@
7309
2655ef11c386 25034529 Upgrade Firefox to version 45.5.0 ESR
Petr Sumbera <petr.sumbera@oracle.com>
parents: 5527
diff changeset
    19
 	    (image->base.content & CAIRO_CONTENT_ALPHA) == 0)))
2655ef11c386 25034529 Upgrade Firefox to version 45.5.0 ESR
Petr Sumbera <petr.sumbera@oracle.com>
parents: 5527
diff changeset
    20
 	return CAIRO_INT_STATUS_UNSUPPORTED;
5255
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    21
 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    22
+    if (image->base.backend->type == CAIRO_SURFACE_TYPE_IMAGE) {
5527
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    23
+       if (_pixman_format_to_masks (image->pixman_format, &image_masks)) {
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    24
+           if (! ((image_masks.alpha_mask == surface->a_mask || surface->a_mask == 0) &&
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    25
+                  (image_masks.red_mask   == surface->r_mask || surface->r_mask == 0) &&
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    26
+                  (image_masks.green_mask == surface->g_mask || surface->g_mask == 0) &&
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    27
+                  (image_masks.blue_mask  == surface->b_mask || surface->b_mask == 0)))
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    28
+               return CAIRO_INT_STATUS_UNSUPPORTED;
611b2d6efdfe 21602607 Need to move Firefox to 38.5.0 ESR branch to continue getting fixes
Stacy Yeh <stacy.yeh@oracle.com>
parents: 5255
diff changeset
    29
+       }
5255
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    30
+    }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    31
+
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    32
     if (image->base.backend->type != CAIRO_SURFACE_TYPE_IMAGE) {
7309
2655ef11c386 25034529 Upgrade Firefox to version 45.5.0 ESR
Petr Sumbera <petr.sumbera@oracle.com>
parents: 5527
diff changeset
    33
 	if (image->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT) {
2655ef11c386 25034529 Upgrade Firefox to version 45.5.0 ESR
Petr Sumbera <petr.sumbera@oracle.com>
parents: 5527
diff changeset
    34
 	    image = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) image)->target;