Damien Leone <[email protected]> writes: > diff --git a/render/picture.c b/render/picture.c > index 58535d4..d060bc2 100644 > --- a/render/picture.c > +++ b/render/picture.c > @@ -201,6 +201,12 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int > *nformatp) > formats[nformats].format = PICT_b8g8r8x8; > formats[nformats].depth = 32; > nformats++; > + formats[nformats].format = PICT_r8g8b8a8; > + formats[nformats].depth = 32; > + nformats++; > + formats[nformats].format = PICT_r8g8b8x8; > + formats[nformats].depth = 32; > + nformats++;
I don't think adding these as default formats is going to be as useful as you'd like; applications looking for a format with alpha will probably be using the Xrender libary 'standard' ARGB32 format or equivalent. Expecting applications to find RGBA and do the byte swapping on images themselves is probably asking too much. > @@ -672,12 +708,14 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, > int nformats) > if ((formats[n].direct.redMask | > formats[n].direct.blueMask | formats[n].direct.greenMask) > == 0) > type = PICT_TYPE_A; > - else if (formats[n].direct.red > formats[n].direct.blue) > + else if (formats[n].direct.blue == 0) > type = PICT_TYPE_ARGB; > else if (formats[n].direct.red == 0) > type = PICT_TYPE_ABGR; > - else > + else if (formats[n].direct.blue > formats[n].direct.red) > type = PICT_TYPE_BGRA; > + else > + type = PICT_TYPE_RGBA; yeah, that's kinda icky, but it looks like it will work for the formats we have today. I'd remove the standard format stuff and expect that your visuals will construct the necessary formats on the fly; otherwise, this looks OK to me. -- [email protected]
pgpz9E_loBWML.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
