summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-23 15:04:26 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-23 15:09:35 +0000
commitfa4f48cccb6c7f4e1afb2ff4b98b906b7d8d4afc (patch)
tree3c2c38a3a271aef5a0b7c33e01b8e504f60bab0f /src/cairo-xlib-surface.c
parented2fa6b16b03fccc3e21598cdb9157cbcebd1d37 (diff)
downloadcairo-fa4f48cccb6c7f4e1afb2ff4b98b906b7d8d4afc.tar.gz
xlib: Do not upload the whole image just because we want an entire row
Fixes regression exposed by commit a73e7ff0186176bc82cd3ae1432c054c1fd3aebd Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sun Jan 6 11:29:27 2013 +0000 xlib: Simplify source creation by use of map-to-image but ultimately from commit 74941f822015cc50cd8477d0cf97f1a70dbff60b Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jan 2 22:27:55 2013 +0000 xlib: Use SHM transport for ordinary image uploads Reported-by: Gökçen Eraslan <gokcen.eraslan@gmail.com> Reported-by: Guillaume Ayoub <guillaume.ayoub@kozea.fr> Reported-by: Emmanuel Benisty <benisty.e@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59635 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r--src/cairo-xlib-surface.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index dbc677eb7..ee69b66f9 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1139,26 +1139,24 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t *surface,
max_request_size = XMaxRequestSize (display->display);
if (max_request_size > 8192)
max_request_size = 8192;
- if (image->stride * image->height > max_request_size) {
+ if (width * height * 4 > max_request_size) {
shm_image = _cairo_xlib_surface_create_shm__image (surface,
image->pixman_format,
- image->width,
- image->height);
+ width, height);
if (shm_image && shm_image->status == CAIRO_STATUS_SUCCESS) {
cairo_image_surface_t *clone = (cairo_image_surface_t *) shm_image;
- if (clone->stride == image->stride) {
- memcpy (clone->data, image->data, clone->stride * clone->height);
- } else {
- pixman_image_composite32 (PIXMAN_OP_SRC,
- image->pixman_image, NULL, clone->pixman_image,
- 0, 0,
- 0, 0,
- 0, 0,
- image->width, image->height);
- }
+ pixman_image_composite32 (PIXMAN_OP_SRC,
+ image->pixman_image, NULL, clone->pixman_image,
+ src_x, src_y,
+ 0, 0,
+ 0, 0,
+ width, height);
ximage.obdata = _cairo_xlib_shm_surface_get_obdata (shm_image);
ximage.data = (char *)clone->data;
ximage.bytes_per_line = clone->stride;
+ ximage.width = width;
+ ximage.height = height;
+ src_x = src_y = 0;
}
}
} else