summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-08-19 16:12:07 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-08-19 16:12:07 -0600
commit1616b73ef30bcb3e99be68fb7ccc05f0be78ddf6 (patch)
treee22c94948ed8d8c7f35422fc064172ea3662b264 /indra/newview/llviewertexture.cpp
parentea45b8acd25785bd2789c2c1928e223c9a8e2fbd (diff)
parentd8c02bf06250015b8cb0bcc9c0d8445cfb6acf1c (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rwxr-xr-xindra/newview/llviewertexture.cpp23
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;