aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-06-11 15:33:50 -0700
committerJacek Antonelli2010-06-19 02:43:36 -0500
commitfdc7345795c65ef7af17246c00067301210d1812 (patch)
tree9b76f885cf9f61d8ff9cb2f169e00678b2b9e9ba /linden/indra/newview/lltexturefetch.cpp
parentApplied slviewer-0-v12350-AllowInvisibleTextureInPicker_v2.patch by Henri Bea... (diff)
downloadmeta-impy-fdc7345795c65ef7af17246c00067301210d1812.zip
meta-impy-fdc7345795c65ef7af17246c00067301210d1812.tar.gz
meta-impy-fdc7345795c65ef7af17246c00067301210d1812.tar.bz2
meta-impy-fdc7345795c65ef7af17246c00067301210d1812.tar.xz
Applied patch by Thickbrick Sleaford for SNOW-712: HTTP-fetched textures are not always decoded
Diffstat (limited to 'linden/indra/newview/lltexturefetch.cpp')
-rw-r--r--linden/indra/newview/lltexturefetch.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp
index 4175012..310eeda 100644
--- a/linden/indra/newview/lltexturefetch.cpp
+++ b/linden/indra/newview/lltexturefetch.cpp
@@ -789,7 +789,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
789 if (mState == SEND_HTTP_REQ) 789 if (mState == SEND_HTTP_REQ)
790 { 790 {
791 { 791 {
792 const S32 HTTP_QUEUE_MAX_SIZE = 32; 792 const S32 HTTP_QUEUE_MAX_SIZE = 8;
793 // *TODO: Integrate this with llviewerthrottle 793 // *TODO: Integrate this with llviewerthrottle
794 // Note: LLViewerThrottle uses dynamic throttling which makes sense for UDP, 794 // Note: LLViewerThrottle uses dynamic throttling which makes sense for UDP,
795 // but probably not for Textures. 795 // but probably not for Textures.
@@ -808,6 +808,13 @@ bool LLTextureFetchWorker::doWork(S32 param)
808 if (mFormattedImage.notNull()) 808 if (mFormattedImage.notNull())
809 { 809 {
810 cur_size = mFormattedImage->getDataSize(); // amount of data we already have 810 cur_size = mFormattedImage->getDataSize(); // amount of data we already have
811 if (mFormattedImage->getDiscardLevel() == 0)
812 {
813 // We already have all the data, just decode it
814 mLoadedDiscard = mFormattedImage->getDiscardLevel();
815 mState = DECODE_IMAGE;
816 return false;
817 }
811 } 818 }
812 mRequestedSize = mDesiredSize; 819 mRequestedSize = mDesiredSize;
813 mRequestedDiscard = mDesiredDiscard; 820 mRequestedDiscard = mDesiredDiscard;
@@ -1202,8 +1209,10 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
1202 mBuffer = new U8[data_size]; 1209 mBuffer = new U8[data_size];
1203 buffer->readAfter(channels.in(), NULL, mBuffer, data_size); 1210 buffer->readAfter(channels.in(), NULL, mBuffer, data_size);
1204 mBufferSize += data_size; 1211 mBufferSize += data_size;
1205 if (data_size < mRequestedSize || last_block == true) 1212 if (data_size < mRequestedSize &&
1213 (mRequestedDiscard == MAX_DISCARD_LEVEL || mRequestedSize >= MAX_IMAGE_DATA_SIZE) )
1206 { 1214 {
1215 // We requested whole image (by discard or by size,) so assume we got it
1207 mHaveAllData = TRUE; 1216 mHaveAllData = TRUE;
1208 } 1217 }
1209 else if (data_size > mRequestedSize) 1218 else if (data_size > mRequestedSize)