[cairo] [patch] gl: fix bug when mask/source surface are not created within a same context as dst surface
Chris Wilson
chris at chris-wilson.co.uk
Wed Jul 25 09:10:28 PDT 2012
On Wed, 25 Jul 2012 00:24:14 +0000, "Henry (Yu) Song - SISA" <hsong at sisa.samsung.com> wrote:
> commit 3bf82304fda6a9e2a09753f2b3c5ac66baa02140
> Author: Henry Song <henry.song at samsung.com>
> Date: Tue Jul 24 17:13:46 2012 -0700
>
> gl: when mask/source and dst are all GL surfaces, and they do not have a same
> device (they are created from different context/display), we cannot use
> mask/source texture directly.
>
> This fixes bug for gl-surface-source test case in GL backend. Ideally,
> instead of falling back, we should download the texture from mask/source and
> then upload it to a texture that is created in the same context as the dst.
> However, this requires release the current dst's device and acquire it again
> once we finish downloading. Given the device might be recursively locked and
> a single release does not do the job, so let's fallback.
>
> diff --git a/src/cairo-mask-compositor.c b/src/cairo-mask-compositor.c
> index 7976a79..acfb01a 100644
> --- a/src/cairo-mask-compositor.c
> +++ b/src/cairo-mask-compositor.c
> @@ -813,6 +813,11 @@ upload_boxes (const cairo_mask_compositor_t *compositor,
> if (!(src->type == CAIRO_SURFACE_TYPE_IMAGE || src->type == dst->type))
> return CAIRO_INT_STATUS_UNSUPPORTED;
>
> + if (src->type == CAIRO_SURFACE_TYPE_GL && extents->surface->type == CAIRO_SURFACE_TYPE_GL) {
> + if (src->device != extents->surface->device)
> + return CAIRO_INT_STATUS_UNSUPPORTED;
> + }
So we should be doing the GL specific checks in the GL layer, so I
pushed this patch down into cairo-gl-spans-compositor.c::copy_boxes)
Thanks,
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo
mailing list