diff options
author | Graham Linden <graham@lindenlab.com> | 2013-08-19 12:10:40 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-08-19 12:10:40 -0700 |
commit | 3f186aab7737d611e1b8a62e66a79828e3b5ef5b (patch) | |
tree | a42a19d1ff584a2d074ef9c07f166d0ad47dc7a2 /indra/newview/llviewertexture.cpp | |
parent | 80256fdbf5fe444c177be793b12d0da58ce2b608 (diff) | |
parent | 171089207b528ab80a954292c127ba77254ee927 (diff) |
Merge in viewer-release
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 ; |