On Fri, 04 Nov 2011 15:11:28 +0100, Hans-Peter Budek <[email protected]> wrote:
> Chris Wilson wrote:
>
> >
> > Do you mind describing you use-case for alphamaps and could you create a
> > little benchmark for your workload?
> > -Chris
> >
>
>
> I´am programming a animated crossfade from one window to another.
> Both windows are not created by my application. The content
> of both windows is previously stored in a ARGB32 picture
> (without a usable alpha channel). To apply an alpha channel, I use:
So what I think you want to achieve is:
dst = a * srcA + (1-a) * srcB
which can be acheived (and hitting the accelerated paths) with:
Picture a = XRenderCreateSolidFill(dpy, &(XRenderColor){.alpha = 0xffff *
Fade});
Picture ia = XRenderCreateSolidFill(dpy, &(XRenderColor){.alpha = 0xffff *
(1-Fade)});
XRenderComposite(dpy, PictOpSrc, srcA, a, dst, 0, 0, 0, 0, 0, 0, width,
height);
XRenderComposite(dpy, PictOpAdd, srcB, ia, dst, 0, 0, 0, 0, 0, 0, width,
height);
XRenderFreePicture(dpy, ia);
XRenderFreePicture(dpy, a);
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
[email protected]: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: [email protected]