-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I find large puzzles (e.g. hypermegaminx) to be not very usable
when antialias-when-still (the "Allow Antialiasing" checkbox) is enabled:
the antialiased view takes 2 seconds to render, and it's on the swing event/interaction thread, which means lots of 2-second pauses during which both the ui and the view/controller mouse interaction are locked up.
It's not as bad as it was before Melinda's fix for issue #136, but it still seems like a significant usability obstacle to me. Melinda doesn't experience this as as significant a problem as I do.
It seems to me that these frequent 2-second lockups violate swing's ethic "Time-consuming tasks should not be run on the Event Dispatch Thread (EDT). Otherwise the application becomes unresponsive.".
Here's an idea for fixing that: never do the antialiased render directly to the view component in paint() or paintComponent() (both of which happen on the swing EDT). The high-quality antialiased picture is pure gravy in any case, right? So, when we want that expensive pretty picture (i.e. when the picture becomes "still"), then tell a worker thread to make the picture, into an offscreen Buffer object. If that worker thread completes the pretty picture before the user starts interacting again, then great, render it. Otherwise throw it away. So then neither the ui, nor any interaction in the view/controller window, nor newly initiated animations, will be delayed at all by these expensive renders.