From: <cl...@us...> - 2008-04-23 13:59:55
|
Revision: 2884 http://vexi.svn.sourceforge.net/vexi/?rev=2884&view=rev Author: clrg Date: 2008-04-23 06:59:47 -0700 (Wed, 23 Apr 2008) Log Message: ----------- Only use WeakHashMap when caching Fonts (was using a WeakHashmap/Basket.Map combination) Modified Paths: -------------- trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java Modified: trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java 2008-04-22 23:14:33 UTC (rev 2883) +++ trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java 2008-04-23 13:59:47 UTC (rev 2884) @@ -62,10 +62,10 @@ //static final Queue glyphsToBeDisplayed = new LinkedList(); private static WeakHashMap fonts = new WeakHashMap(); public static Font getFont(JS stream, int pointsize) { - Basket.Map m = (Basket.Map)fonts.get(stream); + WeakHashMap m = (WeakHashMap)fonts.get(stream); Font ret = null; if (m != null) ret = (Font)m.get(new Integer(pointsize)); - else fonts.put(stream, m = new Basket.Hash()); + else fonts.put(stream, m = new WeakHashMap()); if (ret == null) m.put(new Integer(pointsize), ret = new Font(stream, pointsize)); return ret; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |