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

Uli Schlachter psychon at kemper.freedesktop.org
Wed Oct 14 05:27:19 PDT 2015


 src/cairo-xcb-surface.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 25a55822b4e22728834c96c8e73176d42bb406e3
Author: Uli Schlachter <psychon at znc.in>
Date:   Wed Oct 14 14:24:16 2015 +0200

    xcb: Fix _put_image_boxes() if no SHM is available
    
    This function tries to use _cairo_xcb_connection_put_image() to do the actual
    work. However, that function can only be used for images with "native" stride.
    If we only want to upload a rectangle from within an image, the function
    _cairo_xcb_connection_put_subimage() has to be used. This function makes sure
    that the correct information is sent to the X11 server.
    
    No unit test for this, because we currently do not test the !SHM case
    automatically. Perhaps we should?
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 2403a0d..d4d60ad 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -691,15 +691,15 @@ _put_image_boxes (cairo_xcb_surface_t    *surface,
 			    int y = _cairo_fixed_integer_part (b->p1.y);
 			    int width = _cairo_fixed_integer_part (b->p2.x - b->p1.x);
 			    int height = _cairo_fixed_integer_part (b->p2.y - b->p1.y);
-			    _cairo_xcb_connection_put_image (surface->connection,
-							     surface->drawable, gc,
-							     width, height,
-							     x, y,
-							     image->depth,
-							     image->stride,
-							     image->data +
-							     x * PIXMAN_FORMAT_BPP (image->pixman_format) / 8 +
-							     y * image->stride);
+			    _cairo_xcb_connection_put_subimage (surface->connection,
+								surface->drawable, gc,
+								x, y,
+								width, height,
+								PIXMAN_FORMAT_BPP (image->pixman_format) / 8,
+								image->stride,
+								x, y,
+								image->depth,
+								image->data);
 
 		    }
 	    }
commit d31dc73f9ba1facdbeee722c022d438f15e5f264
Author: Uli Schlachter <psychon at znc.in>
Date:   Wed Oct 14 14:22:50 2015 +0200

    xcb: Fix _put_shm_image_boxes if no SHM available
    
    This function always returned CAIRO_INT_STATUS_SUCCESS, even if it didn't do
    anything. This commit makes the function return CAIRO_INT_STATUS_UNSUPPORTED
    instead.
    
    No unit test for this, because we currently do not test the !SHM case
    automatically. Perhaps we should?
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index d7e0d73..2403a0d 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -646,9 +646,8 @@ _put_shm_image_boxes (cairo_xcb_surface_t    *surface,
 						     shm_info->offset);
 	    }
 	}
+	return CAIRO_INT_STATUS_SUCCESS;
     }
-
-    return CAIRO_INT_STATUS_SUCCESS;
 #endif
 
     return CAIRO_INT_STATUS_UNSUPPORTED;


More information about the cairo-commit mailing list