Alan Hourihane and I have been working a little bit on the NativeGDI "-engine 16" X Server in Cygwin/XFree86. The current CVS builds are completely runable: user input works, drawing graphics works mostly (xterm, twm, with just a few screwups), and most notable the server no longer crashes on startup. However, lots of things don't work: we don't handle redrawing covered-then-exposed regions of our Window, so you have to keep the Cygwin/XFree86 window in focus unless you want the window to clear, opaque stipple-fills don't work yet so the title bar on windows under twm don't have the hatched pattern, and the performance is not something to brag about. That said, we are progressing well on our plan, which goes a little something like the following: 1) Implement winFillSpans, winGetSpans, and winSetSpans. These just draw lines and all graphics functions can be reduced to spans operations. 2) Implement other graphics functions directly. We haven't even begun to start this yet. We have to make a few corrections to the spans routines first. Performance sucks right now because *every* graphics operation must be reduced to a series of line operations. However, we have to have a perfect set of spans routines because there are some X graphics functions that cannot be simply translated into GDI graphics functions. Thus, some X graphics functions will always rely on spans functions. There is one problem that I had not anticipated, but that Alan Hourihane pointed out. It turns out that GDI DIB's (Device Independent Bitmap) use a different byte-order for 1 bit and 4 bit DIBs than they do for 8 bit, 16 bit, 24 bit, and 32 bit DIBs. Alan flipped the BITMAP_BIT_ORDER flag to MSBFirst from the default LSBFirst in xc/programs/Xserver/include/servermd.h. The problem here is that most programs just look at IMAGE_BYTE_ORDER or BITMAP_BYTE_ORDER and assume that they are equal. For now we have them set to different values, which means that some programs will assume bitmaps and pixmaps are LSBFirst while others will assume that they are MSBFirst. The ultimate solution here is to do byte-map order translation for 1 bit and 4 bit DIBs when we do certain operations with them. However, we have yet to identify exactly when to do the translations. Alan and I have been pretty busy with other things lately, so this task has gone unattended for several weeks. Well, I guess that's all for now. I just figured that some people might be interested in what is going on... and *sigh* possibly helping out. If you have some spare time, throw an eye at: http://sourceforge.net/projects/xoncygwin We've been using that site as a temporary CVS tree for the NativeGDI development. We'll be merging things back into XFree86 when we have something more complete. We have to fix the BITMAP_BIT_ORDER flag before we can merge into XFree86, as none of the other engines draw correctly when BITMAP_BIT_ORDER is set to MSBFirst. Regards, Harold
