Tue, 06 Jan 2015 21:39:09 +0100
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.
michael@0 | 1 | # HG changeset patch |
michael@0 | 2 | # User Jeff Muizelaar <jmuizelaar@mozilla.com> |
michael@0 | 3 | # Date 1299543337 18000 |
michael@0 | 4 | # Node ID 57f411f16517fa3abc31b6b081dd31420c4d9b45 |
michael@0 | 5 | # Parent e56ecd8b3a68c158025207c5fd081d043e28f5ce |
michael@0 | 6 | Bug 637828. Reset the transform on the dest image. r=joe |
michael@0 | 7 | |
michael@0 | 8 | We can get into a situation where the destination image has a transform |
michael@0 | 9 | because we use it as source. The transform set when the image is a source |
michael@0 | 10 | sticks around and when we use it as a destination pixman gets confused. |
michael@0 | 11 | |
michael@0 | 12 | It seems like the code at fault here is really pixman. I think that pixman |
michael@0 | 13 | should probably not be using a transformed fetch on the destination image under |
michael@0 | 14 | any circumstances. |
michael@0 | 15 | |
michael@0 | 16 | For example, in this case we're fetching destination pixels from a different |
michael@0 | 17 | part of the image than we're storing them to. I can't see any reason for |
michael@0 | 18 | wanting this behaviour. |
michael@0 | 19 | |
michael@0 | 20 | However, reseting the transform seemed like the easiest solution. |
michael@0 | 21 | |
michael@0 | 22 | diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c |
michael@0 | 23 | --- a/gfx/cairo/cairo/src/cairo-image-surface.c |
michael@0 | 24 | +++ b/gfx/cairo/cairo/src/cairo-image-surface.c |
michael@0 | 25 | @@ -1138,16 +1138,27 @@ _cairo_image_surface_composite (cairo_op |
michael@0 | 26 | return status; |
michael@0 | 27 | |
michael@0 | 28 | status = _cairo_image_surface_set_attributes (src, &src_attr, |
michael@0 | 29 | dst_x + width / 2., |
michael@0 | 30 | dst_y + height / 2.); |
michael@0 | 31 | if (unlikely (status)) |
michael@0 | 32 | goto CLEANUP_SURFACES; |
michael@0 | 33 | |
michael@0 | 34 | + /* we sometimes get destinations with transforms. |
michael@0 | 35 | + * we're not equiped to deal with this */ |
michael@0 | 36 | + { |
michael@0 | 37 | + static const pixman_transform_t id = { |
michael@0 | 38 | + {{ pixman_fixed_1, 0, 0 }, |
michael@0 | 39 | + { 0, pixman_fixed_1, 0 }, |
michael@0 | 40 | + { 0, 0, pixman_fixed_1 }} |
michael@0 | 41 | + }; |
michael@0 | 42 | + pixman_image_set_transform (dst->pixman_image, &id); |
michael@0 | 43 | + } |
michael@0 | 44 | + |
michael@0 | 45 | if (mask) { |
michael@0 | 46 | status = _cairo_image_surface_set_attributes (mask, &mask_attr, |
michael@0 | 47 | dst_x + width / 2., |
michael@0 | 48 | dst_y + height / 2.); |
michael@0 | 49 | if (unlikely (status)) |
michael@0 | 50 | goto CLEANUP_SURFACES; |
michael@0 | 51 | |
michael@0 | 52 | pixman_image_composite (_pixman_operator (op), |