1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/cairo/pixman-image-transform.patch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +# HG changeset patch 1.5 +# User Jeff Muizelaar <jmuizelaar@mozilla.com> 1.6 +# Date 1299543337 18000 1.7 +# Node ID 57f411f16517fa3abc31b6b081dd31420c4d9b45 1.8 +# Parent e56ecd8b3a68c158025207c5fd081d043e28f5ce 1.9 +Bug 637828. Reset the transform on the dest image. r=joe 1.10 + 1.11 +We can get into a situation where the destination image has a transform 1.12 +because we use it as source. The transform set when the image is a source 1.13 +sticks around and when we use it as a destination pixman gets confused. 1.14 + 1.15 +It seems like the code at fault here is really pixman. I think that pixman 1.16 +should probably not be using a transformed fetch on the destination image under 1.17 +any circumstances. 1.18 + 1.19 +For example, in this case we're fetching destination pixels from a different 1.20 +part of the image than we're storing them to. I can't see any reason for 1.21 +wanting this behaviour. 1.22 + 1.23 +However, reseting the transform seemed like the easiest solution. 1.24 + 1.25 +diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c 1.26 +--- a/gfx/cairo/cairo/src/cairo-image-surface.c 1.27 ++++ b/gfx/cairo/cairo/src/cairo-image-surface.c 1.28 +@@ -1138,16 +1138,27 @@ _cairo_image_surface_composite (cairo_op 1.29 + return status; 1.30 + 1.31 + status = _cairo_image_surface_set_attributes (src, &src_attr, 1.32 + dst_x + width / 2., 1.33 + dst_y + height / 2.); 1.34 + if (unlikely (status)) 1.35 + goto CLEANUP_SURFACES; 1.36 + 1.37 ++ /* we sometimes get destinations with transforms. 1.38 ++ * we're not equiped to deal with this */ 1.39 ++ { 1.40 ++ static const pixman_transform_t id = { 1.41 ++ {{ pixman_fixed_1, 0, 0 }, 1.42 ++ { 0, pixman_fixed_1, 0 }, 1.43 ++ { 0, 0, pixman_fixed_1 }} 1.44 ++ }; 1.45 ++ pixman_image_set_transform (dst->pixman_image, &id); 1.46 ++ } 1.47 ++ 1.48 + if (mask) { 1.49 + status = _cairo_image_surface_set_attributes (mask, &mask_attr, 1.50 + dst_x + width / 2., 1.51 + dst_y + height / 2.); 1.52 + if (unlikely (status)) 1.53 + goto CLEANUP_SURFACES; 1.54 + 1.55 + pixman_image_composite (_pixman_operator (op),