Hi Dmitri, > First of all, did you determine (by profiling and > such) that it is expensive or is this your gut feeling? It is > important to work with correct data, and sometimes our > assumptions about performance implications may be > incorrect (I get this stuff wrong all the time).
I have not officially profiled it but it is visibly slower than I would like. > Anyway, assuming that it is super-expensive to > repaint the whole thing, you can construct a clip shape > (which would be your bg rectangle minus your small > rectangles) and set it on the graphics context. > That way the area of the bg rectangle which isn't > covered by smaller rectangles only will be > repainted. > Shape clip may be an expensive operation, though > (depending on the pipeline), so I would still > suggest to profile (or just time) both > approaches. Yes, but how do I remove areas from a clip region? I can only see how to set a clip region to a Shape and the area around the smaller rectangles is not a Shape. -- And loving it, -Q _________________________________________________ [EMAIL PROTECTED] (Replace the "SixFour" with numbers to email me) [Message sent by forum member 'qu0ll' (qu0ll)] http://forums.java.net/jive/thread.jspa?messageID=246621 =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".