summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-08-06 09:21:19 -0400
committerGitHub <noreply@github.com>2024-08-06 16:21:19 +0300
commit75455d101c9535d0d45aa0f505f888f4ba3de64d (patch)
tree3fdef7aedddb1034d986eb5d017e048e4c5b950c /indra/llui
parentdb376f2ace28b199749796520966b6e9884985d6 (diff)
Convert LLUI and LLRender2D to LLSimpleton to reduce overhead during ui draw (#2202)
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfocusmgr.cpp4
-rw-r--r--indra/llui/llui.cpp7
-rw-r--r--indra/llui/llui.h10
3 files changed, 13 insertions, 8 deletions
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 937dde4def..c635d24f51 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -183,7 +183,7 @@ void LLFocusMgr::releaseFocusIfNeeded( LLView* view )
}
}
- LLUI::getInstance()->removePopup(view);
+ if(LLUI::instanceExists()) LLUI::getInstance()->removePopup(view);
}
void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, bool lock, bool keystrokes_only)
@@ -481,7 +481,7 @@ void LLFocusMgr::setAppHasFocus(bool focus)
// release focus from "top ctrl"s, which generally hides them
if (!focus)
{
- LLUI::getInstance()->clearPopups();
+ if(LLUI::instanceExists()) LLUI::getInstance()->clearPopups();
}
mAppHasFocus = focus;
}
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index e3ddd66b58..8d46422c09 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -156,7 +156,7 @@ mWindow(NULL), // set later in startup
mRootView(NULL),
mHelpImpl(NULL)
{
- LLRender2D::initParamSingleton(image_provider);
+ LLRender2D::createInstance(image_provider);
if ((get_ptr_in_map(mSettingGroups, std::string("config")) == NULL) ||
(get_ptr_in_map(mSettingGroups, std::string("floater")) == NULL) ||
@@ -196,6 +196,11 @@ mHelpImpl(NULL)
LLCommandManager::load();
}
+LLUI::~LLUI()
+{
+ LLRender2D::deleteSingleton();
+}
+
void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& remove_popup, const clear_popups_t& clear_popups)
{
mAddPopupFunc = add_popup;
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index f33b43f599..375cd539b7 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -112,18 +112,18 @@ class LLImageProviderInterface;
typedef void (*LLUIAudioCallback)(const LLUUID& uuid);
-class LLUI : public LLParamSingleton<LLUI>
+class LLUI : public LLSimpleton<LLUI>
{
+ LOG_CLASS(LLUI);
public:
typedef std::map<std::string, LLControlGroup*, std::less<> > settings_map_t;
-private:
- LLSINGLETON(LLUI , const settings_map_t &settings,
+ LLUI(const settings_map_t &settings,
LLImageProviderInterface* image_provider,
LLUIAudioCallback audio_callback,
LLUIAudioCallback deferred_audio_callback);
- LOG_CLASS(LLUI);
-public:
+ ~LLUI();
+
//
// Classes
//