summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-09 21:50:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-09 21:57:03 +0100
commit6938592ec7e1a1b4cfccb11521ecdfdb8579f380 (patch)
tree83d6d626893689c151f4793907ec7b38ac3c1d96 /src
parentff22ab4c10e169e457887fae4fbd5394d45b939e (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')
-rw-r--r--src/cairo-xlib-source.c20
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 *)