summaryrefslogtreecommitdiff
path: root/indra/newview/llhudrender.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-08-28 23:05:58 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-09-04 10:16:46 +0300
commit4ae1de1f8a78d795958d67afab8356f9a13f707d (patch)
treeea0fe05983562f061a4748a6f4af7253018f9660 /indra/newview/llhudrender.cpp
parent36423bd6603c5708028c6e8e9705587b961a4bb2 (diff)
viewer#2411 LLFontGL::render optimizations
Diffstat (limited to 'indra/newview/llhudrender.cpp')
-rw-r--r--indra/newview/llhudrender.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp
index 5608ab763f..f027aa5552 100644
--- a/indra/newview/llhudrender.cpp
+++ b/indra/newview/llhudrender.cpp
@@ -39,6 +39,7 @@
#include "llui.h"
void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent,
+ LLFontVertexBuffer *font_buffer,
const LLFontGL &font,
const U8 style,
const LLFontGL::ShadowType shadow,
@@ -47,10 +48,11 @@ void hud_render_utf8text(const std::string &str, const LLVector3 &pos_agent,
const bool orthographic)
{
LLWString wstr(utf8str_to_wstring(str));
- hud_render_text(wstr, pos_agent, font, style, shadow, x_offset, y_offset, color, orthographic);
+ hud_render_text(wstr, pos_agent, font_buffer, font, style, shadow, x_offset, y_offset, color, orthographic);
}
void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
+ LLFontVertexBuffer *font_buffer,
const LLFontGL &font,
const U8 style,
const LLFontGL::ShadowType shadow,
@@ -138,7 +140,14 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f));
F32 right_x;
- font.render(wstr, 0, 0, 1, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, static_cast<S32>(wstr.length()), 1000, &right_x, /*use_ellipses*/false, /*use_color*/true);
+ if (font_buffer)
+ {
+ font_buffer->render(&font, wstr, 0, 0, 1, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, static_cast<S32>(wstr.length()), 1000, &right_x, /*use_ellipses*/false, /*use_color*/true);
+ }
+ else
+ {
+ font.render(wstr, 0, 0, 1, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, static_cast<S32>(wstr.length()), 1000, &right_x, /*use_ellipses*/false, /*use_color*/true);
+ }
LLUI::popMatrix();
gGL.popMatrix();