GNOME Bugzilla – Bug 88662
RENDER without depth 32 pixmaps
Last modified: 2004-12-22 21:47:04 UTC
The code for accelerated alpha compositing using the RENDER extension in gdkdrawable-x11.c assumes that 32 is a supported pixmap depth, since draw_with_images attempts to create depth 32 pixmap. While recent XFree86 servers seem to always advertise depth 32 for pixmaps, there are servers which do support the RENDER extension, but not depth 32 pixmaps, e.g. Xvfb as shipped with XFree 4.2. Now, Xvfb may not be a very serious server, but if RENDER support spreads further, more examples may appear, and since the information about supported pixmap depths is readily available, I'd say gdk should do the right thing and ignore the RENDER extension if depth 32 pixmaps are not available. Trying to use RENDER on depth 8 or even depth 4 pixmaps is probably not worth it.
The RENDER spec requires a 8888 RGBA pcuture format to be available. I'm not sure if that implies that it requires a 32 pixmaps to be available, but it certainly is highly pathological. If there are broken servers out there and a quick fix woudl prevent a crash... sure, it probably makes sense.
Render requires that depth 1, 4, 8, 24 and 32 bits be provided in the server. Servers without that compliment of depths are violating the Render spec. I'm not surprised that Xvfb is broken; as far as I know, it has yet to be ported to fb from cfb. I'll fix the Render code to not advertise the extension if the necessary depths aren't available.
Keith, where exactly does the spec require this ? I see that PictFormats of depth 32, 24, 8, 4 and 1 are required, and I see that a PictFormat of depth 32 needs a bpp 32 pixmap format, but couldn't that be a depth 24, bpp 32 pixmap format ? Or is CreatePicture supposed to throw BadMatch if the depth of the Drawable doesn't equal the depth of the PictFormat ?
"7. Standard PictFormats The server must support a Direct PictFormat with 8 bits each of red, green, blue and alpha as well as a Direct PictFormat with 8 bits of red, green and blue and 0 bits of alpha. The server must also support Direct PictFormats with 1, 4 and 8 bits of alpha and 0 bits of r, g and b." The wording is a bit oblique, and not quite as constrained as I outlined, but the one certain requirement is a depth 32 8888 ARGB format. It is allowed that the other formats might be held in pixels larger than strictly necessary; I could be persueded that this restriction be tightened to force depth 1, 4, 8 and 24 to be explicitly supported. "13. Extension Requests CreatePicture ... It is a Match error to specify a format with a different depth than the drawable. If the drawable is a Window then the Red, Green and Blue masks must match those in the visual for the window else a Match error is generated."
Ah, ok. I was missing the bit about matching the depth of the drawable and the format when creating a picture. Nothing to do on the gdk side then, I guess.