diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-29 02:51:25 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-29 02:51:25 +0000 |
commit | 02a2baa8dcf49ad2d9766d43578ba216fab0d464 (patch) | |
tree | 2b56f2da6593b008721a41987d0b9c6da7f2e877 | |
parent | 30e950515171b25d9bc3da8d535cfe05d8be69c8 (diff) |
xlib/shm: Tidy creation of the proxy source for ShmPixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/cairo-xlib-source.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c index ca552785..0cc32e8e 100644 --- a/src/cairo-xlib-source.c +++ b/src/cairo-xlib-source.c @@ -955,18 +955,14 @@ surface_source (cairo_xlib_surface_t *dst, _cairo_xlib_shm_surface_get_pixmap (src)) { cairo_xlib_proxy_t *proxy; - cairo_surface_reference (src); - proxy = malloc (sizeof(*proxy)); - if (unlikely (proxy == NULL)) { - cairo_surface_destroy (src); + if (unlikely (proxy == NULL)) return _cairo_surface_create_in_error (CAIRO_STATUS_NO_MEMORY); - } _cairo_surface_init (&proxy->source.base, &cairo_xlib_proxy_backend, dst->base.device, - CAIRO_CONTENT_COLOR_ALPHA); + src->content); proxy->source.dpy = dst->display->display; proxy->source.picture = XRenderCreatePicture (proxy->source.dpy, @@ -979,7 +975,7 @@ surface_source (cairo_xlib_surface_t *dst, proxy->source.has_matrix = 0; proxy->source.filter = CAIRO_FILTER_NEAREST; proxy->source.extend = CAIRO_EXTEND_NONE; - proxy->owner = src; + proxy->owner = cairo_surface_reference (src); return embedded_source (dst, pattern, extents, src_x, src_y, &proxy->source); |