[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: GetXImage doesn't seems to set the [red|green|blue]_mask
From:       James Abbatiello <abbeyj () WPI ! EDU>
Date:       2000-03-30 22:29:27
[Download RAW message or body]

Uwe Bonnes wrote:
> 
> Hallo,
> 
> I run X 3.4 with 16 Bits  on a MGA 200 bit 16 bit resolution.
> E.g running acroread3 results in a lot of FIXME's :
> fixme:bitmap:X11DRV_DIB_GetImageBits_4 from 16 bit bitmap with \
>         mask R,G,B 0,0,0 to 4 bit DIB
> and the task bar has all black bitmask for the bitmaps.
> 
> For me it seems as if on my Setup XGetImage doen't return the
> [red|green|blue]_mask values. Setting the mask from the visual in the
> case they where zero does bring up task bar icons.

This was discussed on wine-devel recently (see thread "XGetImage vs
XCreateImage").  According to the discussion in that thread, XGetImage
is not supposed to set the masks.  The proposed solution was to use
XCreateImage followed by XGetSubImage which would set the masks
correctly.  A patch was proposed for this, but it seems to have been
forgotten.

I'm not familiar enough with X to say for sure what the best solution is
here.  Looking at the code, X11DRV_BITMAP_GetXImage is called from two
places, X11DRV_GetBitmapBits and X11DRV_DIB_GetDIBits.  In
X11DRV_GetBitmapBits, the image is later passed to XDestroyImage.  In
X11DRV_DIB_GetDIBits, this doesn't seem to be the case; I'm not sure if
its leaking there or not.  The real issue is whether or not the code in
X11DRV_GetBitmapBits requires X11DRV_BITMAP_GetXImage to set the masks
or not.  If it doesn't then perhaps X11DRV_BITMAP_GetXImage is already
doing the right thing and it just shouldn't be called from the
X11DRV_DIB_GetDIBits code.  I noticed that the result of
X11DRV_BITMAP_GetXImage in X11DRV_DIB_GetDIBits is passed to
X11DRV_DIB_GetImageBits.  And that function will do an
XCreateImage/XGetSubImage (getting the masks) if not supplied with an
image (and then clean up after itself before returning).  So I just
patched my local copy of the source to do

descr.image = NULL;

instead of the original

descr.image = (XImage *)CALL_LARGE_STACK( X11DRV_BITMAP_GetXImage, bmp
);

which seems to work.  Of course, like I said, I'm no X expert, so I'm
not sure if this is right.  If the real solution is to change
X11DRV_BITMAP_GetXImage, perhaps the code could be borrowed from the top
of X11DRV_DIB_GetImageBits, and that function could call then
X11DRV_BITMAP_GetXImage.

BTW, I've got the same video card.  Perhaps this problem doesn't show up
for everyone else, which could explain why its been around so long...

-- 
James Abbatiello

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic