summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 28998d409e..6add8a7e92 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -293,6 +293,8 @@ void LLViewerTextureManager::init()
}
}
imagep->createGLTexture(0, image_raw);
+ //cache the raw image
+ imagep->setCachedRawImage(0, image_raw) ;
image_raw = NULL;
#else
LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLViewerTexture::BOOST_UI);
@@ -799,12 +801,18 @@ BOOL LLViewerTexture::createGLTexture(S32 discard_level, const LLImageRaw* image
{
mFullWidth = mGLTexturep->getCurrentWidth() ;
mFullHeight = mGLTexturep->getCurrentHeight() ;
- mComponents = mGLTexturep->getComponents() ;
+ mComponents = mGLTexturep->getComponents() ;
}
return ret ;
}
+//virtual
+void LLViewerTexture::setCachedRawImage(S32 discard_level, LLImageRaw* imageraw)
+{
+ //nothing here.
+}
+
void LLViewerTexture::setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes)
{
llassert(mGLTexturep.notNull()) ;
@@ -2354,6 +2362,18 @@ void LLViewerFetchedTexture::switchToCachedImage()
}
}
+//cache the imageraw forcefully.
+//virtual
+void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* imageraw)
+{
+ if(imageraw != mRawImage.get())
+ {
+ mCachedRawImage = imageraw ;
+ mCachedRawDiscardLevel = discard_level ;
+ mCachedRawImageReady = TRUE ;
+ }
+}
+
void LLViewerFetchedTexture::setCachedRawImage()
{
if(mRawImage == mCachedRawImage)