Hi, I wish I had time to submit this as a patch but I'm in the middle of a monster project... you know how that goes. Anyway, we noticed that processing updates in the windows viewer was taking, well, a long time. A little profiling led us to the SETPIXELs macros. SetPixel is slow. For example, just profiling SetPixel, it took 5-6 seconds to process a 1280x1024 full update (zlib) on a fast machine with ok video.
The optimization is simple. Treat the buffer as the bits of a DIB and use SetDIBitsToDevice to write to the DC. I've attached two methods, one to setup a BITMAPINFO once the clients pixel format is set and one called FastSetPixels. The only trickiness is that scanlines must be DWORD aligned, no prob for 32 bits, can be a problem in 8 and 16 bits. Our solution was to pre-create a temp buffer to hold 100 scan lines and use that to draw those updates that did not come in aligned in chunks. The result is a significant improvement, 5-6 seconds dropped to <1 second. This code has only been tested in 16/32 bit modes so be warned. Also, this code will not drop straight into the standard viewer code but it is pretty obvious. Anyway, that is all. Hope you like it. Gotta get back to it. Tony Rozga NeoValent [demime 0.99d.1 removed an attachment of type application/octet-stream which had a name of vncopt.cpp] _______________________________________________ VNC-List mailing list [EMAIL PROTECTED] http://www.realvnc.com/mailman/listinfo/vnc-list