Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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@znc.in>
  • Loading branch information
Uli Schlachter committed Oct 14, 2015
1 parent d31dc73 commit 25a5582
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/cairo-xcb-surface.c
Expand Up @@ -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);

}
}
Expand Down

0 comments on commit 25a5582

Please sign in to comment.