EXA: Fix exaTryDriverSolidFill() for solid source pictures.
Solid pictures have a NULL pFormat field, but their format is always PICT_a8r8g8b8. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
55305cf8db
commit
1088073b11
|
@ -185,24 +185,33 @@ exaGetRGBAFromPixel(CARD32 pixel,
|
||||||
CARD16 *green,
|
CARD16 *green,
|
||||||
CARD16 *blue,
|
CARD16 *blue,
|
||||||
CARD16 *alpha,
|
CARD16 *alpha,
|
||||||
PictFormatPtr pFormat)
|
PictFormatPtr pFormat,
|
||||||
|
PictFormatShort format)
|
||||||
{
|
{
|
||||||
int rbits, bbits, gbits, abits;
|
int rbits, bbits, gbits, abits;
|
||||||
int rshift, bshift, gshift, ashift;
|
int rshift, bshift, gshift, ashift;
|
||||||
|
|
||||||
if (!PICT_FORMAT_COLOR(pFormat->format) &&
|
if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A)
|
||||||
PICT_FORMAT_TYPE(pFormat->format) != PICT_TYPE_A)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
rbits = PICT_FORMAT_R(pFormat->format);
|
rbits = PICT_FORMAT_R(format);
|
||||||
gbits = PICT_FORMAT_G(pFormat->format);
|
gbits = PICT_FORMAT_G(format);
|
||||||
bbits = PICT_FORMAT_B(pFormat->format);
|
bbits = PICT_FORMAT_B(format);
|
||||||
abits = PICT_FORMAT_A(pFormat->format);
|
abits = PICT_FORMAT_A(format);
|
||||||
|
|
||||||
|
if (pFormat) {
|
||||||
rshift = pFormat->direct.red;
|
rshift = pFormat->direct.red;
|
||||||
gshift = pFormat->direct.green;
|
gshift = pFormat->direct.green;
|
||||||
bshift = pFormat->direct.blue;
|
bshift = pFormat->direct.blue;
|
||||||
ashift = pFormat->direct.alpha;
|
ashift = pFormat->direct.alpha;
|
||||||
|
} else if (format == PICT_a8r8g8b8) {
|
||||||
|
rshift = 16;
|
||||||
|
gshift = 8;
|
||||||
|
bshift = 0;
|
||||||
|
ashift = 24;
|
||||||
|
} else
|
||||||
|
FatalError("EXA bug: exaGetRGBAFromPixel() doesn't match "
|
||||||
|
"createSourcePicture()\n");
|
||||||
|
|
||||||
if (rbits) {
|
if (rbits) {
|
||||||
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
|
*red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
|
||||||
|
@ -293,7 +302,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
pixel = pSrc->pSourcePict->solidFill.color;
|
pixel = pSrc->pSourcePict->solidFill.color;
|
||||||
|
|
||||||
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
if (!exaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha,
|
||||||
pSrc->pFormat) ||
|
pSrc->pFormat, pSrc->format) ||
|
||||||
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
||||||
pDst->pFormat))
|
pDst->pFormat))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue