diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-09 21:50:34 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-09 21:57:03 +0100 |
commit | 6938592ec7e1a1b4cfccb11521ecdfdb8579f380 (patch) | |
tree | 83d6d626893689c151f4793907ec7b38ac3c1d96 /src/cairo-xlib-source.c | |
parent | ff22ab4c10e169e457887fae4fbd5394d45b939e (diff) |
xlib: If a sample accesses outside of a repeating image, upload it all
Fixes bug-51910
Reported-by: Albertas Vyšniauskas <thezbyg@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51910
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-source.c')
-rw-r--r-- | src/cairo-xlib-source.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c index ac0fdf8b..09f824f8 100644 --- a/src/cairo-xlib-source.c +++ b/src/cairo-xlib-source.c @@ -920,13 +920,19 @@ surface_source (cairo_xlib_surface_t *dst, cairo_matrix_t m; upload = *sample; - if (_cairo_surface_get_extents (pattern->surface, &limit) && - ! _cairo_rectangle_intersect (&upload, &limit)) - { - if (pattern->base.extend == CAIRO_EXTEND_NONE) - return alpha_source (dst, 0); - - upload = limit; + if (_cairo_surface_get_extents (pattern->surface, &limit)) { + if (pattern->base.extend == CAIRO_EXTEND_NONE) { + if (! _cairo_rectangle_intersect (&upload, &limit)) + return alpha_source (dst, 0); + } else { + if (upload.x < limit.x || + upload.x + upload.width > limit.x + limit.width || + upload.y < limit.y || + upload.y + upload.height > limit.y + limit.height) + { + upload = limit; + } + } } src = (cairo_xlib_surface_t *) |