summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorMark Palange <palange@lindenlab.com>2009-02-03 21:15:57 +0000
committerMark Palange <palange@lindenlab.com>2009-02-03 21:15:57 +0000
commit46f8fb8781ccce338b4a88aaf8371ee3dec56d29 (patch)
treeb2dc09521a166d2181c48f4a4f1ca90b83b99477 /indra/newview/lltexturefetch.cpp
parente188badaf29a1a02307f93864eed6737096bd9a1 (diff)
svn merge -r107016:108767 svn+ssh://svn.lindenlab.com/svn/linden/viewer/viewer_1-22
Merge back of viewer 1.22 RC6 and RC7 change to trunk. QAR-1214 and QAR-1227
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r--indra/newview/lltexturefetch.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index d32858c1ea..3fcb9c50be 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -563,6 +563,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
mFetchTimer.reset();
}
+
+ if (mImagePriority <= 0.0f)
+ {
+ if (mState < WRITE_TO_CACHE)
+ {
+ return true; // cancel request
+ }
+ }
if (mState == INIT)
{
@@ -709,7 +717,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
mFetcher->lockQueue();
mFetcher->removeFromNetworkQueue(this);
mFetcher->unlockQueue();
- if (!mFormattedImage->getDataSize())
+ if (mFormattedImage.isNull() || !mFormattedImage->getDataSize())
{
// processSimulatorPackets() failed
// llwarns << "processSimulatorPackets() failed to load buffer" << llendl;
@@ -1051,17 +1059,22 @@ void LLTextureFetchWorker::removeFromCache()
bool LLTextureFetchWorker::processSimulatorPackets()
{
+ if (mFormattedImage.isNull() || mRequestedSize < 0)
+ {
+ // not sure how we got here, but not a valid state, abort!
+ mFormattedImage = NULL;
+ return true;
+ }
+
if (mLastPacket >= mFirstPacket)
{
- llassert_always(mFormattedImage) ;
S32 buffer_size = mFormattedImage->getDataSize();
for (S32 i = mFirstPacket; i<=mLastPacket; i++)
{
- llassert_always(mPackets[i]) ;
+ llassert_always(mPackets[i]);
buffer_size += mPackets[i]->mSize;
}
bool have_all_data = mLastPacket >= mTotalPackets-1;
- llassert_always(mRequestedSize > 0);
if (buffer_size >= mRequestedSize || have_all_data)
{
/// We have enough (or all) data
@@ -1228,7 +1241,12 @@ void LLTextureFetchWorker::callbackDecoded(bool success)
bool LLTextureFetchWorker::decodeImage()
{
- llassert_always(mImageWorker);
+ if(!mImageWorker)
+ {
+ //LLTextureFetchWorker is aborted, skip image decoding.
+ return true ;
+ }
+
bool res = true;
if (mRawImage.isNull())
{
@@ -1642,7 +1660,7 @@ void LLTextureFetch::sendRequestListToSimulators()
S32 packet = req->mLastPacket + 1;
gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
gMessageSystem->addUUIDFast(_PREHASH_Image, req->mID);
- gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, (S8)req->mSimRequestedDiscard);
+ gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, (S8)req->mDesiredDiscard);
gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, req->mImagePriority);
gMessageSystem->addU32Fast(_PREHASH_Packet, packet);
gMessageSystem->addU8Fast(_PREHASH_Type, req->mType);