xrender issue

Hans-Peter Budek peter.budek at gmx.de
Fri Nov 4 07:11:28 PDT 2011

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:

uint16_t          v = a->Fade * 600 ;
XRenderColor      Fade = {.red = v, .green = v, .blue = v, .alpha = v} ;
Pixmap            Map = XCreatePixmap(s->Dpy, f->Win, 1, 1, 8) ;
XRenderPictFormat *Format8 = XRenderFindStandardFormat(s->Dpy, PictStandardA8) ;
XRenderPictureAttributes Rep = {.repeat = RepeatNormal,
                                .subwindow_mode = IncludeInferiors} ;
Picture           Alpha = XRenderCreatePicture(s->Dpy, Map, Format8,
                                               CPRepeat, &Rep) ;
Picture           Dest = XRenderCreatePicture(s->Dpy, f->Win,
                                              CPSubwindowMode, &Rep) ;
XRenderPictureAttributes Att = {.alpha_map = Alpha} ;

XRenderFillRectangle(s->Dpy, PictOpSrc, Alpha, &Fade, 0, 0, 1, 1) ;

XRenderChangePicture(s->Dpy, a->OldPic, CPAlphaMap, &Att) ;
XRenderChangePicture(s->Dpy, a->NewPic, CPAlphaMap, &Att) ;
XRenderChangePicture(s->Dpy, Dest, CPAlphaMap, &Att) ;

Rendering to 'Dest' cause the described crash (even PictOpClear).

I tried out 'PictStandardARGB32' alpha maps and maps with the same size
as the windows (no 'RepeatNormal'). But that makes no difference.

Unfortunately a copy of a 'PictStandardA8' picture to a 'PictStandardARGB32'
(via PictOpSrc) does not only modifies the alpha values (it also clears the RGB


More information about the xorg mailing list