summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cairo-xlib-source.c10
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);