diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 098621b543c780e974d90c2ee986376273716bee..04485c62623c1b70c552b4d0274a7d5ecd824aaa 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -1006,7 +1006,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child)
 		LLRect screen_rect;
 		localRectToScreen(child->getRect(),&screen_rect);
 		
-		if ( root_rect.overlaps(screen_rect)  && LLUI::getInstance()->mDirtyRect.overlaps(screen_rect))
+		if ( root_rect.overlaps(screen_rect)  && sDirtyRect.overlaps(screen_rect))
 		{
 			gGL.matrixMode(LLRender::MM_MODELVIEW);
 			LLUI::pushMatrix();
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index 636d5a265a1ba1723a670d762cf53cc4cad2588b..53a25ac4a55eba4e8fb41a4e71c3e8587ac866a9 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -180,8 +180,8 @@ void LLConsole::draw()
 
 	LLUIImagePtr imagep = LLUI::getUIImage("transparent");
 
-	static LLUICachedControl<F32> console_background_opacity("ConsoleBackgroundOpacity", 0.7f);
-	F32 console_opacity = llclamp(console_background_opacity(), 0.f, 1.f);
+	static LLUICachedControl<F32> console_bg_opacity("ConsoleBackgroundOpacity", 0.7f);
+	F32 console_opacity = llclamp(console_bg_opacity(), 0.f, 1.f);
 
 	static const LLUIColor color_background = LLUIColorTable::instance().getColor("ConsoleBackground");
 	auto color = color_background.get();
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index bdf8941ec760cddd55c119c48d1af73353760e29..6c139b89b435e80b719894d183dbcd9f6e9b0d29 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -335,9 +335,9 @@ static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
 void LLFolderView::filter( LLFolderViewFilter& filter )
 {
 	LL_RECORD_BLOCK_TIME(FTM_FILTER);
-	static const LLUICachedControl<S32> time_visible("FilterItemsMaxTimePerFrameVisible", 10);
-	static const LLUICachedControl<S32> time_invisible("FilterItemsMaxTimePerFrameUnvisible", 1);
-    filter.resetTime(llclamp((S32)(mParentPanel.get()->getVisible() ? time_visible : time_invisible), 1, 100));
+	static LLUICachedControl<S32> time_visible("FilterItemsMaxTimePerFrameVisible", 10);
+	static LLUICachedControl<S32> time_invisible("FilterItemsMaxTimePerFrameUnvisible", 1);
+    filter.resetTime(llclamp((mParentPanel.get()->getVisible() ? time_visible() : time_invisible()), 1, 100));
 
     // Note: we filter the model, not the view
 	getViewModelItem()->filter(filter);
diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp
index 21002a1a2c885856aeedefc6ca935e6869603a63..fbb6c7aa385fbd452181fc8cd1af0ddb4a27a5af 100644
--- a/indra/llui/llfolderviewmodel.cpp
+++ b/indra/llui/llfolderviewmodel.cpp
@@ -48,7 +48,7 @@ std::string LLFolderViewModelCommon::getStatusText()
 
 void LLFolderViewModelCommon::filter()
 {
-    static const LLUICachedControl<S32> max_time("FilterItemsMaxTimePerFrameVisible", 10);
+    static LLUICachedControl<S32> max_time("FilterItemsMaxTimePerFrameVisible", 10);
     getFilter().resetTime(llclamp(max_time(), 1, 100));
     mFolderView->getViewModelItem()->filter(getFilter());
 }
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 02b60c08e17fa47cf2c7f7134005dfee8889ec08..db1247c7a2b2acda59584002d3829bc096a3d8a3 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -364,7 +364,7 @@ void LLToolTip::draw()
 	if (mFadeTimer.getStarted())
 	{
 		static LLUICachedControl<F32> tool_tip_fade_time("ToolTipFadeTime", 1.f);
-		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time, 1.f, 0.f);
+		alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time(), 1.f, 0.f);
 		if (alpha == 0.f)
 		{
 			// finished fading out, so hide ourselves
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 39b43aee4f2075fa23e20bb480e87a8eec0e6eeb..c0e438e988939db966f1276b174f8ffdd87496ac 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -154,7 +154,6 @@ mAudioCallback(audio_callback),
 mDeferredAudioCallback(deferred_audio_callback),
 mWindow(NULL), // set later in startup
 mRootView(NULL),
-mDirty(FALSE),
 mHelpImpl(NULL)
 {
 	LLRender2D::initParamSingleton(image_provider);
@@ -206,19 +205,6 @@ void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& rem
 	mClearPopupsFunc = clear_popups;
 }
 
-void LLUI::dirtyRect(LLRect rect)
-{
-	if (!mDirty)
-	{
-		mDirtyRect = rect;
-		mDirty = TRUE;
-	}
-	else
-	{
-		mDirtyRect.unionWith(rect);
-	}
-}
-
 void LLUI::setMousePositionScreen(S32 x, S32 y)
 {
 #if defined(LL_DARWIN)
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index a27b9c3da82296f616628bf2cbe8b31e91f3e03a..a63756ab5d14d5530b837b69d2f43dc3d175e4b5 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -245,10 +245,6 @@ class LLUI final : public LLParamSingleton<LLUI>
 
 	void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& );
 
-	LLRect	mDirtyRect;
-	BOOL		mDirty;
-	void		dirtyRect(LLRect rect);
-
 	// Return the ISO639 language name ("en", "ko", etc.) for the viewer UI.
 	// http://www.loc.gov/standards/iso639-2/php/code_list.php
 	std::string getUILanguage();
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 031a95ddf2d823a6a92464ae8eb88a4f22db2056..47da4b807f8768b3c15ea8e67ee24469e1449ade 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -60,6 +60,8 @@ static const S32 LINE_HEIGHT = 15;
 
 S32		LLView::sDepth = 0;
 bool	LLView::sDebugRects = false;
+bool	LLView::sIsRectDirty = false;
+LLRect	LLView::sDirtyRect;
 bool	LLView::sDebugRectsShowNames = true;
 bool	LLView::sDebugKeys = false;
 bool	LLView::sDebugMouseHandling = false;
@@ -1202,7 +1204,7 @@ void LLView::drawChildren()
 			if (viewp->getVisible() && viewp->getRect().isValid())
 			{
 				LLRect screen_rect = viewp->calcScreenRect();
-				if ( rootp->getLocalRect().overlaps(screen_rect)  && uiInst.mDirtyRect.overlaps(screen_rect))
+				if ( rootp->getLocalRect().overlaps(screen_rect)  && sDirtyRect.overlaps(screen_rect))
 				{
 					LLUI::pushMatrix();
 					{
@@ -1244,7 +1246,15 @@ void LLView::dirtyRect()
 		parent = parent->getParent();
 	}
 
-	LLUI::getInstance()->dirtyRect(cur->calcScreenRect());
+    if (!sIsRectDirty)
+    {
+        sDirtyRect = cur->calcScreenRect();
+        sIsRectDirty = true;
+    }
+    else
+    {
+        sDirtyRect.unionWith(cur->calcScreenRect());
+    }
 }
 
 //Draw a box for debugging.
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 5c91c37d3cd7520072de6855f99ad59275473cff..c60dcf3344f204e442c10bb7e42310fda2375a45 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -657,6 +657,9 @@ class LLView
 	// Draw debug rectangles around widgets to help with alignment and spacing
 	static bool	sDebugRects;
 
+    static bool sIsRectDirty;
+    static LLRect sDirtyRect;
+
 	// Draw widget names and sizes when drawing debug rectangles, turning this
 	// off is useful to make the rectangles themselves easier to see.
 	static bool sDebugRectsShowNames;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 8df373dd5e1439c863667a8f1ae9acd6962217b9..249d0feb2babce2881c11426c9d6eaa9d80a18e3 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1573,10 +1573,9 @@ void render_ui_2d()
 
 	if (LLPipeline::RenderUIBuffer)
 	{
-		LLUI* ui_inst = LLUI::getInstance();
-		if (ui_inst->mDirty)
+		if (LLView::sIsRectDirty)
 		{
-			ui_inst->mDirty = FALSE;
+            LLView::sIsRectDirty = false;
 			LLRect t_rect;
 
 			gPipeline.mUIScreen.bindTarget();
@@ -1584,25 +1583,25 @@ void render_ui_2d()
 			{
 				static const S32 pad = 8;
 
-				ui_inst->mDirtyRect.mLeft -= pad;
-				ui_inst->mDirtyRect.mRight += pad;
-				ui_inst->mDirtyRect.mBottom -= pad;
-				ui_inst->mDirtyRect.mTop += pad;
+                LLView::sDirtyRect.mLeft -= pad;
+                LLView::sDirtyRect.mRight += pad;
+                LLView::sDirtyRect.mBottom -= pad;
+                LLView::sDirtyRect.mTop += pad;
 
 				LLGLEnable scissor(GL_SCISSOR_TEST);
-				static LLRect last_rect = ui_inst->mDirtyRect;
+				static LLRect last_rect = LLView::sDirtyRect;
 
 				//union with last rect to avoid mouse poop
-				last_rect.unionWith(ui_inst->mDirtyRect);
+				last_rect.unionWith(LLView::sDirtyRect);
 								
-				t_rect = ui_inst->mDirtyRect;
-				ui_inst->mDirtyRect = last_rect;
+				t_rect = LLView::sDirtyRect;
+                LLView::sDirtyRect = last_rect;
 				last_rect = t_rect;
-			
-				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]);
+
+				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]);
 
 				LLRect clip_rect(last_rect);
 				
@@ -1614,7 +1613,7 @@ void render_ui_2d()
 			gPipeline.mUIScreen.flush();
 			gGL.setColorMask(true, false);
 
-			ui_inst->mDirtyRect = t_rect;
+            LLView::sDirtyRect = t_rect;
 		}
 
 		LLGLDisable cull(GL_CULL_FACE);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b15f7eec901488b2c8fdab6a28025777f23d6f7b..691cd9e0c0a16e73fb10e14ed04458a2f94a2892 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2570,7 +2570,7 @@ void LLViewerWindow::draw()
 
 	if (!LLPipeline::RenderUIBuffer)
 	{
-		LLUI::getInstance()->mDirtyRect = getWindowRectScaled();
+		LLView::sDirtyRect = getWindowRectScaled();
 	}
 
 	// HACK for timecode debugging