From a873a575dd0e5034313df09c89141e8be581c24e Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Tue, 19 Nov 2013 13:36:59 +0200
Subject: [PATCH] MAINT-3375 FIXED Do not record visibility change if event
 logging is off(because it kills fps).

---
 indra/llui/llview.cpp                | 20 +++++++++++++-------
 indra/llui/llviewereventrecorder.cpp |  2 +-
 indra/llui/llviewereventrecorder.h   |  2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 20015dca1af..9cc8c951d52 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -645,14 +645,18 @@ void LLView::setVisible(BOOL visible)
 void LLView::handleVisibilityChange ( BOOL new_visibility )
 {
 	BOOL old_visibility;
+	BOOL log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus();
 	BOOST_FOREACH(LLView* viewp, mChildList)
 	{
 		// only views that are themselves visible will have their overall visibility affected by their ancestors
 		old_visibility=viewp->getVisible();
 
-		if (old_visibility!=new_visibility)
+		if(log_visibility_change)
 		{
-			LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget");
+			if (old_visibility!=new_visibility)
+			{
+				LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget");
+			}
 		}
 
 		if (old_visibility)
@@ -660,11 +664,13 @@ void LLView::handleVisibilityChange ( BOOL new_visibility )
 			viewp->handleVisibilityChange ( new_visibility );
 		}
 
-		// Consider changing returns to confirm success and know which widget grabbed it
-		// For now assume success and log at highest xui possible 
-		// NOTE we log actual state - which may differ if it somehow failed to set visibility
-		lldebugs << "LLView::handleVisibilityChange	 - now: " << getVisible()  << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl;
-		
+		if(log_visibility_change)
+		{
+			// Consider changing returns to confirm success and know which widget grabbed it
+			// For now assume success and log at highest xui possible
+			// NOTE we log actual state - which may differ if it somehow failed to set visibility
+			lldebugs << "LLView::handleVisibilityChange	 - now: " << getVisible()  << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl;
+		}
 	}
 }
 
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
index a352f621eb5..546a0f58667 100644
--- a/indra/llui/llviewereventrecorder.cpp
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -31,7 +31,7 @@
 LLViewerEventRecorder::LLViewerEventRecorder() {
 
   clear(UNDEFINED);
-
+  logEvents = false;
   // Remove any previous event log file
   std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old");
   LLFile::remove(old_log_ui_events_to_llsd_file);
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
index 72ca643ced0..375efcc3de8 100644
--- a/indra/llui/llviewereventrecorder.h
+++ b/indra/llui/llviewereventrecorder.h
@@ -65,7 +65,7 @@ class LLViewerEventRecorder : public LLSingleton<LLViewerEventRecorder>
   std::string get_xui();
   void update_xui(std::string xui);
 
-  bool getLoggingStatus();
+  bool getLoggingStatus(){return logEvents;};
   void setEventLoggingOn();
   void setEventLoggingOff();
 
-- 
GitLab