From c61d0f42973f1d58e4e6b5b8a4e0911ed0602bb7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 10 Aug 2019 15:31:03 +0300 Subject: DRTVWR-493 LLUI to LLParamSingleton --- indra/newview/llviewerdisplay.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'indra/newview/llviewerdisplay.cpp') diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 64f6123f5d..48eed20861 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1507,9 +1507,10 @@ void render_ui_2d() if (gSavedSettings.getBOOL("RenderUIBuffer")) { - if (LLUI::sDirty) + LLUI* ui_inst = LLUI::getInstance(); + if (LLUI::getInstance()->mDirty) { - LLUI::sDirty = FALSE; + LLUI::getInstance()->mDirty = FALSE; LLRect t_rect; gPipeline.mUIScreen.bindTarget(); @@ -1517,25 +1518,25 @@ void render_ui_2d() { static const S32 pad = 8; - LLUI::sDirtyRect.mLeft -= pad; - LLUI::sDirtyRect.mRight += pad; - LLUI::sDirtyRect.mBottom -= pad; - LLUI::sDirtyRect.mTop += pad; + ui_inst->mDirtyRect.mLeft -= pad; + ui_inst->mDirtyRect.mRight += pad; + ui_inst->mDirtyRect.mBottom -= pad; + ui_inst->mDirtyRect.mTop += pad; LLGLEnable scissor(GL_SCISSOR_TEST); - static LLRect last_rect = LLUI::sDirtyRect; + static LLRect last_rect = ui_inst->mDirtyRect; //union with last rect to avoid mouse poop - last_rect.unionWith(LLUI::sDirtyRect); + last_rect.unionWith(ui_inst->mDirtyRect); - t_rect = LLUI::sDirtyRect; - LLUI::sDirtyRect = last_rect; + t_rect = ui_inst->mDirtyRect; + ui_inst->mDirtyRect = last_rect; last_rect = t_rect; - last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / LLUI::getScaleFactor().mV[0]); - last_rect.mRight = LLRect::tCoordType(last_rect.mRight / LLUI::getScaleFactor().mV[0]); - last_rect.mTop = LLRect::tCoordType(last_rect.mTop / LLUI::getScaleFactor().mV[1]); - last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / LLUI::getScaleFactor().mV[1]); + last_rect.mLeft = LLRect::tCoordType(last_rect.mLeft / ui_inst->getScaleFactor().mV[0]); + last_rect.mRight = LLRect::tCoordType(last_rect.mRight / ui_inst->getScaleFactor().mV[0]); + last_rect.mTop = LLRect::tCoordType(last_rect.mTop / ui_inst->getScaleFactor().mV[1]); + last_rect.mBottom = LLRect::tCoordType(last_rect.mBottom / ui_inst->getScaleFactor().mV[1]); LLRect clip_rect(last_rect); @@ -1547,7 +1548,7 @@ void render_ui_2d() gPipeline.mUIScreen.flush(); gGL.setColorMask(true, false); - LLUI::sDirtyRect = t_rect; + ui_inst->mDirtyRect = t_rect; } LLGLDisable cull(GL_CULL_FACE); -- cgit v1.2.3 From 1be08814e252654db98ce8c39dc8b4cf89c2e1dc Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sun, 11 Aug 2019 12:50:24 +0300 Subject: DRTVWR-493 tiny optimization --- indra/newview/llviewerdisplay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerdisplay.cpp') diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 48eed20861..e1409d31ce 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1508,9 +1508,9 @@ void render_ui_2d() if (gSavedSettings.getBOOL("RenderUIBuffer")) { LLUI* ui_inst = LLUI::getInstance(); - if (LLUI::getInstance()->mDirty) + if (ui_inst->mDirty) { - LLUI::getInstance()->mDirty = FALSE; + ui_inst->mDirty = FALSE; LLRect t_rect; gPipeline.mUIScreen.bindTarget(); -- cgit v1.2.3