diff options
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rwxr-xr-x | indra/newview/llviewertexture.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6cc9f4ace1..84f66c359f 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1199,10 +1199,10 @@ void LLViewerFetchedTexture::dump() // ONLY called from LLViewerFetchedTextureList void LLViewerFetchedTexture::destroyTexture() { - //if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes)//not ready to release unused memory. - //{ - // return ; - //} + if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes * 0.95f)//not ready to release unused memory. + { + return ; + } if (mNeedsCreateTexture)//return if in the process of generating a new texture. { return ; @@ -1290,7 +1290,12 @@ void LLViewerFetchedTexture::addToCreateTexture() destroyRawImage(); return ; } - mRawImage->scale(w >> i, h >> i) ; + + { + //make a duplicate in case somebody else is using this raw image + mRawImage = mRawImage->duplicate(); + mRawImage->scale(w >> i, h >> i) ; + } } } } @@ -1521,7 +1526,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority() else if (pixel_priority < 0.001f && !have_all_data) { // Not on screen but we might want some data - if (mBoostLevel > BOOST_HIGH) + if (mBoostLevel > BOOST_SELECTED) { // Always want high boosted images priority = 1.f; @@ -2669,7 +2674,11 @@ void LLViewerFetchedTexture::setCachedRawImage() --i ; } - mRawImage->scale(w >> i, h >> i) ; + { + //make a duplicate in case somebody else is using this raw image + mRawImage = mRawImage->duplicate(); + mRawImage->scale(w >> i, h >> i) ; + } } mCachedRawImage = mRawImage ; mRawDiscardLevel += i ; |