[OpenJDK 2D-Dev] One or many GraphicsConfiguration(s) per toplevel?

Dmitri Trembovetski Dmitri.Trembovetski at Sun.COM
Wed Jan 21 17:43:31 UTC 2009

Anthony Petrov wrote:
> Hello 2D and AWT teams,
> While working on the fix for 6783411 to enable re-parenting heavyweight 
> components between toplevel windows, I found the Component.checkGD() 
> method which verifies equality of GraphicsDevice's (by the way, a minor 
> question: is it correct to check the equality of the GD (or GC) objects 
> themselves rather than using their StringID's?). There's also an

   Yes, it is better to check the instances. The GC is re-created
   on every display change, GDs may be added/removed as well
   (depending on what kind of event happend).

> implementation of this method in the Container class that recursively 
> calls this method for every child of the container.
> The question is: is it really possible for one toplevel to contain 
> components having different GraphicsDevice's (and/or different 
> GraphicsConfiguration's)? Or may I assume that all and every descendant 
> components of a toplevel window use the same GC that the window uses 
> (and therefore the Container.checkGD() may safely be removed)?

   We should enforce that all components within a toplevel have the
   same GC. If checkGD does that I wouldn't remove it.


More information about the 2d-dev mailing list