On Sun, Jul 20, 2003 at 02:24:37AM -0700, Bill Kendrick wrote:
> 
> The problem seems mostly due to XOR line drawing, which does a read and write
> of every pixel it draws, which is slow.

Strike that...  I decided the code was getting too ugly to wrap my head
around, and came up with an elegant, 10-or-so line long solution that
seems to work.

(Tested with "ssh -X" from a Pentium 133 to Celeron 300 (@ 450Mhz);
both machines with 100baseT NICs, going through a 100Mb hub)


Since the XOR'ing code was called in response to motion events, this mean
that if you made motion while it was busy drawing, it would REMAIN within
the event loop, spinning and spinning, trying futily to catch up.

This caused the 'wobble'... even running locally on my Celeron, a large
square shape would take a moment to 'catch up' to where the mouse had been...
finally resting where the mouse is.


My solution is to keep note of the time within the event loop.
If the event loop has been running, without exiting, for more than 250ms,
I set a little flag that says "just ignore motion events."



Without the code, drawing a shape over the "ssh -X" described above was
unbearable.  Now, it's just annoyingly slow... but it's _usable_.


Check it out in CVS!


Thanks all!

-bill!

-- 
[EMAIL PROTECTED]                           Got kids?  Get Tux Paint! 
http://newbreedsoftware.com/bill/       http://newbreedsoftware.com/tuxpaint/
_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to