Re: [JAVA2D] Caching Colors

2002-12-02 Thread Jim Graham
In normal usage the private paintContext field of the Color object should never be used. The graphics code treats colors specially and simply fills the rectangles with the appropriate color rather than invoking its PaintContext object. But, if anyone ever calls the createContext() method of a

[JAVA2D] Caching Colors

2002-11-28 Thread Jan Bösenberg (INCORS GmbH)
Browsing throught the source of the awt classes I had the idea that it might be useful to cache colors, or at least instances of ColorPaintContext, in order to reduce memory consumption. Colors are immutable, therefore there should be no problem with concurrent usage of objects. Currently