xlib/shm: Tidy creation of the proxy source for ShmPixmaps

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-01-29 02:51:25 +00:00
parent 30e9505151
commit 02a2baa8dc

View file

@ -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);