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