summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llappearance/lltexlayer.cpp9
-rwxr-xr-xindra/newview/llviewertexture.cpp46
-rwxr-xr-xindra/newview/llviewertexture.h2
-rwxr-xr-xindra/newview/llvoavatarself.cpp17
4 files changed, 50 insertions, 24 deletions
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index f951a982e5..59765b3833 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -1550,10 +1550,13 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
U32 cache_index = alpha_mask_crc.getCRC();
- U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL);
- if (!alpha_data)
+ U8* alpha_data = NULL;
+ // We believe we need to generate morph masks, do not assume that the cached version is accurate.
+ // We can get bad morph masks during login, on minimize, and occasional gl errors.
+ // We should only be doing this when we believe something has changed with respect to the user's appearance.
{
- // clear out a slot if we have filled our cache
+ LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << llendl;
+ // clear out a slot if we have filled our cache
S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1;
while ((S32)mAlphaCache.size() >= max_cache_entries)
{
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 18cfa82421..86f4fe4919 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -989,6 +989,7 @@ void LLViewerFetchedTexture::init(bool firstinit)
{
mOrigWidth = 0;
mOrigHeight = 0;
+ mHasAux = FALSE;
mNeedsAux = FALSE;
mRequestedDiscardLevel = -1;
mRequestedDownloadPriority = 0.f;
@@ -1823,7 +1824,11 @@ bool LLViewerFetchedTexture::updateFetch()
bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage,
mLastHttpGetStatus);
if (mRawImage.notNull()) sRawCount++;
- if (mAuxRawImage.notNull()) sAuxCount++;
+ if (mAuxRawImage.notNull())
+ {
+ mHasAux = TRUE;
+ sAuxCount++;
+ }
if (finished)
{
mIsFetching = FALSE;
@@ -2152,8 +2157,16 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call
}
if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0)
{
- // We need aux data, but we've already loaded the image, and it didn't have any
- llwarns << "No aux data available for callback for image:" << getID() << llendl;
+ if(mHasAux)
+ {
+ //trigger a refetch
+ forceToRefetchTexture();
+ }
+ else
+ {
+ // We need aux data, but we've already loaded the image, and it didn't have any
+ llwarns << "No aux data available for callback for image:" << getID() << llendl;
+ }
}
mLastCallBackActiveTime = sCurrentTime ;
}
@@ -2604,7 +2617,7 @@ bool LLViewerFetchedTexture::needsToSaveRawImage()
void LLViewerFetchedTexture::destroyRawImage()
{
- if (mAuxRawImage.notNull())
+ if (mAuxRawImage.notNull() && !needsToSaveRawImage())
{
sAuxCount--;
mAuxRawImage = NULL;
@@ -2760,6 +2773,25 @@ void LLViewerFetchedTexture::saveRawImage()
mLastReferencedSavedRawImageTime = sCurrentTime ;
}
+//force to refetch the texture to the discard level
+void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard)
+{
+ F32 kept_time = 60.0; //seconds
+ if(mForceToSaveRawImage)
+ {
+ desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel);
+ kept_time = llmax(kept_time, mKeptSavedRawImageTime);
+ }
+
+ //trigger a new fetch.
+ mForceToSaveRawImage = TRUE ;
+ mDesiredSavedRawDiscardLevel = desired_discard ;
+ mKeptSavedRawImageTime = kept_time ;
+ mLastReferencedSavedRawImageTime = sCurrentTime ;
+ mSavedRawImage = NULL ;
+ mSavedRawDiscardLevel = -1 ;
+}
+
void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, F32 kept_time)
{
mKeptSavedRawImageTime = kept_time ;
@@ -2807,6 +2839,12 @@ void LLViewerFetchedTexture::destroySavedRawImage()
mDesiredSavedRawDiscardLevel = -1 ;
mLastReferencedSavedRawImageTime = 0.0f ;
mKeptSavedRawImageTime = 0.f ;
+
+ if(mAuxRawImage.notNull())
+ {
+ sAuxCount--;
+ mAuxRawImage = NULL;
+ }
}
LLImageRaw* LLViewerFetchedTexture::getSavedRawImage()
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index d9a537d304..31430c31e0 100755
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -388,6 +388,7 @@ public:
BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;}
BOOL isRawImageValid()const { return mIsRawImageValid ; }
void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ;
+ void forceToRefetchTexture(S32 desired_discard = 0);
/*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ;
void destroySavedRawImage() ;
LLImageRaw* getSavedRawImage() ;
@@ -449,6 +450,7 @@ protected:
S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have
S8 mNeedsAux; // We need to decode the auxiliary channels
+ S8 mHasAux; // We have aux channels
S8 mDecodingAux; // Are we decoding high components
S8 mIsRawImageValid;
S8 mHasFetcher; // We've made a fecth request
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 88241304cd..6f238571a4 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -63,7 +63,6 @@
#include "llsdutil.h"
#include "llstartup.h"
#include "llsdserialize.h"
-#include "llversioninfo.h"
#if LL_MSVC
// disable boost::lexical_cast warning
@@ -2274,19 +2273,6 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records,
return result;
}
-// Valid characters for tsdb are alphanumeric, _-./. Others must be cleaned out.
-void sanitize_for_tsdb_tag(std::string& s)
-{
- for (std::string::iterator it = s.begin(); it != s.end(); ++it)
- {
- if (std::isalnum(*it) || *it == '.' || *it == '_' || *it == '-' || *it == '/')
- {
- continue;
- }
- *it = '_';
- }
-}
-
void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
{
static volatile bool reporting_started(false);
@@ -2305,9 +2291,6 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
msg["initial"] = !reporting_started;
msg["break"] = false;
msg["duration"] = mTimeSinceLastRezMessage.getElapsedTimeF32();
- msg["viewer_version_channel"] = viewer_version_channel;
- msg["viewer_version_short"] = viewer_version_short;
- msg["viewer_version_build"] = viewer_version_build;
// Status of our own rezzing.
msg["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus());