From 2bcd4323acdac08478bc5d052042d1b3203ef3bf Mon Sep 17 00:00:00 2001 From: Techwolf Lupindo Date: Sun, 30 Jun 2013 22:41:31 -0400 Subject: [PATCH] FIRE-10803 : Fix for upload info not fetched on texture preview floater until reopening Bug manifested itself when previewing a texture that was allready loaded and saved in VFS but not yet fetched into memory. Fix was to add a loaded texture callback that updated the floater. --- indra/newview/llpreviewtexture.cpp | 10 ++++++++++ indra/newview/llpreviewtexture.h | 1 + 2 files changed, 11 insertions(+) diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1444ff1b2f..18647e4ea8 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -788,6 +788,13 @@ void LLPreviewTexture::onButtonClickUUID() std::string uuid = mImageID.asString(); LLClipboard::instance().copyToClipboard(utf8str_to_wstring(uuid), 0, uuid.size()); } + +/* static */ +void LLPreviewTexture::onTextureLoaded(BOOL success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +{ + LLPreviewTexture* self = (LLPreviewTexture*)userdata; + self->mUpdateDimensions = TRUE; +} // texture comment decoder // Return true if everything went fine, false if we somewhat modified the ratio as we bumped on border values @@ -840,6 +847,9 @@ void LLPreviewTexture::loadAsset() mImageOldBoostLevel = mImage->getBoostLevel(); mImage->setBoostLevel(LLGLTexture::BOOST_PREVIEW); mImage->forceToSaveRawImage(0) ; + // texture comment decoder + mImage->setLoadedCallback(LLPreviewTexture::onTextureLoaded, 0, TRUE, FALSE, this, NULL); + // mAssetStatus = PREVIEW_ASSET_LOADING; mUpdateDimensions = TRUE; updateDimensions(); diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index d96af975d4..183a56f4ee 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -89,6 +89,7 @@ public: void callbackLoadName(const LLUUID& agent_id, const LLAvatarName& av_name); void onButtonClickProfile(); void onButtonClickUUID(); + static void onTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); // protected: