[JAVA2D] Swing/AWT Union of Bounds
I'm writing a 2D graphics application and have run into a problem where my
dirty bounds are getting unioned together to form one larger dirty
bounds. Normally this is a pretty good idea to do, but it's causing
graphics artifacts because its causing half an image to be redrawn even
though it is not really dirty. Again normally this would be okay, but
because the scene is animating when this occurs, it renders the "dirty"
part of the image using the low quality renderer. This causes an obvious
eye soar in the image until the animation ends and the entire screen is
I'm now managing my own dirty rectangles, however when the sun.awt
RepaintArea class method "paint" is envoked, once again my dirty
rectangles get combined into one larger dirty rect. I've done some tests
and I absolutely have to paint this entire dirty rect or double buffering
causes problems in the area that isn't actually dirty (random data gets
copied from the back buffer since I didn't draw to it). Disabling double
buffering isn't an option because then you get all the wonderful graphics
problems associated with that.
I don't see any other way around my problem other than to avoid unioning
the dirty bounds in the first place and to do that I need to somehow over
ride the sun.awt RepaintArea.paint() method. Is this possible in some
indirect way? I certainly don't see how to do it directly.
Thanks in advance,
To unsubscribe, send email to email@example.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
firstname.lastname@example.org and include in the body of the message "help".