combining Render's Composite + SHM's PutImage

Nigel Tao nigeltao at golang.org
Mon Apr 13 02:33:31 PDT 2015


On Fri, Apr 10, 2015 at 10:23 PM, Nigel Tao <nigeltao at golang.org> wrote:
> Even where SHM CreatePixmap works, I can only seem to create a
> depth-24 pixmap, which defeats the purpose of alpha-blending if the
> shared-memory image's alpha channel is implicitly fully opaque. If I
> try to create a depth-32 pixmap, I get a Bad Match (8) error. I
> noticed that the Screen's RootVisual (0x20, see xdpyinfo snippet
> below) that I passed to CreateWindow corresponded to a depth-24
> VisualInfo, so I tried passing different VisualInfos to CreateWindow
> (either 0x21 or 0x60), but got another Bad Match (8) error from
> CreateWindow.

Ah, creating depth-32 pixmap and pictures works... once I set a
colormap, which makes sense.

Also, I seem to need a border pixel (or border pixmap), which is less
obvious to me.
http://stackoverflow.com/questions/3645632/how-to-create-a-window-with-a-bit-depth-of-32

One last thing: by using a depth-32 visual and colormap, I no longer
get expose events when my window manager moves my window off-screen.
Instead, the previously painted pixels are restored. I guess this
makes sense, since the window's pixels (of depth 32) are no longer
shared with the screen's pixels (of depth 24). However, I'm worried
about having many such windows, all taking up memory even if I
minimize or iconify them. Is there a way for my program (the X client)
to tell the X server to drop the backing pixmap when idle / minimized?


More information about the xorg mailing list