diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llviewertexture.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llviewertexture.h | 3 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 3 |
3 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 86f4fe4919..1f42590884 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1046,7 +1046,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mLastReferencedSavedRawImageTime = 0.0f ; mKeptSavedRawImageTime = 0.f ; mLastCallBackActiveTime = 0.f; - + mForceCallbackFetch = FALSE; mInDebug = FALSE; mFTType = FTT_UNKNOWN; @@ -2169,6 +2169,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } } mLastCallBackActiveTime = sCurrentTime ; + mLastReferencedSavedRawImageTime = sCurrentTime; } void LLViewerFetchedTexture::clearCallbackEntryList() @@ -2281,6 +2282,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: } mPauseLoadedCallBacks = FALSE ; mLastCallBackActiveTime = sCurrentTime ; + mForceCallbackFetch = TRUE; if(need_raw) { mSaveRawImage = TRUE ; @@ -2321,6 +2323,7 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s bool LLViewerFetchedTexture::doLoadedCallbacks() { static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds + static const F32 MAX_IDLE_WAIT_TIME = 5.f ; //seconds if (mNeedsCreateTexture) { @@ -2525,6 +2528,9 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() } } + // Done with any raw image data at this point (will be re-created if we still have callbacks) + destroyRawImage(); + // // If we have no callbacks, take us off of the image callback list. // @@ -2532,10 +2538,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() { gTextureList.mCallbackList.erase(this); } + else if(!res && mForceCallbackFetch && sCurrentTime - mLastCallBackActiveTime > MAX_IDLE_WAIT_TIME && !mIsFetching) + { + //wait for long enough but no fetching request issued, force one. + forceToRefetchTexture(mLoadedCallbackDesiredDiscardLevel, 5.f); + mForceCallbackFetch = FALSE; //fire once. + } - // Done with any raw image data at this point (will be re-created if we still have callbacks) - destroyRawImage(); - return res; } @@ -2774,9 +2783,8 @@ void LLViewerFetchedTexture::saveRawImage() } //force to refetch the texture to the discard level -void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard) +void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard, F32 kept_time) { - F32 kept_time = 60.0; //seconds if(mForceToSaveRawImage) { desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 31430c31e0..7e45fcaf4b 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -388,7 +388,7 @@ public: BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;} BOOL isRawImageValid()const { return mIsRawImageValid ; } void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ; - void forceToRefetchTexture(S32 desired_discard = 0); + void forceToRefetchTexture(S32 desired_discard = 0, F32 kept_time = 60.f); /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; void destroySavedRawImage() ; LLImageRaw* getSavedRawImage() ; @@ -423,6 +423,7 @@ private: BOOL mFullyLoaded; BOOL mInDebug; BOOL mInFastCacheList; + BOOL mForceCallbackFetch; protected: std::string mLocalFileName; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index df54f26ae7..3d268a1bcb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6262,6 +6262,8 @@ void LLVOAvatar::updateMeshTextures() // we'll consider it loaded and use it (rather than // doing compositing). useBakedTexture( baked_img->getID() ); + mLoadedCallbacksPaused |= !isVisible(); + checkTextureLoading(); } else { @@ -6277,6 +6279,7 @@ void LLVOAvatar::updateMeshTextures() // this could add paused texture callbacks mLoadedCallbacksPaused |= paused; + checkTextureLoading(); } } else if (layerset && isUsingLocalAppearance()) |