xrender issue

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 4 08:41:12 PDT 2011


On Fri, 04 Nov 2011 15:11:28 +0100, Hans-Peter Budek <peter.budek at gmx.de> 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



More information about the xorg mailing list