summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-08-04 19:01:28 -0700
committerRichard Nelson <none@none>2010-08-04 19:01:28 -0700
commit932f248553328c2c8d4a2fde9f7c5859c1965024 (patch)
tree70ef6d94d77f1f88b2a4719b1199493dae0e0aa6
parent5062351a0a2a95c3cbca27297b57afddc23d7a4f (diff)
optimized font lookups
-rw-r--r--indra/llrender/llfontgl.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index d6c062fc5e..849318ccee 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -983,37 +983,43 @@ LLFontGL::VAlign LLFontGL::vAlignFromName(const std::string& name)
//static
LLFontGL* LLFontGL::getFontMonospace()
{
- return getFont(LLFontDescriptor("Monospace","Monospace",0));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("Monospace","Monospace",0));
+ return fontp;
}
//static
LLFontGL* LLFontGL::getFontSansSerifSmall()
{
- return getFont(LLFontDescriptor("SansSerif","Small",0));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Small",0));
+ return fontp;
}
//static
LLFontGL* LLFontGL::getFontSansSerif()
{
- return getFont(LLFontDescriptor("SansSerif","Medium",0));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Medium",0));
+ return fontp;
}
//static
LLFontGL* LLFontGL::getFontSansSerifBig()
{
- return getFont(LLFontDescriptor("SansSerif","Large",0));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0));
+ return fontp;
}
//static
LLFontGL* LLFontGL::getFontSansSerifHuge()
{
- return getFont(LLFontDescriptor("SansSerif","Huge",0));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0));
+ return fontp;
}
//static
LLFontGL* LLFontGL::getFontSansSerifBold()
{
- return getFont(LLFontDescriptor("SansSerif","Medium",BOLD));
+ static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Medium",BOLD));
+ return fontp;
}
//static