diff options
author | Rye Mutt <rye@alchemyviewer.org> | 2024-08-06 09:21:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 16:21:19 +0300 |
commit | 75455d101c9535d0d45aa0f505f888f4ba3de64d (patch) | |
tree | 3fdef7aedddb1034d986eb5d017e048e4c5b950c /indra/llrender | |
parent | db376f2ace28b199749796520966b6e9884985d6 (diff) |
Convert LLUI and LLRender2D to LLSimpleton to reduce overhead during ui draw (#2202)
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llrender2dutils.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llrender2dutils.h | 7 | ||||
-rw-r--r-- | indra/llrender/lluiimage.cpp | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 176c7a5d2c..428370057e 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -726,7 +726,7 @@ void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& c } 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) diff --git a/indra/llrender/llrender2dutils.h b/indra/llrender/llrender2dutils.h index 0d3efc38d6..096e7584f1 100644 --- a/indra/llrender/llrender2dutils.h +++ b/indra/llrender/llrender2dutils.h @@ -122,12 +122,13 @@ inline void gl_rect_2d_offset_local( const LLRect& rect, S32 pixel_offset, bool class LLImageProviderInterface; -class LLRender2D : public LLParamSingleton<LLRender2D> +class LLRender2D : public LLSimpleton<LLRender2D> { - LLSINGLETON(LLRender2D, LLImageProviderInterface* image_provider); LOG_CLASS(LLRender2D); - ~LLRender2D(); public: + LLRender2D(LLImageProviderInterface* image_provider); + ~LLRender2D(); + static void pushMatrix(); static void popMatrix(); static void loadIdentity(); diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp index d31a91e2af..dc18bf16bf 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 + ((F32)rect.mLeft * x_axis) + ((F32)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 (F32)rect.getWidth() * x_axis, (F32)rect.getHeight() * y_axis); - } LLRender2D::getInstance()->popMatrix(); + } LLRender2D::popMatrix(); } //#include "lluiimage.inl" |