mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-22 20:35:43 +00:00
Bug #1895: Fix fbComposeGetSolid for BGR. (David S. Miller)
This commit is contained in:
parent
24cdd188dc
commit
79a7120983
3 changed files with 21 additions and 13 deletions
10
fb/fbpict.h
10
fb/fbpict.h
|
|
@ -72,7 +72,7 @@ typedef void (*CompositeFunc) (CARD8 op,
|
|||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
#define fbComposeGetSolid(pict, bits) { \
|
||||
#define fbComposeGetSolid(pict, bits, fmt) { \
|
||||
FbBits *__bits__; \
|
||||
FbStride __stride__; \
|
||||
int __bpp__; \
|
||||
|
|
@ -93,6 +93,14 @@ typedef void (*CompositeFunc) (CARD8 op,
|
|||
default: \
|
||||
return; \
|
||||
} \
|
||||
/* If necessary, convert RGB <--> BGR. */ \
|
||||
if (PICT_FORMAT_TYPE((pict)->format) != PICT_FORMAT_TYPE(fmt)) \
|
||||
{ \
|
||||
(bits) = (((bits) & 0xff000000) | \
|
||||
(((bits) & 0x00ff0000) >> 16) | \
|
||||
(((bits) & 0x0000ff00) >> 0) | \
|
||||
(((bits) & 0x000000ff) << 16)); \
|
||||
} \
|
||||
/* manage missing src alpha */ \
|
||||
if ((pict)->pFormat->direct.alphaMask == 0) \
|
||||
(bits) |= 0xff000000; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue