gfx/cairo/handle-a1.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 commit 82aab44a9005047743538d52e9fbc27fd6ce408a
     2 Author: Chris Wilson <chris@chris-wilson.co.uk>
     3 Date:   Fri Mar 19 17:23:20 2010 -0400
     5     commit f07195860620959c27d43080a7b987e28222735a
     7         xlib: Handle a1 image uploads through converter
     9         Fixes test/large-source [xlib]
    11 diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
    12 index 1a053d0..8f773b0 100644
    13 --- a/src/cairo-xlib-surface.c
    14 +++ b/src/cairo-xlib-surface.c
    15 @@ -1155,7 +1155,9 @@ _draw_image_surface (cairo_xlib_surface_t   *surface,
    16  		int dither_adjustment = dither_row[x_off];
    17  		int a, r, g, b;
    19 -		if (image_masks.bpp <= 8)
    20 +		if (image_masks.bpp == 1)
    21 +		    in_pixel = !! (((uint8_t*)row)[x/8] & (1 << (x & 7)));
    22 +		else if (image_masks.bpp <= 8)
    23  		    in_pixel = ((uint8_t*)row)[x];
    24  		else if (image_masks.bpp <= 16)
    25  		    in_pixel = ((uint16_t*)row)[x];

mercurial