mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-12 19:29:28 +02:00
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:
parent
30e9505151
commit
02a2baa8dc
1 changed files with 3 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue