From 932f248553328c2c8d4a2fde9f7c5859c1965024 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 4 Aug 2010 19:01:28 -0700 Subject: optimized font lookups --- indra/llrender/llfontgl.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/llrender') 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 -- cgit v1.2.3