diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llviewertexture.h | 2 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 3 |
3 files changed, 25 insertions, 2 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) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 85f03b5839..79db754072 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -198,6 +198,7 @@ public: LLGLuint getTexName() const ; BOOL createGLTexture() ; BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0, BOOL to_create = TRUE, S32 category = LLViewerTexture::OTHER); + virtual void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; void setFilteringOption(LLTexUnit::eTextureFilterOptions option); void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE); @@ -423,6 +424,7 @@ public: LLImageRaw* reloadRawImage(S8 discard_level) ; void destroyRawImage(); + /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; const std::string& getUrl() const {return mUrl;} //--------------- diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 9fbcd1d32a..14bedaa49c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1009,6 +1009,8 @@ void LLVOVolume::sculpt() if(!raw_image) { + llassert(discard_level < 0) ; + sculpt_width = 0; sculpt_height = 0; sculpt_data = NULL ; @@ -1040,7 +1042,6 @@ void LLVOVolume::sculpt() if (volume != this && volume->getVolume() == getVolume()) { gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE); - volume->mSculptChanged = TRUE; } } } |