From 6cee0ee59d112f0e104ed3c0a087e80c921750ad Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Thu, 19 Mar 2020 14:58:13 -0400
Subject: [PATCH] Small optimizations to LLFloater and LLPanel with getting and
 setting transparency values May contain Kitty codez

---
 indra/llui/llfloater.cpp | 24 +++++++++++-------------
 indra/llui/llpanel.cpp   |  4 +---
 2 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 44167085073..39f65058d3a 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1855,8 +1855,6 @@ void LLFloater::onClickCloseBtn(bool app_quitting)
 // virtual
 void LLFloater::draw()
 {
-	const F32 alpha = getCurrentTransparency();
-
 	// draw background
 	if( isBackgroundVisible() )
 	{
@@ -1884,6 +1882,7 @@ void LLFloater::draw()
 			overlay_color = getTransparentImageOverlay();
 		}
 
+		const F32 alpha = getCurrentTransparency();
 		if (image)
 		{
 			// We're using images for this floater's backgrounds
@@ -1976,19 +1975,18 @@ void	LLFloater::drawShadow(LLPanel* panel)
 
 void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type)
 {
-	if (!view) return;
-	child_list_t children = *view->getChildList();
-	child_list_t::iterator it = children.begin();
-
-	LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(view);
-	if (ctrl)
+	if (view)
 	{
-		ctrl->setTransparencyType(transparency_type);
-	}
+		if (view->isCtrl())
+		{
+			static_cast<LLUICtrl*>(view)->setTransparencyType(transparency_type);
+		}
 
-	for(; it != children.end(); ++it)
-	{
-		updateTransparency(*it, transparency_type);
+		for (LLView* pChild : *view->getChildList())
+		{
+			if ((pChild->getChildCount()) || (pChild->isCtrl()))
+				updateTransparency(pChild, transparency_type);
+		}
 	}
 }
 
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 00da0f5fec5..817ac559280 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -200,12 +200,10 @@ LLPanel::ctrl_list_t LLPanel::getCtrlList() const
 
 void LLPanel::draw()
 {
-	F32 alpha = getDrawContext().mAlpha;
-
 	// draw background
 	if( mBgVisible )
 	{
-		alpha = getCurrentTransparency();
+		F32 alpha = getCurrentTransparency();
 
 		LLRect local_rect = getLocalRect();
 		if (mBgOpaque )
-- 
GitLab