/[gentoo-x86]/x11-libs/cairo/files/cairo-1.12.10-xlib-corruption.patch
Gentoo

Contents of /x11-libs/cairo/files/cairo-1.12.10-xlib-corruption.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Jan 27 11:20:15 2013 UTC (18 months ago) by chithanh
Branch: MAIN
CVS Tags: HEAD
Add patch to fix display corruption, bug #454108.

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

1 From fa4f48cccb6c7f4e1afb2ff4b98b906b7d8d4afc Mon Sep 17 00:00:00 2001
2 From: Chris Wilson <chris@chris-wilson.co.uk>
3 Date: Wed, 23 Jan 2013 15:04:26 +0000
4 Subject: xlib: Do not upload the whole image just because we want an entire row
5
6 Fixes regression exposed by
7
8 commit a73e7ff0186176bc82cd3ae1432c054c1fd3aebd
9 Author: Chris Wilson <chris@chris-wilson.co.uk>
10 Date: Sun Jan 6 11:29:27 2013 +0000
11
12 xlib: Simplify source creation by use of map-to-image
13
14 but ultimately from
15
16 commit 74941f822015cc50cd8477d0cf97f1a70dbff60b
17 Author: Chris Wilson <chris@chris-wilson.co.uk>
18 Date: Wed Jan 2 22:27:55 2013 +0000
19
20 xlib: Use SHM transport for ordinary image uploads
21
22 Reported-by: Gökçen Eraslan <gokcen.eraslan@gmail.com>
23 Reported-by: Guillaume Ayoub <guillaume.ayoub@kozea.fr>
24 Reported-by: Emmanuel Benisty <benisty.e@gmail.com>
25 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59635
26 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
27 ---
28 diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
29 index 24290f7..ca55278 100644
30 --- a/src/cairo-xlib-source.c
31 +++ b/src/cairo-xlib-source.c
32 @@ -1035,7 +1035,13 @@ surface_source (cairo_xlib_surface_t *dst,
33
34 status = _cairo_surface_unmap_image (&xsrc->base, image);
35 if (unlikely (status)) {
36 - cairo_surface_destroy (src);
37 + cairo_surface_destroy (&xsrc->base);
38 + return _cairo_surface_create_in_error (status);
39 + }
40 +
41 + status = _cairo_xlib_surface_put_shm (xsrc);
42 + if (unlikely (status)) {
43 + cairo_surface_destroy (&xsrc->base);
44 return _cairo_surface_create_in_error (status);
45 }
46 }
47 diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
48 index dbc677e..ee69b66 100644
49 --- a/src/cairo-xlib-surface.c
50 +++ b/src/cairo-xlib-surface.c
51 @@ -1139,26 +1139,24 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t *surface,
52 max_request_size = XMaxRequestSize (display->display);
53 if (max_request_size > 8192)
54 max_request_size = 8192;
55 - if (image->stride * image->height > max_request_size) {
56 + if (width * height * 4 > max_request_size) {
57 shm_image = _cairo_xlib_surface_create_shm__image (surface,
58 image->pixman_format,
59 - image->width,
60 - image->height);
61 + width, height);
62 if (shm_image && shm_image->status == CAIRO_STATUS_SUCCESS) {
63 cairo_image_surface_t *clone = (cairo_image_surface_t *) shm_image;
64 - if (clone->stride == image->stride) {
65 - memcpy (clone->data, image->data, clone->stride * clone->height);
66 - } else {
67 - pixman_image_composite32 (PIXMAN_OP_SRC,
68 - image->pixman_image, NULL, clone->pixman_image,
69 - 0, 0,
70 - 0, 0,
71 - 0, 0,
72 - image->width, image->height);
73 - }
74 + pixman_image_composite32 (PIXMAN_OP_SRC,
75 + image->pixman_image, NULL, clone->pixman_image,
76 + src_x, src_y,
77 + 0, 0,
78 + 0, 0,
79 + width, height);
80 ximage.obdata = _cairo_xlib_shm_surface_get_obdata (shm_image);
81 ximage.data = (char *)clone->data;
82 ximage.bytes_per_line = clone->stride;
83 + ximage.width = width;
84 + ximage.height = height;
85 + src_x = src_y = 0;
86 }
87 }
88 } else
89 --
90 cgit v0.9.0.2-2-gbebe

  ViewVC Help
Powered by ViewVC 1.1.20