summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llviewermedia.cpp15
-rw-r--r--indra/newview/llviewermedia.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index f9e09036a8..249b55d2ab 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -512,6 +512,7 @@ void LLViewerMedia::updateMedia()
int impl_count_total = 0;
int impl_count_interest_low = 0;
int impl_count_interest_normal = 0;
+ int i = 0;
#if 0
LL_DEBUGS("PluginPriority") << "Sorted impls:" << llendl;
@@ -602,6 +603,17 @@ void LLViewerMedia::updateMedia()
}
pimpl->setPriority(new_priority);
+
+ if(!pimpl->getUsedInUI())
+ {
+ // Any impls used in the UI should not be in the proximity list.
+ pimpl->mProximity = -1;
+ }
+ else
+ {
+ // Other impls just get the same ordering as the priority list (for now).
+ pimpl->mProximity = i;
+ }
#if 0
LL_DEBUGS("PluginPriority") << " " << pimpl
@@ -614,6 +626,8 @@ void LLViewerMedia::updateMedia()
#endif
total_cpu += pimpl->getCPUUsage();
+
+ i++;
}
LL_DEBUGS("PluginPriority") << "Total reported CPU usage is " << total_cpu << llendl;
@@ -661,6 +675,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mPreviousMediaState(MEDIA_NONE),
mPreviousMediaTime(0.0f),
mIsDisabled(false),
+ mProximity(-1),
mIsUpdated(false)
{
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 1a4d2cd3c6..ee7f84b4cd 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -257,6 +257,7 @@ public:
void calculateInterest();
F64 getInterest() const { return mInterest; };
F64 getApproximateTextureInterest();
+ S32 getProximity() { return mProximity; };
// Mark this object as being used in a UI panel instead of on a prim
// This will be used as part of the interest sorting algorithm.
@@ -321,6 +322,7 @@ public:
int mPreviousMediaState;
F64 mPreviousMediaTime;
bool mIsDisabled;
+ S32 mProximity;
private:
BOOL mIsUpdated ;