This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

DirectDraw vs. GDI Device Independent Bitmaps for shadow fb server (and other development news)


Well, the preliminary results are in, and it looks like DirectDraw sucks
compared to GDI DIBs when running a shadow fb based server.  I've gone on a
coding marathon for the last 14 hours, during which time I implemented a
DirectDraw based shadow fb server that can be swapped at runtime with the
GDI based shadow fb server.

Performance comparison:

When dragging an X window (such as an xterm) in the DD server it feels very
sluggish and you can actually see the server redrawing things.

When dragging an X window in the GDI DIB server the window redraws almost
instantaneously and the server feels very snappy.

Performance is so varied between DirectDraw and GDI DIB for shadow fb
servers because DirectDraw requires that you unlock, or throw away your
memory pointer, to the shadow framebuffer before you transfer (blit) the
shadow framebuffer to the screen.  After a series of blits you must
reacquire a pointer to the shadow framebuffer bits so that the 'fb' code can
continue painting the screen.  However, with GDI DIBs you do not have to
throw away your memory pointer when you blit the shadow fb to the screen,
resulting in a much more responsive server.

I didn't really expect DirectDraw to be faster for the shadow framebuffer
server, but I was kinda surprised at how much slower it turned out to be.

Not to fear though, as the DirectDraw coding I did will translate almost
directly to the next feature for the server: on Windows NT/2000 we will use
DirectDraw to write directly to the primary framebuffer, as the current
stable release does.  The test server will detect your version of Windows at
startup, then it will use GDI DIBs with a shadow fb for Widnows 95/98/Me (as
the current test server does), while it will use a DirectDraw primary
framebuffer for Windows NT/2000.  The resulting server will run on all
versions of Windows and will deliver the maximum performance that a
particular version of Windows is capable of.

As a side note, I will keep the DirectDraw shadow fb code in the server and
I will add a command line option to force the server to use the DirectDraw
shadow fb code.  That will allow people to experiment for themselves;
perhaps we'll get some different results on different video cards and
processors.

That's all for now, I'll release the code for said server tomorrow,

Harold Hunt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]