diff options
author | Andrea Canciani <ranma42@gmail.com> | 2012-01-11 20:51:29 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2012-05-26 16:06:39 +0200 |
commit | 37c5c2dbe55f64ee84ab248eb0072d5d7c5145cc (patch) | |
tree | a1631a3506ad30281174e71af86faa007be842e4 /src/cairo-xlib-source.c | |
parent | d6fb8d2134c989d2ad455ec37ce4f623d4769c46 (diff) |
surface: Only use non-NULL extents for internal mapping
_cairo_surface_map_to_image() requires the input extents to be
non-NULL.
Diffstat (limited to 'src/cairo-xlib-source.c')
-rw-r--r-- | src/cairo-xlib-source.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c index f8dac70b3..dec762224 100644 --- a/src/cairo-xlib-source.c +++ b/src/cairo-xlib-source.c @@ -261,6 +261,7 @@ render_pattern (cairo_xlib_surface_t *dst, cairo_xlib_surface_t *src; cairo_surface_t *image; cairo_status_t status; + cairo_rectangle_int_t map_extents; src = (cairo_xlib_surface_t *) _cairo_surface_create_similar_scratch (&dst->base, @@ -272,7 +273,10 @@ render_pattern (cairo_xlib_surface_t *dst, return None; } - image = cairo_surface_map_to_image (&src->base, NULL); + map_extents = *extents; + map_extents.x = map_extents.y = 0; + + image = cairo_surface_map_to_image (&src->base, &map_extents); status = _cairo_surface_offset_paint (image, extents->x, extents->y, CAIRO_OPERATOR_SOURCE, pattern, NULL); @@ -912,7 +916,7 @@ surface_source (cairo_xlib_surface_t *dst, cairo_surface_t *image; cairo_surface_pattern_t local_pattern; cairo_status_t status; - cairo_rectangle_int_t upload, limit; + cairo_rectangle_int_t upload, limit, map_extents; cairo_matrix_t m; upload = *sample; @@ -939,7 +943,10 @@ surface_source (cairo_xlib_surface_t *dst, cairo_matrix_init_translate (&local_pattern.base.matrix, upload.x, upload.y); - image = cairo_surface_map_to_image (&src->base, NULL); + map_extents = upload; + map_extents.x = map_extents.y = 0; + + image = cairo_surface_map_to_image (&src->base, &map_extents); status = _cairo_surface_paint (image, CAIRO_OPERATOR_SOURCE, &local_pattern.base, |