diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2c111643ce2472a0e1c5782a853350032712c390..05d0d568329dff663785171c8bdb8a38f0e18c97 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5046,7 +5046,7 @@ void LLViewerObject::updateText() LLVOAvatar* avatar = getAvatar(); if (avatar) { - mText->setHidden(LLMuteList::getInstance()->isMuted(avatar->getID())); + mText->setHidden(avatar->isInMuteList()); } LLVector3 up_offset(0,0,0); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8f94e608b10cb632551016c8ab9ddf47e4a9f9f9..12c1ff76117d9a151d1050ee61633f102197883b 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -717,7 +717,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), - mLastUpdateReceivedCOFVersion(-1) + mLastUpdateReceivedCOFVersion(-1), + mCachedMuteListUpdateTime(0), + mCachedInMuteList(false) { LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; @@ -2732,7 +2734,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } else { - is_muted = LLMuteList::getInstance()->isMuted(getID()); + is_muted = isInMuteList(); } bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); bool is_cloud = getIsCloud(); @@ -3086,7 +3088,7 @@ void LLVOAvatar::slamPosition() mRoot->updateWorldMatrixChildren(); } -bool LLVOAvatar::isVisuallyMuted() const +bool LLVOAvatar::isVisuallyMuted() { bool muted = false; @@ -3105,7 +3107,7 @@ bool LLVOAvatar::isVisuallyMuted() const { // Always want to see this AV as an impostor muted = true; } - else if (LLMuteList::getInstance()->isMuted(getID())) + else if (isInMuteList()) { muted = true; } @@ -3118,6 +3120,25 @@ bool LLVOAvatar::isVisuallyMuted() const return muted; } +bool LLVOAvatar::isInMuteList() +{ + bool muted = false; + F64 now = LLFrameTimer::getTotalSeconds(); + if (now < mCachedMuteListUpdateTime) + { + muted = mCachedInMuteList; + } + else + { + muted = LLMuteList::getInstance()->isMuted(getID()); + + const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1; + mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES; + mCachedInMuteList = muted; + } + return muted; +} + void LLVOAvatar::updateDebugText() { // clear debug text diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 75194bb8c5a0d1798c9c5b414d8ce7774feb7370..10d10b2ed5f99283af5dabaee532498c7d8a01a9 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -387,7 +387,8 @@ class LLVOAvatar : public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); - bool isVisuallyMuted() const; + bool isVisuallyMuted(); + bool isInMuteList(); void forceUpdateVisualMuteSettings(); enum VisualMuteSettings @@ -426,6 +427,8 @@ class LLVOAvatar : mutable bool mVisualComplexityStale; U32 mReportedVisualComplexity; // from other viewers through the simulator + bool mCachedInMuteList; + F64 mCachedMuteListUpdateTime; VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV