diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-27 02:51:33 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-05-27 02:51:33 +0300 |
commit | 3da7a50b71d4ef5919c2d4d5b9547b3ef0abab7d (patch) | |
tree | c51119f79b734a7d503bb3adeac1759b819c8f92 /indra/llrender/llfontgl.cpp | |
parent | 3c215ee885f846f4ab4923c03b51f1b2203394af (diff) | |
parent | cdbd06e8ed6e3f4285a61f5c0b607a65dfdf8dfd (diff) |
Merge branch 'master' into DRTVWR-543-maint
# Conflicts:
# autobuild.xml
# indra/cmake/LLCommon.cmake
# indra/llcommon/CMakeLists.txt
# indra/llrender/llgl.cpp
# indra/newview/llappviewer.cpp
# indra/newview/llface.cpp
# indra/newview/llflexibleobject.cpp
# indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llrender/llfontgl.cpp')
-rw-r--r-- | indra/llrender/llfontgl.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 86a4c35e6d..1bf061bc8d 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -109,8 +109,6 @@ S32 LLFontGL::getNumFaces(const std::string& filename) return mFontFreetype->getNumFaces(filename); } -static LLTrace::BlockTimerStatHandle FTM_RENDER_FONTS("Fonts"); - S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const { @@ -147,7 +145,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRectf& rec S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const { - LL_RECORD_BLOCK_TIME(FTM_RENDER_FONTS); + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; if(!sDisplayFont) //do not display texts { @@ -547,9 +545,19 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars return cur_x / sScaleX; } +void LLFontGL::generateASCIIglyphs() +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI + for (U32 i = 32; (i < 127); i++) + { + mFontFreetype->getGlyphInfo(i); + } +} + // Returns the max number of complete characters from text (up to max_chars) that can be drawn in max_pixels S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars, EWordWrapStyle end_on_word_boundary) const { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI if (!wchars || !wchars[0] || max_chars == 0) { return 0; @@ -829,6 +837,8 @@ void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::st { sFontRegistry->reset(); } + + LLFontGL::loadDefaultFonts(); } // Force standard fonts to get generated up front. @@ -838,6 +848,7 @@ void LLFontGL::initClass(F32 screen_dpi, F32 x_scale, F32 y_scale, const std::st // static bool LLFontGL::loadDefaultFonts() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI bool succ = true; succ &= (NULL != getFontSansSerifSmall()); succ &= (NULL != getFontSansSerif()); @@ -845,10 +856,18 @@ bool LLFontGL::loadDefaultFonts() succ &= (NULL != getFontSansSerifHuge()); succ &= (NULL != getFontSansSerifBold()); succ &= (NULL != getFontMonospace()); - succ &= (NULL != getFontExtChar()); return succ; } +void LLFontGL::loadCommonFonts() +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI + getFont(LLFontDescriptor("SansSerif", "Small", BOLD)); + getFont(LLFontDescriptor("SansSerif", "Large", BOLD)); + getFont(LLFontDescriptor("SansSerif", "Huge", BOLD)); + getFont(LLFontDescriptor("Monospace", "Medium", 0)); +} + // static void LLFontGL::destroyDefaultFonts() { @@ -1015,7 +1034,7 @@ LLFontGL* LLFontGL::getFontSansSerifBig() //static LLFontGL* LLFontGL::getFontSansSerifHuge() { - static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Large",0)); + static LLFontGL* fontp = getFont(LLFontDescriptor("SansSerif","Huge",0)); return fontp; } @@ -1026,12 +1045,6 @@ LLFontGL* LLFontGL::getFontSansSerifBold() return fontp; } -//static -LLFontGL* LLFontGL::getFontExtChar() -{ - return getFontSansSerif(); -} - //static LLFontGL* LLFontGL::getFont(const LLFontDescriptor& desc) { |