diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-02 13:19:17 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-02 13:19:17 +0100 |
commit | 1f84f5682c6ff246b3d28c75c8731504f31c1ee1 (patch) | |
tree | b059aacee20650148c441367af6c9a6d985cfd6a /src | |
parent | d2d6c96c24501d888422ea42d3c90d3c8f3647a0 (diff) |
xlib: Apply translation to image surface upload.
Fixes:
Bug 28888 - cairo_paint with rgb images does not work correctly
https://bugs.freedesktop.org/show_bug.cgi?id=28888
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-xlib-surface.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 0281efb6..baf43022 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -2329,11 +2329,14 @@ _cairo_xlib_surface_upload(cairo_xlib_surface_t *surface, if (! _cairo_matrix_is_integer_translation (&pattern->matrix, &tx, &ty)) return CAIRO_INT_STATUS_UNSUPPORTED; + src_x += tx; + src_y += ty; + /* XXX for EXTEND_NONE perform unbounded fixups? */ - if (src_x + tx < extents.x || - src_y + ty < extents.y || - src_x + tx + width > (unsigned) extents.width || - src_y + ty + height > (unsigned) extents.height) + if (src_x < extents.x || + src_y < extents.y || + src_x + width > (unsigned) extents.width || + src_y + height > (unsigned) extents.height) { return CAIRO_INT_STATUS_UNSUPPORTED; } @@ -2354,7 +2357,7 @@ _cairo_xlib_surface_upload(cairo_xlib_surface_t *surface, cairo_region_get_rectangle (clip_region, n, &rect); status = _draw_image_surface (surface, image, - rect.x + src_x, rect.x + src_y, + rect.x + src_x, rect.y + src_y, rect.width, rect.height, rect.x, rect.y); if (unlikely (status)) |