Merge branch 'DRTVWR-499' into DRTVWR-500
commit
e6ad50bced
|
|
@ -197,8 +197,6 @@ const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f;
|
|||
const U32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0;
|
||||
const F64 HUD_OVERSIZED_TEXTURE_DATA_SIZE = 1024 * 1024;
|
||||
|
||||
const F32 MAX_TEXTURE_WAIT_TIME_SEC = 60;
|
||||
|
||||
enum ERenderName
|
||||
{
|
||||
RENDER_NAME_NEVER,
|
||||
|
|
@ -665,7 +663,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||
mFullyLoadedInitialized(FALSE),
|
||||
mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
|
||||
mLoadedCallbacksPaused(FALSE),
|
||||
mLoadedCallbackTextures(0),
|
||||
mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)),
|
||||
mLastRezzedStatus(-1),
|
||||
mIsEditingAppearance(FALSE),
|
||||
|
|
@ -886,9 +883,8 @@ BOOL LLVOAvatar::hasGray() const
|
|||
S32 LLVOAvatar::getRezzedStatus() const
|
||||
{
|
||||
if (getIsCloud()) return 0;
|
||||
bool textured = isFullyTextured();
|
||||
if (textured && allBakedTexturesCompletelyDownloaded()) return 3;
|
||||
if (textured) return 2;
|
||||
if (isFullyTextured() && allBakedTexturesCompletelyDownloaded()) return 3;
|
||||
if (isFullyTextured()) return 2;
|
||||
llassert(hasGray());
|
||||
return 1; // gray
|
||||
}
|
||||
|
|
@ -5339,7 +5335,6 @@ void LLVOAvatar::checkTextureLoading()
|
|||
if(mCallbackTextureList.empty()) //when is self or no callbacks. Note: this list for self is always empty.
|
||||
{
|
||||
mLoadedCallbacksPaused = pause ;
|
||||
mLoadedCallbackTextures = 0;
|
||||
return ; //nothing to check.
|
||||
}
|
||||
|
||||
|
|
@ -5347,9 +5342,7 @@ void LLVOAvatar::checkTextureLoading()
|
|||
{
|
||||
return ; //have not been invisible for enough time.
|
||||
}
|
||||
|
||||
mLoadedCallbackTextures = pause ? mCallbackTextureList.size() : 0;
|
||||
|
||||
|
||||
for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin();
|
||||
iter != mCallbackTextureList.end(); ++iter)
|
||||
{
|
||||
|
|
@ -5370,14 +5363,9 @@ void LLVOAvatar::checkTextureLoading()
|
|||
|
||||
tex->unpauseLoadedCallbacks(&mCallbackTextureList) ;
|
||||
tex->addTextureStats(START_AREA); //jump start the fetching again
|
||||
|
||||
if (tex->isFullyLoaded())
|
||||
{
|
||||
mLoadedCallbackTextures++; // consider it loaded
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!pause)
|
||||
{
|
||||
|
|
@ -7641,13 +7629,14 @@ bool LLVOAvatar::getIsCloud() const
|
|||
);
|
||||
}
|
||||
|
||||
void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
|
||||
void LLVOAvatar::updateRezzedStatusTimers()
|
||||
{
|
||||
// State machine for rezzed status. Statuses are -1 on startup, 0
|
||||
// = cloud, 1 = gray, 2 = downloading, 3 = full.
|
||||
// Purpose is to collect time data for each it takes avatar to reach
|
||||
// various loading landmarks: gray, textured (partial), textured fully.
|
||||
|
||||
S32 rez_status = getRezzedStatus();
|
||||
if (rez_status != mLastRezzedStatus)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL;
|
||||
|
|
@ -7817,21 +7806,8 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
|
|||
// returns true if the value has changed.
|
||||
BOOL LLVOAvatar::updateIsFullyLoaded()
|
||||
{
|
||||
S32 rez_status = getRezzedStatus();
|
||||
bool loading = getIsCloud();
|
||||
if (mFirstFullyVisible && !mIsControlAvatar)
|
||||
{
|
||||
loading = ((rez_status < 2)
|
||||
// Wait at least 60s for unfinished textures to finish on first load,
|
||||
// don't wait forever, it might fail. Even if it will eventually load by
|
||||
// itself and update mLoadedCallbackTextures (or fail and clean the list),
|
||||
// avatars are more time-sensitive than textures and can't wait that long.
|
||||
|| (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)
|
||||
|| !mPendingAttachment.empty()
|
||||
|| (rez_status < 3 && !isFullyBaked())
|
||||
);
|
||||
}
|
||||
updateRezzedStatusTimers(rez_status);
|
||||
const bool loading = getIsCloud();
|
||||
updateRezzedStatusTimers();
|
||||
updateRuthTimer(loading);
|
||||
return processFullyLoadedChange(loading);
|
||||
}
|
||||
|
|
@ -7867,22 +7843,13 @@ void LLVOAvatar::updateRuthTimer(bool loading)
|
|||
|
||||
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
|
||||
{
|
||||
// We wait a little bit before giving the 'all clear', to let things to
|
||||
// settle down (models to snap into place, textures to get first packets)
|
||||
const F32 LOADED_DELAY = 1.f;
|
||||
const F32 FIRST_USE_DELAY = 3.f;
|
||||
|
||||
// we wait a little bit before giving the all clear,
|
||||
// to let textures settle down
|
||||
const F32 PAUSE = 1.f;
|
||||
if (loading)
|
||||
mFullyLoadedTimer.reset();
|
||||
|
||||
if (mFirstFullyVisible)
|
||||
{
|
||||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY);
|
||||
}
|
||||
|
||||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE);
|
||||
|
||||
if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
|
||||
{
|
||||
|
|
@ -8213,14 +8180,6 @@ void LLVOAvatar::updateMeshTextures()
|
|||
}
|
||||
baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ),
|
||||
src_callback_list, paused );
|
||||
if (!baked_img->isFullyLoaded() && !paused)
|
||||
{
|
||||
mLastTexCallbackAddedTime.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
mLoadedCallbackTextures++; // consider it loaded
|
||||
}
|
||||
|
||||
// this could add paused texture callbacks
|
||||
mLoadedCallbacksPaused |= paused;
|
||||
|
|
@ -8614,14 +8573,7 @@ void LLVOAvatar::onFirstTEMessageReceived()
|
|||
LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL;
|
||||
image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ),
|
||||
src_callback_list, paused );
|
||||
if (!image->isFullyLoaded() && !paused)
|
||||
{
|
||||
mLastTexCallbackAddedTime.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
mLoadedCallbackTextures++; // consider it loaded
|
||||
}
|
||||
|
||||
// this could add paused texture callbacks
|
||||
mLoadedCallbacksPaused |= paused;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ public:
|
|||
BOOL isFullyTextured() const;
|
||||
BOOL hasGray() const;
|
||||
S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded.
|
||||
void updateRezzedStatusTimers(S32 status);
|
||||
void updateRezzedStatusTimers();
|
||||
|
||||
S32 mLastRezzedStatus;
|
||||
|
||||
|
|
@ -629,8 +629,6 @@ protected:
|
|||
|
||||
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
|
||||
BOOL mLoadedCallbacksPaused;
|
||||
S32 mLoadedCallbackTextures; // count of fully loaded textures filled from mCallbackTextureList
|
||||
LLFrameTimer mLastTexCallbackAddedTime;
|
||||
std::set<LLUUID> mTextureIDs;
|
||||
//--------------------------------------------------------------------
|
||||
// Local Textures
|
||||
|
|
|
|||
Loading…
Reference in New Issue