gfx/cairo/avoid-extend-none.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 changeset:   93076:25d0c8a38d7d
     2 tag:         none
     3 tag:         qbase
     4 tag:         qtip
     5 tag:         tip
     6 user:        Jeff Muizelaar <jmuizelaar@mozilla.com>
     7 date:        Thu May 03 15:21:52 2012 -0400
     8 summary:     Bug 751668. Avoid incorrectly using EXTEND_NONE. r=joe
    10 diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c
    11 --- a/gfx/cairo/cairo/src/cairo-image-surface.c
    12 +++ b/gfx/cairo/cairo/src/cairo-image-surface.c
    13 @@ -1390,25 +1390,16 @@ static pixman_image_t *
    14  	cairo_image_surface_t *source = (cairo_image_surface_t *) pattern->surface;
    15  	cairo_surface_type_t type;
    17  	if (source->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT)
    18  	    source = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) pattern->surface)->target;
    20  	type = source->base.backend->type;
    21  	if (type == CAIRO_SURFACE_TYPE_IMAGE) {
    22 -	    if (extend != CAIRO_EXTEND_NONE &&
    23 -		sample.x >= 0 &&
    24 -		sample.y >= 0 &&
    25 -		sample.x + sample.width  <= source->width &&
    26 -		sample.y + sample.height <= source->height)
    27 -	    {
    28 -		extend = CAIRO_EXTEND_NONE;
    29 -	    }
    30 -
    31  	    if (sample.width == 1 && sample.height == 1) {
    32  		if (sample.x < 0 ||
    33  		    sample.y < 0 ||
    34  		    sample.x >= source->width ||
    35  		    sample.y >= source->height)
    36  		{
    37  		    if (extend == CAIRO_EXTEND_NONE)
    38  			return _pixman_transparent_image ();

mercurial