Re: RENDER extension on Exceed 8 with FC1

Keith Packard <[email protected]> Wed, 03 Dec 2003 08:26:57 -0800
Newsgroups gmane.comp.freedesktop.xlibs.general
Message-ID <[email protected]>
Around 11 o'clock on Dec 3, Karl Vogel wrote:

> Would it be possible to make RENDER work without depth 4?! If I disable the 
> depth 4 test and let PictStandardA4 use the PictStandardA1 parameters, then 
> I get the font anti aliasing in KDE, but I guess it would cause problems 
> for some applications?! ie. I can't use fixed font anymore after this 
> change, as I get the following errors:

The Render specification requires support for this pixel format, so a 
server without support for depth 4 pixmaps is not conformant:

"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 Xrender library was changed to check for conformance as many X servers 
advertise "Render" support without bothering to also support the required
pixmap depths, making them unsuitable for Render-based applications.  The 
most obvious case was a server which advertised Render support but failed 
to support depth 32 images, making it useless as it couldn't manage ARGB 
data in any format.

So, the real question here is whether the specification needs to be 
changed.  Unfortunately, the Xrender library advertises these standard 
formats through the XRenderFindStandardFormat API, so removing the 
requirement for depth 4 support also changes this API.

I submit that supporting depth 4 (at 8bpp) would be trivial for the X 
server in question and would solve the problem correctly; perhaps you can 
submit a bug report noting the specification requirements.

One thing we might do in the interim is provide an environment variable
that would skip the picky depth checks in the library.  I would ask that 
it be accompanied by an abort() in the XRenderFindStandardFormat function 
so that applications using these required formats which don't exist will 
crash at startup rather than struggling along and possibly corrupting data.

-keith