optimize GC performance while creating keys for the BitmapText cache
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8459 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
f50266590d
commit
a824f45efb
@ -195,13 +195,14 @@ public class RenderDeviceJme implements RenderDevice {
|
||||
|
||||
RenderFontJme jmeFont = (RenderFontJme) font;
|
||||
|
||||
BitmapText text = textCacheLastFrame.get(font+str+color);
|
||||
String key = font+str+color.getColorString();
|
||||
BitmapText text = textCacheLastFrame.get(key);
|
||||
if (text == null) {
|
||||
text = jmeFont.createText();
|
||||
text.setText(str);
|
||||
text.updateLogicalState(0);
|
||||
}
|
||||
textCacheCurrentFrame.put(font+str+color, text);
|
||||
textCacheCurrentFrame.put(key, text);
|
||||
|
||||
niftyMat.setColor("Color", convertColor(color, tempColor));
|
||||
niftyMat.setBoolean("UseTex", true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user