This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Re: Icons
Joe Krahn wrote:
Joe Krahn wrote:
One thing I found is that some Bitmap data are 16-bit aligned and some
are 32-bit aligned. This is probably the source of horizontal line
patterns, which I suspect occur for any not-divisible-by-32 size.
A test: if 16 versus 32 bit alignment is the problem, then icons 33-48
bits wide should be broken, but 49-64 should work. Does someone have
some X client code handy to test this idea? If so, can you test both NET
icons, and traditional Pixmap icons?
Joe
Wow... I see that 4 of 7 Active Contributors are working on icon
support. I guess it's time to really get icon handling done right.
The alignments are definitely wrong. 32-bit alignment is for DIBs. Other
Win32 bitmaps are 16 bit aligned. But, 32-bit may work sometimes by
chance. I don't have problem icons, so someone else should test this:
In winmultiwindowicons.c, change these (first line occurs twice):
stride = ((iconSize * effBPP + 31) & (~31)) / 8;
...
maskStride = ((iconSize * 1 + 31) & (~31)) / 8;
to:
stride = ((iconSize * effBPP + 15) & (~15)) / 4;
...
maskStride = ((iconSize * 1 + 15) & (~15)) / 4;
I also prefer ">> 2" instead if "/ 4", but optimization should convert
it to a shift anyhow.
I also noticed that winScaleXBitmapToWindows() seems to totally
disregard mapping the pixel data to RGB. I assume this means that the
device-dependent X Pixmaps have an identical data format as
device-dependent Win32 bitmaps. However, image scaling is by
nearest-neighbor only, and it does not handle monochrome bitmaps or
NET_WM icons.
Also, there is too much duplicated but inconsistent stuff among the
window-manager modes. I think the right thing to do is to extract all
icons functions into one place. It would be good to consolidate some
other things as well, like some of the Window functions.
Joe
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/