gfx/cairo/premultiply-alpha-solid-gradients.patch

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 Fix single and multi-stop solid gradients by multiplying by the alpha component. r=roc
     3 This cairo commit that caused the problem: 2d790daa957471670f4ae0d3b22da89e4ee7111f.
     4 It was merged into mozilla-central with 1effb72d30cf
     6 diff --git a/gfx/cairo/cairo/src/cairo-pattern.c b/gfx/cairo/cairo/src/cairo-pattern.c
     7 --- a/gfx/cairo/cairo/src/cairo-pattern.c
     8 +++ b/gfx/cairo/cairo/src/cairo-pattern.c
     9 @@ -2262,8 +2262,17 @@ _cairo_pattern_acquire_surface (const ca
    11  	    if (src->n_stops)
    12  	    {
    13 +		cairo_color_t color;
    14 +
    15 +		/* multiply by alpha */
    16 +		_cairo_color_init_rgba (&color,
    17 +			src->stops->color.red,
    18 +			src->stops->color.green,
    19 +			src->stops->color.blue,
    20 +			src->stops->color.alpha);
    21 +
    22  		_cairo_pattern_init_solid (&solid,
    23 -					   &src->stops->color,
    24 +					   &color,
    25  					   CAIRO_CONTENT_COLOR_ALPHA);
    26  	    }
    27  	    else
    28 @@ -2295,9 +2304,17 @@ _cairo_pattern_acquire_surface (const ca
    29  	    }
    30  	    if (i == src->n_stops) {
    31  		cairo_solid_pattern_t solid;
    32 +		cairo_color_t color;
    33 +
    34 +		/* multiply by alpha */
    35 +		_cairo_color_init_rgba (&color,
    36 +			src->stops->color.red,
    37 +			src->stops->color.green,
    38 +			src->stops->color.blue,
    39 +			src->stops->color.alpha);
    41  		_cairo_pattern_init_solid (&solid,
    42 -					   &src->stops->color,
    43 +					   &color,
    44  					   CAIRO_CONTENT_COLOR_ALPHA);
    46  		status =

mercurial