Oldřich Jedlička
2005-11-03 17:01:09 UTC
Hi,
I found a problem in translating XImage into DIB created by CreateDIBSection.
All problems are in graphics/x11drv/dib.c only.
1. When update XImage->DIB (monochrome images) is made, function
X11DRV_DIB_GetImageBits_1 falls back into "notsupported" branch. The palette
of the DIB was ignored in this case. If the colors are inverted, also image
is inverted for updating DIB. Update DIB->XImage is not affected as it uses
palette.
2. Used XImage (bmpImage parameter) has RGB mask corresponding to current
visual, so it is not zero. The RGB mask was checked for zero when copying
BMP->DIB, so new static inline function X11DRV_DIB_CheckMask has been
created.
3. Parameter colorMap was set to identity color map for every monochrome
bitmap. Changed to check if colorMap is NULL or has the same colors.
ChangeLog:
Oldrich Jedlicka <***@seznam.cz>
* Check for inverted colors in "notsupported" branch of
X11DRV_DIB_GetImageBits_1
* Check for non-zero RGB mask corresponding to current visual
* Fix for setting identity colorMap for every monochrome bitmap
I found a problem in translating XImage into DIB created by CreateDIBSection.
All problems are in graphics/x11drv/dib.c only.
1. When update XImage->DIB (monochrome images) is made, function
X11DRV_DIB_GetImageBits_1 falls back into "notsupported" branch. The palette
of the DIB was ignored in this case. If the colors are inverted, also image
is inverted for updating DIB. Update DIB->XImage is not affected as it uses
palette.
2. Used XImage (bmpImage parameter) has RGB mask corresponding to current
visual, so it is not zero. The RGB mask was checked for zero when copying
BMP->DIB, so new static inline function X11DRV_DIB_CheckMask has been
created.
3. Parameter colorMap was set to identity color map for every monochrome
bitmap. Changed to check if colorMap is NULL or has the same colors.
ChangeLog:
Oldrich Jedlicka <***@seznam.cz>
* Check for inverted colors in "notsupported" branch of
X11DRV_DIB_GetImageBits_1
* Check for non-zero RGB mask corresponding to current visual
* Fix for setting identity colorMap for every monochrome bitmap