From d28d99e23db76b8bb36e817f7973b6bb438b4a1c Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 26 Sep 2020 02:16:06 -0400 Subject: [PATCH] More performance work for LLUI --- indra/llrender/llrender2dutils.cpp | 4 ++-- indra/llrender/lluiimage.cpp | 6 +++--- indra/llui/llconsole.cpp | 6 +++--- indra/llui/llconsole.h | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 98b7f485cdf..5eaeea5659e 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -798,7 +798,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL } gGL.end(); - LLRender2D::getInstance()->setLineWidth(1.f); + LLRender2D::setLineWidth(1.f); } void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F32 start_angle, F32 end_angle) @@ -965,7 +965,7 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha) } else { //polygon stipple is deprecated, use "Checker" texture - LLPointer<LLUIImage> img = LLRender2D::getInstance()->getUIImage("Checker"); + LLUIImagePtr img = LLRender2D::getInstance()->getUIImage("Checker"); gGL.getTexUnit(0)->bind(img->getImage()); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index 424672fe8ec..db6b1c0c7bb 100644 --- a/indra/llrender/lluiimage.cpp +++ b/indra/llrender/lluiimage.cpp @@ -81,10 +81,10 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c } } - LLRender2D::getInstance()->pushMatrix(); + LLRender2D::pushMatrix(); { LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis); - LLRender2D::getInstance()->translate(rect_origin.mV[VX], + LLRender2D::translate(rect_origin.mV[VX], rect_origin.mV[VY], rect_origin.mV[VZ]); gGL.getTexUnit(0)->bind(getImage()); @@ -103,7 +103,7 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c rect.getWidth() * x_axis, rect.getHeight() * y_axis); - } LLRender2D::getInstance()->popMatrix(); + } LLRender2D::popMatrix(); } //#include "lluiimage.inl" diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 53a25ac4a55..2d8abd8fedc 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -69,6 +69,8 @@ LLConsole::LLConsole(const LLConsole::Params& p) } mFadeTime = mLinePersistTime - FADE_DURATION; setMaxLines(LLUI::getInstance()->mSettingGroups["config"]->getS32("ConsoleMaxLines")); + + mBackgroundImagep = LLUI::getUIImage("transparent"); } void LLConsole::setLinePersistTime(F32 seconds) @@ -178,8 +180,6 @@ void LLConsole::draw() // draw remaining lines F32 y_pos = 0.f; - LLUIImagePtr imagep = LLUI::getUIImage("transparent"); - static LLUICachedControl<F32> console_bg_opacity("ConsoleBackgroundOpacity", 0.7f); F32 console_opacity = llclamp(console_bg_opacity(), 0.f, 1.f); @@ -196,7 +196,7 @@ void LLConsole::draw() S32 target_width = llfloor( (*paragraph_it).mMaxWidth + padding_horizontal); y_pos += ((*paragraph_it).mLines.size()) * line_height; - imagep->drawSolid(-14, (S32)(y_pos + line_height - target_height), target_width, target_height, color); + mBackgroundImagep->drawSolid(-14, (S32)(y_pos + line_height - target_height), target_width, target_height, color); F32 y_off=0; diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h index 04f5e716099..bc0e765cb2a 100644 --- a/indra/llui/llconsole.h +++ b/indra/llui/llconsole.h @@ -143,6 +143,7 @@ class LLConsole : public LLFixedBuffer, public LLUICtrl, public LLInstanceTracke private: void update(); + LLUIImagePtr mBackgroundImagep; F32 mLinePersistTime; // Age at which to stop drawing. F32 mFadeTime; // Age at which to start fading const LLFontGL* mFont; -- GitLab