diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-08-19 16:12:07 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-08-19 16:12:07 -0600 |
commit | 1616b73ef30bcb3e99be68fb7ccc05f0be78ddf6 (patch) | |
tree | e22c94948ed8d8c7f35422fc064172ea3662b264 /indra/newview/llviewertexture.cpp | |
parent | ea45b8acd25785bd2789c2c1928e223c9a8e2fbd (diff) | |
parent | d8c02bf06250015b8cb0bcc9c0d8445cfb6acf1c (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
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 6bda1499d0..8cb35cd30b 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1227,10 +1227,10 @@ void LLViewerFetchedTexture::dump() // ONLY called from LLViewerFetchedTextureList void LLViewerFetchedTexture::destroyTexture() { - //if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes)//not ready to release unused memory. - //{ - // return; - //} + if(LLImageGL::sGlobalTextureMemory < sMaxDesiredTextureMem * 0.95f)//not ready to release unused memory. + { + return ; + } if (mNeedsCreateTexture)//return if in the process of generating a new texture. { return; @@ -1318,7 +1318,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) ; + } } } } @@ -1549,7 +1554,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; @@ -2704,7 +2709,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; |