Merge SSA push 6 incl. backout of f066a2bd972d

Ansariel 2013-04-01 21:26:38 +02:00
parent 7a2c6de165
commit 2c6da93f49
8 changed files with 68 additions and 54 deletions

View File

@ -1253,21 +1253,6 @@ S32 LLAppearanceMgr::getCOFVersion() const
}
}
S32 LLAppearanceMgr::getLastUpdateRequestCOFVersion() const
{
return mLastUpdateRequestCOFVersion;
}
S32 LLAppearanceMgr::getLastAppearanceUpdateCOFVersion() const
{
return mLastAppearanceUpdateCOFVersion;
}
void LLAppearanceMgr::setLastAppearanceUpdateCOFVersion(S32 new_val)
{
mLastAppearanceUpdateCOFVersion = new_val;
}
const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()
{
const LLUUID& current_outfit_cat = getCOF();
@ -3748,8 +3733,8 @@ void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr respond
responder_ptr = new RequestAgentUpdateAppearanceResponder;
}
LLHTTPClient::post(url, body, responder_ptr);
llassert(cof_version >= mLastUpdateRequestCOFVersion);
mLastUpdateRequestCOFVersion = cof_version;
llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion);
gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version;
}
class LLIncrementCofVersionResponder : public LLHTTPClient::Responder
@ -3769,12 +3754,10 @@ public:
llinfos << "Successfully incremented agent's COF." << llendl;
S32 new_version = pContent["category"]["version"].asInteger();
LLAppearanceMgr* app_mgr = LLAppearanceMgr::getInstance();
// cof_version should have increased
llassert(new_version > app_mgr->mLastUpdateRequestCOFVersion);
llassert(new_version > gAgentAvatarp->mLastUpdateRequestCOFVersion);
app_mgr->mLastUpdateRequestCOFVersion = new_version;
gAgentAvatarp->mLastUpdateRequestCOFVersion = new_version;
}
virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& content)
{
@ -4055,9 +4038,7 @@ LLAppearanceMgr::LLAppearanceMgr():
mAttachmentInvLinkEnabled(false),
mOutfitIsDirty(false),
mOutfitLocked(false),
mIsInUpdateAppearanceFromCOF(false),
mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN),
mLastAppearanceUpdateCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN)
mIsInUpdateAppearanceFromCOF(false)
{
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();

View File

@ -114,15 +114,6 @@ public:
// Debugging - get truncated LLSD summary of COF contents.
LLSD dumpCOF() const;
// COF version of last viewer-initiated appearance update request.
S32 mLastUpdateRequestCOFVersion;
S32 getLastUpdateRequestCOFVersion() const;
// COF version of last appearance message received for self av.
S32 mLastAppearanceUpdateCOFVersion;
S32 getLastAppearanceUpdateCOFVersion() const;
void setLastAppearanceUpdateCOFVersion(S32 new_val);
// Finds the folder link to the currently worn outfit
const LLViewerInventoryItem *getBaseOutfitLink();
bool getBaseOutfitName(std::string &name);

View File

@ -380,7 +380,7 @@ void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_cam
if (!disable_camera_switch) // if we're just switching between outfit and wearable editing, don't end customization.
{
LLVOAvatarSelf::onCustomizeEnd(disable_camera_switch);
LLAppearanceMgr::getInstance()->setOutfitDirty( FALSE );
LLAppearanceMgr::getInstance()->updateIsDirty();
}
}
}
@ -415,7 +415,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearab
{
// Save changes if closing.
mEditWearable->saveChanges();
LLAppearanceMgr::getInstance()->setOutfitDirty( FALSE );
LLAppearanceMgr::getInstance()->updateIsDirty();
if (!disable_camera_switch) // if we're just switching between outfit and wearable editing, don't end customization.
{
LLVOAvatarSelf::onCustomizeEnd(disable_camera_switch);
@ -458,7 +458,6 @@ void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *dat
LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data);
if (panel)
{
panel->showOutfitsInventoryPanel();
panel->showWearableEditPanel(wearable, disable_camera_switch);
}
}

View File

@ -1248,6 +1248,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
// we have enough data, decode it
llassert_always(mFormattedImage->getDataSize() > 0);
mLoadedDiscard = mDesiredDiscard;
if (mLoadedDiscard < 0)
{
LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
<< ", should be >=0" << llendl;
}
setState(DECODE_IMAGE);
mInCache = TRUE;
mWriteToCacheState = NOT_WRITE ;
@ -1371,6 +1376,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
return true; // failed
}
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if (mLoadedDiscard < 0)
{
LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
<< ", should be >=0" << llendl;
}
setState(DECODE_IMAGE);
mWriteToCacheState = SHOULD_WRITE;
recordTextureDone(false);
@ -1436,6 +1446,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
// We already have all the data, just decode it
mLoadedDiscard = mFormattedImage->getDiscardLevel();
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if (mLoadedDiscard < 0)
{
LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
<< ", should be >=0" << llendl;
}
setState(DECODE_IMAGE);
releaseHttpSemaphore();
return false;
@ -1561,6 +1576,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
// Use available data
mLoadedDiscard = mFormattedImage->getDiscardLevel();
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if (mLoadedDiscard < 0)
{
LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
<< ", should be >=0" << llendl;
}
setState(DECODE_IMAGE);
releaseHttpSemaphore();
return false;
@ -1660,6 +1680,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
mHttpReplyOffset = 0;
mLoadedDiscard = mRequestedDiscard;
if (mLoadedDiscard < 0)
{
LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
<< ", should be >=0" << llendl;
}
setState(DECODE_IMAGE);
if (mWriteToCacheState != NOT_WRITE)
{

View File

@ -659,7 +659,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mLastRezzedStatus(-1),
mIsEditingAppearance(FALSE),
mUseLocalAppearance(FALSE),
mUseServerBakes(FALSE) // FIXME DRANO consider using boost::optional, defaulting to unknown.
mUseServerBakes(FALSE), // FIXME DRANO consider using boost::optional, defaulting to unknown.
mLastUpdateRequestCOFVersion(-1),
mLastUpdateReceivedCOFVersion(-1)
{
//VTResume(); // VTune
@ -3233,11 +3235,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
mUseServerBakes, central_bake_version);
std::string origin_string = bakedTextureOriginInfo();
debug_line += " [" + origin_string + "]";
S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion();
S32 last_request_cof_version = mLastUpdateRequestCOFVersion;
S32 last_received_cof_version = mLastUpdateReceivedCOFVersion;
if (isSelf())
{
S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion();
S32 last_request_cof_version = LLAppearanceMgr::instance().getLastUpdateRequestCOFVersion();
S32 last_received_cof_version = LLAppearanceMgr::instance().getLastAppearanceUpdateCOFVersion();
debug_line += llformat(" - cof: %d req: %d rcv:%d",
curr_cof_version, last_request_cof_version, last_received_cof_version);
if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure"))
@ -3245,6 +3247,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
debug_line += " FORCING ERRS";
}
}
else
{
debug_line += llformat(" - cof rcv:%d", last_received_cof_version);
}
addDebugText(debug_line);
}
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
@ -4649,7 +4655,7 @@ void LLVOAvatar::updateTextures()
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
if (texture_dict->mIsLocalTexture)
{
addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]);
addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, mBakedTextureDatas[baked_index].mIsUsed);
}
}
}
@ -4682,7 +4688,7 @@ void LLVOAvatar::updateTextures()
void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerFetchedTexture* imagep,
F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked, U32 index )
F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked)
{
// No local texture stats for non-self avatars
return;
@ -7362,7 +7368,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
return;
}
S32 this_update_cof_version = contents.mCOFVersion;
S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion;
S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion;
// Only now that we have result of appearance_version can we decide whether to bail out.
if( isSelf() )
@ -7371,8 +7377,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
<< " last_update_request_cof_version " << last_update_request_cof_version
<< " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << llendl;
LLAppearanceMgr::instance().setLastAppearanceUpdateCOFVersion(this_update_cof_version);
if (getRegion() && (getRegion()->getCentralBakeVersion()==0))
{
llwarns << avString() << "Received AvatarAppearance message for self in non-server-bake region" << llendl;
@ -7414,6 +7418,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
return;
}
mLastUpdateReceivedCOFVersion = this_update_cof_version;
setIsUsingServerBakes(appearance_version > 0);
applyParsedTEMessage(contents.mTEContents);

View File

@ -542,7 +542,7 @@ protected:
//--------------------------------------------------------------------
protected:
virtual void setLocalTexture(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index = 0);
virtual void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked, U32 index = 0);
virtual void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked);
// MULTI-WEARABLE: make self-only?
virtual void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index = 0);
@ -978,6 +978,17 @@ protected:
LLFrameTimer mRuthDebugTimer; // For tracking how long it takes for av to rez
LLFrameTimer mDebugExistenceTimer; // Debugging for how long the avatar has been in memory.
//--------------------------------------------------------------------
// COF monitoring
//--------------------------------------------------------------------
public:
// COF version of last viewer-initiated appearance update request. For non-self avs, this will remain at default.
S32 mLastUpdateRequestCOFVersion;
// COF version of last appearance message received for this av.
S32 mLastUpdateReceivedCOFVersion;
/** Diagnostics
** **
*******************************************************************************/

View File

@ -2898,13 +2898,17 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const
}
void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTexture* imagep,
F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked, U32 index )
F32 texel_area_ratio, BOOL render_avatar, BOOL covered_by_baked)
{
if (!isIndexLocalTexture(type)) return;
if (!covered_by_baked)
// Sunshine - ignoring covered_by_baked will force local textures
// to always load. Fix for SH-4001 and many related issues. Do
// not restore this without some more targetted fix for the local
// textures failing to load issue.
//if (!covered_by_baked)
{
if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR)
if (imagep->getID() != IMG_DEFAULT_AVATAR)
{
imagep->setNoDelete();
if (imagep->getDiscardLevel() != 0)
@ -3320,10 +3324,7 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch)
gAgentCamera.resetView();
}
if (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())
{
LLAppearanceMgr::instance().requestServerAppearanceUpdate();
}
LLAppearanceMgr::instance().updateAppearanceFromCOF();
}
}

View File

@ -219,7 +219,7 @@ protected:
/*virtual*/ void setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index);
void localTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
void getLocalTextureByteCount(S32* gl_byte_count) const;
/*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked, U32 index);
/*virtual*/ void addLocalTextureStats(LLAvatarAppearanceDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked);
LLLocalTextureObject* getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 index) const;
private: