summaryrefslogtreecommitdiff
path: root/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-05-29 06:19:06 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-05-29 06:19:06 +0100
commit33a0e1d07bb90117b60d5f79f0cdd3529ec595da (patch)
tree6cea69c52dccf3ed3f5e0e77f80aa77f8ad88e9f /indra/newview/lltexlayer.cpp
parent6387426c990ad32623d57ad7fa190d78b2d5dbb6 (diff)
parent3df90898b18feeda876857acb00f1f3046793e69 (diff)
merge from viewer-public
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 "";