michael@0: # HG changeset patch michael@0: # User Jeff Muizelaar michael@0: # Date 1299543337 18000 michael@0: # Node ID 57f411f16517fa3abc31b6b081dd31420c4d9b45 michael@0: # Parent e56ecd8b3a68c158025207c5fd081d043e28f5ce michael@0: Bug 637828. Reset the transform on the dest image. r=joe michael@0: michael@0: We can get into a situation where the destination image has a transform michael@0: because we use it as source. The transform set when the image is a source michael@0: sticks around and when we use it as a destination pixman gets confused. michael@0: michael@0: It seems like the code at fault here is really pixman. I think that pixman michael@0: should probably not be using a transformed fetch on the destination image under michael@0: any circumstances. michael@0: michael@0: For example, in this case we're fetching destination pixels from a different michael@0: part of the image than we're storing them to. I can't see any reason for michael@0: wanting this behaviour. michael@0: michael@0: However, reseting the transform seemed like the easiest solution. michael@0: michael@0: diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c michael@0: --- a/gfx/cairo/cairo/src/cairo-image-surface.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-image-surface.c michael@0: @@ -1138,16 +1138,27 @@ _cairo_image_surface_composite (cairo_op michael@0: return status; michael@0: michael@0: status = _cairo_image_surface_set_attributes (src, &src_attr, michael@0: dst_x + width / 2., michael@0: dst_y + height / 2.); michael@0: if (unlikely (status)) michael@0: goto CLEANUP_SURFACES; michael@0: michael@0: + /* we sometimes get destinations with transforms. michael@0: + * we're not equiped to deal with this */ michael@0: + { michael@0: + static const pixman_transform_t id = { michael@0: + {{ pixman_fixed_1, 0, 0 }, michael@0: + { 0, pixman_fixed_1, 0 }, michael@0: + { 0, 0, pixman_fixed_1 }} michael@0: + }; michael@0: + pixman_image_set_transform (dst->pixman_image, &id); michael@0: + } michael@0: + michael@0: if (mask) { michael@0: status = _cairo_image_surface_set_attributes (mask, &mask_attr, michael@0: dst_x + width / 2., michael@0: dst_y + height / 2.); michael@0: if (unlikely (status)) michael@0: goto CLEANUP_SURFACES; michael@0: michael@0: pixman_image_composite (_pixman_operator (op),