aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorthickbrick2010-10-16 03:16:14 +0200
committerMcCabe Maxsted2010-10-16 17:32:57 -0700
commit17c1840637925c1165e434b502d09ee82a3d4942 (patch)
treefa16b0f14d2c881bd468e2d2f7fbe771bf35356e
parentChanged the display of the GCC version to add more information on the compile... (diff)
downloadmeta-impy-17c1840637925c1165e434b502d09ee82a3d4942.zip
meta-impy-17c1840637925c1165e434b502d09ee82a3d4942.tar.gz
meta-impy-17c1840637925c1165e434b502d09ee82a3d4942.tar.bz2
meta-impy-17c1840637925c1165e434b502d09ee82a3d4942.tar.xz
Port of SNOW-802: Use UDP for baked textures.
Port of SNOW-802 from SG1. Originally ported by Robin cornelius from SG 2.1. Also added a paramter can_use_http to the LLTextureFetchWorker constructor, to avoid messing with locks.
-rw-r--r--linden/indra/newview/lltexturefetch.cpp12
-rw-r--r--linden/indra/newview/lltexturefetch.h2
-rw-r--r--linden/indra/newview/llviewerimage.cpp6
-rw-r--r--linden/indra/newview/llviewerimage.h4
-rw-r--r--linden/indra/newview/llvoavatar.cpp1
5 files changed, 17 insertions, 8 deletions
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp
index 5cad14c..b5ad435 100644
--- a/linden/indra/newview/lltexturefetch.cpp
+++ b/linden/indra/newview/lltexturefetch.cpp
@@ -176,7 +176,7 @@ protected:
176 LLTextureFetchWorker(LLTextureFetch* fetcher, const LLUUID& id, const LLHost& host, 176 LLTextureFetchWorker(LLTextureFetch* fetcher, const LLUUID& id, const LLHost& host,
177 F32 priority, S32 discard, S32 size); 177 F32 priority, S32 discard, S32 size);
178 LLTextureFetchWorker(LLTextureFetch* fetcher, const std::string& url, const LLUUID& id, const LLHost& host, 178 LLTextureFetchWorker(LLTextureFetch* fetcher, const std::string& url, const LLUUID& id, const LLHost& host,
179 F32 priority, S32 discard, S32 size); 179 F32 priority, S32 discard, S32 size, bool can_use_http);
180 180
181private: 181private:
182 /*virtual*/ void startWork(S32 param); // called from addWork() (MAIN THREAD) 182 /*virtual*/ void startWork(S32 param); // called from addWork() (MAIN THREAD)
@@ -388,7 +388,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
388 const LLHost& host, // Simulator host 388 const LLHost& host, // Simulator host
389 F32 priority, // Priority 389 F32 priority, // Priority
390 S32 discard, // Desired discard 390 S32 discard, // Desired discard
391 S32 size) // Desired size 391 S32 size, // Desired size
392 bool can_use_http) // Try HTTP first
392 : LLWorkerClass(fetcher, "TextureFetch"), 393 : LLWorkerClass(fetcher, "TextureFetch"),
393 mState(INIT), 394 mState(INIT),
394 mWriteToCacheState(NOT_WRITE), 395 mWriteToCacheState(NOT_WRITE),
@@ -420,7 +421,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
420 mNeedsAux(FALSE), 421 mNeedsAux(FALSE),
421 mHaveAllData(FALSE), 422 mHaveAllData(FALSE),
422 mInLocalCache(FALSE), 423 mInLocalCache(FALSE),
423 mCanUseHTTP(true), 424 mCanUseHTTP(can_use_http),
424 mHTTPFailCount(0), 425 mHTTPFailCount(0),
425 mRetryAttempt(0), 426 mRetryAttempt(0),
426 mActiveCount(0), 427 mActiveCount(0),
@@ -1506,7 +1507,7 @@ LLTextureFetch::~LLTextureFetch()
1506} 1507}
1507 1508
1508bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, 1509bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
1509 S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux) 1510 S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http)
1510{ 1511{
1511 if (mDebugPause) 1512 if (mDebugPause)
1512 { 1513 {
@@ -1568,6 +1569,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
1568 worker->lockWorkMutex(); 1569 worker->lockWorkMutex();
1569 worker->setImagePriority(priority); 1570 worker->setImagePriority(priority);
1570 worker->setDesiredDiscard(desired_discard, desired_size); 1571 worker->setDesiredDiscard(desired_discard, desired_size);
1572 worker->setCanUseHTTP(can_use_http);
1571 worker->unlockWorkMutex(); 1573 worker->unlockWorkMutex();
1572 if (!worker->haveWork()) 1574 if (!worker->haveWork())
1573 { 1575 {
@@ -1583,7 +1585,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
1583 } 1585 }
1584 else 1586 else
1585 { 1587 {
1586 worker = new LLTextureFetchWorker(this, url, id, host, priority, desired_discard, desired_size); 1588 worker = new LLTextureFetchWorker(this, url, id, host, priority, desired_discard, desired_size, can_use_http);
1587 mRequestMap[id] = worker; 1589 mRequestMap[id] = worker;
1588 } 1590 }
1589 worker->mActiveCount++; 1591 worker->mActiveCount++;
diff --git a/linden/indra/newview/lltexturefetch.h b/linden/indra/newview/lltexturefetch.h
index 5eca0ba..6c6bb52 100644
--- a/linden/indra/newview/lltexturefetch.h
+++ b/linden/indra/newview/lltexturefetch.h
@@ -60,7 +60,7 @@ public:
60 /*virtual*/ S32 update(U32 max_time_ms); 60 /*virtual*/ S32 update(U32 max_time_ms);
61 61
62 bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, 62 bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
63 S32 w, S32 h, S32 c, S32 discard, bool needs_aux); 63 S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool use_http);
64 void deleteRequest(const LLUUID& id, bool cancel); 64 void deleteRequest(const LLUUID& id, bool cancel);
65 bool getRequestFinished(const LLUUID& id, S32& discard_level, 65 bool getRequestFinished(const LLUUID& id, S32& discard_level,
66 LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); 66 LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux);
diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp
index 400fb2f..4f23a05 100644
--- a/linden/indra/newview/llviewerimage.cpp
+++ b/linden/indra/newview/llviewerimage.cpp
@@ -346,6 +346,8 @@ void LLViewerImage::init(bool firstinit)
346 mForceToSaveRawImage = FALSE ; 346 mForceToSaveRawImage = FALSE ;
347 mSavedRawDiscardLevel = -1 ; 347 mSavedRawDiscardLevel = -1 ;
348 mDesiredSavedRawDiscardLevel = -1 ; 348 mDesiredSavedRawDiscardLevel = -1 ;
349
350 mCanUseHTTP = true; //default on if cap/settings allows us
349} 351}
350 352
351// virtual 353// virtual
@@ -1213,7 +1215,7 @@ bool LLViewerImage::updateFetch()
1213 // bypass texturefetch directly by pulling from LLTextureCache 1215 // bypass texturefetch directly by pulling from LLTextureCache
1214 bool fetch_request_created = false; 1216 bool fetch_request_created = false;
1215 fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), decode_priority, 1217 fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), decode_priority,
1216 w, h, c, desired_discard, needsAux()); 1218 w, h, c, desired_discard, needsAux(), mCanUseHTTP);
1217 1219
1218 if (fetch_request_created) 1220 if (fetch_request_created)
1219 { 1221 {
@@ -1292,7 +1294,7 @@ BOOL LLViewerImage::forceFetch()
1292 c = getComponents(); 1294 c = getComponents();
1293 } 1295 }
1294 fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), maxDecodePriority(), 1296 fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), maxDecodePriority(),
1295 w, h, c, desired_discard, needsAux()); 1297 w, h, c, desired_discard, needsAux(), mCanUseHTTP);
1296 1298
1297 if (fetch_request_created) 1299 if (fetch_request_created)
1298 { 1300 {
diff --git a/linden/indra/newview/llviewerimage.h b/linden/indra/newview/llviewerimage.h
index c82b68b..3bee51c 100644
--- a/linden/indra/newview/llviewerimage.h
+++ b/linden/indra/newview/llviewerimage.h
@@ -314,6 +314,8 @@ public:
314 void addFace(LLFace* facep) ; 314 void addFace(LLFace* facep) ;
315 void removeFace(LLFace* facep) ; 315 void removeFace(LLFace* facep) ;
316 316
317 void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;};
318
317 friend class LocalBitmap; // tag: vaa emerald local_asset_browser 319 friend class LocalBitmap; // tag: vaa emerald local_asset_browser
318 320
319private: 321private:
@@ -418,6 +420,8 @@ private:
418 typedef std::list<LLFace*> ll_face_list_t ; 420 typedef std::list<LLFace*> ll_face_list_t ;
419 ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture 421 ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture
420 422
423 bool mCanUseHTTP; // can this image be fetched by http
424
421public: 425public:
422 static const U32 sCurrentFileVersion; 426 static const U32 sCurrentFileVersion;
423 // Default textures 427 // Default textures
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index d2aa3d8..7bbaf48 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -5196,6 +5196,7 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerImage* imagep,
5196 5196
5197void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) 5197void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level)
5198{ 5198{
5199 imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures.
5199 mMaxPixelArea = llmax(pixel_area, mMaxPixelArea); 5200 mMaxPixelArea = llmax(pixel_area, mMaxPixelArea);
5200 mMinPixelArea = llmin(pixel_area, mMinPixelArea); 5201 mMinPixelArea = llmin(pixel_area, mMinPixelArea);
5201 imagep->addTextureStats(pixel_area / texel_area_ratio); 5202 imagep->addTextureStats(pixel_area / texel_area_ratio);