summaryrefslogtreecommitdiff
path: root/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-05-28 16:45:23 -0400
committerLoren Shih <seraph@lindenlab.com>2010-05-28 16:45:23 -0400
commit7efaa216a1c42ed85663bcf2c7d0ef6df718c780 (patch)
treec92423c64a1e59d220db82854347cf0a41177488 /indra/newview/lltexlayer.cpp
parenta5c9e30fc806cc8cf291b7da0fd4133ca8241fed (diff)
EXT-7504 WIP Force decloud after timeout using lower res textures
Code cleanup. Some minor changes in logic for when low res texture is used. Added more metrics to notifications and texture debug output.
Diffstat (limited to 'indra/newview/lltexlayer.cpp')
-rw-r--r--indra/newview/lltexlayer.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 3f3aefa4b5..7a3aeae3cc 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -138,21 +138,22 @@ void LLTexLayerSetBuffer::requestUpdate()
void LLTexLayerSetBuffer::requestUpload()
{
- // New upload request
- if (!mNeedsUpload)
+ // If we requested a new upload but haven't even uploaded
+ // a low res version of our last upload request, then
+ // keep the timer ticking instead of resetting it.
+ if (mNeedsUpload && mNeedsLowResUpload)
{
- mNeedsUploadTimer.start();
+ mNeedsUploadTimer.reset();
}
-
mNeedsUpload = TRUE;
mNeedsLowResUpload = TRUE;
mUploadPending = TRUE;
+ mNeedsUploadTimer.unpause();
}
void LLTexLayerSetBuffer::cancelUpload()
{
mNeedsUpload = FALSE;
- mNeedsLowResUpload = FALSE;
mUploadPending = FALSE;
mNeedsUploadTimer.pause();
}
@@ -254,7 +255,6 @@ BOOL LLTexLayerSetBuffer::render()
{
mUploadPending = FALSE;
mNeedsUpload = FALSE;
- mNeedsLowResUpload = FALSE;
mNeedsUploadTimer.pause();
mTexLayerSet->getAvatar()->setNewBakedTexture(mTexLayerSet->getBakedTexIndex(),IMG_INVISIBLE);
}
@@ -286,12 +286,13 @@ BOOL LLTexLayerSetBuffer::isReadyToUpload() const
const BOOL can_highest_lod = mTexLayerSet->isLocalTextureDataFinal();
if (can_highest_lod) return TRUE;
- if (gSavedSettings.getBOOL("AvatarUseBakedTextureTimeout"))
+ const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureTimeout");
+ if (texture_timeout)
{
// If we hit our timeout and have textures available at even lower resolution, then upload.
- const BOOL is_upload_textures_timeout = isUploadTimeout();
- const BOOL can_lower_lod = mTexLayerSet->isLocalTextureDataAvailable();
- if (can_lower_lod && is_upload_textures_timeout && mNeedsLowResUpload) return TRUE;
+ const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout;
+ const BOOL has_lower_lod = mTexLayerSet->isLocalTextureDataAvailable();
+ if (has_lower_lod && is_upload_textures_timeout && mNeedsLowResUpload) return TRUE;
}
return FALSE;
}
@@ -437,7 +438,9 @@ void LLTexLayerSetBuffer::readBackAndUpload()
mNeedsUploadTimer.pause();
}
else
+ {
mNeedsLowResUpload = FALSE;
+ }
}
else
{
@@ -2227,14 +2230,6 @@ BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLIma
return success;
}
-BOOL LLTexLayerSetBuffer::isUploadTimeout() const
-{
- //const F32 BAKED_TEXTURES_TIMEOUT_THRESHOLD__SECONDS = 20.f;
- const F32 UPLOAD_TEXTURES_TIMEOUT_THRESHOLD__SECONDS = 5.f; // SERAPH Reduced timeout for testing.
-
- return (mNeedsUploadTimer.getElapsedTimeF32() >= UPLOAD_TEXTURES_TIMEOUT_THRESHOLD__SECONDS);
-}
-
const std::string LLTexLayerSetBuffer::dumpTextureInfo() const
{
if (!isAgentAvatarValid()) return "";