[cairo-commit] 2 commits - src/cairo-surface.c src/cairo-xlib-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Feb 22 07:15:02 PST 2012


 src/cairo-surface.c      |    2 +-
 src/cairo-xlib-surface.c |   18 ++++++++----------
 2 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 5b107587e7f67f1b6829b3eb64f9238a65a16528
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 22 15:13:26 2012 +0000

    xlib: Correct the device-offset applied to the map-to-image result
    
    A typo, a typo surely, to use extents->y twice instead of the more
    normal x, y.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 78346c9..b3a48f1 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -651,7 +651,7 @@ cairo_surface_map_to_image (cairo_surface_t  *surface,
 						    _cairo_format_from_content (surface->content),
 						    extents->width,
 						    extents->height);
-	cairo_surface_set_device_offset (image, -extents->y, -extents->y);
+	cairo_surface_set_device_offset (image, -extents->x, -extents->y);
 
 	_cairo_pattern_init_for_surface (&pattern, surface);
 	pattern.base.filter = CAIRO_FILTER_NEAREST;
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 1f98508..322f929 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1281,7 +1281,7 @@ _cairo_xlib_surface_map_to_image (void                    *abstract_surface,
     cairo_surface_t *image;
 
     image = _get_image_surface (abstract_surface, extents);
-    cairo_surface_set_device_offset (image, -extents->y, -extents->y);
+    cairo_surface_set_device_offset (image, -extents->x, -extents->y);
 
     return image;
 }
commit 85110d9ce1a5ffd1cf274cf4233538fb55949078
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 22 15:04:45 2012 +0000

    xlib: Trim the intermediate upload image to match the upload extents
    
    Rather than transform the whole image, just convert the region of
    interest.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 71ddafb..1f98508 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1063,10 +1063,7 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t   *surface,
 	own_data = FALSE;
 
         pixman_image = pixman_image_create_bits (intermediate_format,
-                                                 image->width,
-                                                 image->height,
-                                                 NULL,
-                                                 0);
+                                                 width, height, NULL, 0);
         if (pixman_image == NULL) {
 	    status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
             goto BAIL;
@@ -1076,10 +1073,10 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t   *surface,
                                   image->pixman_image,
                                   NULL,
                                   pixman_image,
+                                  src_x, src_y,
                                   0, 0,
                                   0, 0,
-                                  0, 0,
-                                  image->width, image->height);
+                                  width, height);
 
 	ximage.bits_per_pixel = image_masks.bpp;
 	ximage.data = (char *) pixman_image_get_data (pixman_image);
@@ -1087,6 +1084,8 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t   *surface,
 
 	ret = XInitImage (&ximage);
 	assert (ret != 0);
+
+	src_x = src_y = 0;
     }
     else
     {
@@ -1206,9 +1205,8 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t   *surface,
     if (unlikely (status))
 	goto BAIL;
 
-    XPutImage (display->display, surface->drawable, gc,
-	       &ximage, src_x, src_y, dst_x, dst_y,
-	       width, height);
+    XPutImage (display->display, surface->drawable, gc, &ximage,
+	       src_x, src_y, dst_x, dst_y, width, height);
 
     _cairo_xlib_surface_put_gc (display, surface, gc);
 


More information about the cairo-commit mailing list