From 37c5c2dbe55f64ee84ab248eb0072d5d7c5145cc Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 11 Jan 2012 20:51:29 +0100 Subject: surface: Only use non-NULL extents for internal mapping _cairo_surface_map_to_image() requires the input extents to be non-NULL. --- src/cairo-xlib-source.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/cairo-xlib-source.c') 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, -- cgit v1.2.3