diff options
author | Benjamin Otte <otte@gnome.org> | 2009-11-04 11:15:57 +0100 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2009-11-04 11:20:45 +0100 |
commit | 52afe9c77f2f54372fefeca50321a27e8dda0f63 (patch) | |
tree | 09769389ff237dde8bd3015c84b18a037d2e8e84 /src/cairo-xlib-surface.c | |
parent | 84bbf179c375622d2c7b4e21b1b8ce189b5a18f2 (diff) |
[xlib] Fix new Composite test
When the reference point was tirggering _line_exceeds_16_16() and got
adjusted, the code failed to compute the srcX and srcY arguments for the
call to XRenderCompositeTrapezoids() correctly and caused the resulting
source image to be misaligned.
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r-- | src/cairo-xlib-surface.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 03053f00..fc235a9f 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -2605,17 +2605,6 @@ _cairo_xlib_surface_composite_trapezoids (cairo_operator_t op, break; } - if (traps[0].left.p1.y < traps[0].left.p2.y) { - render_reference_x = _cairo_fixed_integer_floor (traps[0].left.p1.x); - render_reference_y = _cairo_fixed_integer_floor (traps[0].left.p1.y); - } else { - render_reference_x = _cairo_fixed_integer_floor (traps[0].left.p2.x); - render_reference_y = _cairo_fixed_integer_floor (traps[0].left.p2.y); - } - - render_src_x = src_x + render_reference_x - dst_x; - render_src_y = src_y + render_reference_y - dst_y; - status = _cairo_xlib_surface_set_clip_region (dst, clip_region); if (unlikely (status)) goto BAIL; @@ -2674,6 +2663,17 @@ _cairo_xlib_surface_composite_trapezoids (cairo_operator_t op, } } + if (xtraps[0].left.p1.y < xtraps[0].left.p2.y) { + render_reference_x = _cairo_fixed_16_16_floor (xtraps[0].left.p1.x); + render_reference_y = _cairo_fixed_16_16_floor (xtraps[0].left.p1.y); + } else { + render_reference_x = _cairo_fixed_16_16_floor (xtraps[0].left.p2.x); + render_reference_y = _cairo_fixed_16_16_floor (xtraps[0].left.p2.y); + } + + render_src_x = src_x + render_reference_x - dst_x; + render_src_y = src_y + render_reference_y - dst_y; + XRenderCompositeTrapezoids (dst->dpy, _render_operator (op), src->src_picture, dst->dst_picture, |