Automated merge with ssh://hg.lindenlab.com/dessie/viewer-public

master
Xiaohong Bao 2010-06-04 22:38:22 -06:00
commit eec00a712f
6 changed files with 37 additions and 9 deletions

View File

@ -3862,7 +3862,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>InBandwidth</key>
<map>

View File

@ -753,17 +753,22 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (region)
{
std::string http_url = region->getCapability("GetTexture");
std::string http_url = region->getHttpUrl() ;
if (!http_url.empty())
{
mUrl = http_url + "/?texture_id=" + mID.asString().c_str();
mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id.
}
else
{
mCanUseHTTP = false ;
}
}
else
{
// This will happen if not logged in or if a region deoes not have HTTP Texture enabled
//llwarns << "Region not found for host: " << mHost << llendl;
mCanUseHTTP = false;
}
}
if (mCanUseHTTP && !mUrl.empty())

View File

@ -216,6 +216,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mColoName("unknown"),
mProductSKU("unknown"),
mProductName("unknown"),
mHttpUrl(""),
mCacheLoaded(FALSE),
mCacheEntriesCount(0),
mCacheID(),
@ -1555,6 +1556,10 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
else
{
mCapabilities[name] = url;
if(name == "GetTexture")
{
mHttpUrl = url ;
}
}
}

View File

@ -291,6 +291,7 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLViewerRegion &region);
/// implements LLCapabilityProvider
virtual std::string getDescription() const;
std::string getHttpUrl() const { return mHttpUrl ;}
LLSpatialPartition* getSpatialPartition(U32 type);
public:
@ -383,6 +384,7 @@ private:
std::string mColoName;
std::string mProductSKU;
std::string mProductName;
std::string mHttpUrl ;
// Maps local ids to cache entries.

View File

@ -1447,8 +1447,14 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height)
//virtual
void LLViewerFetchedTexture::processTextureStats()
{
if(mFullyLoaded)//already loaded
if(mFullyLoaded)
{
if(mDesiredDiscardLevel <= mMinDesiredDiscardLevel)//already loaded
{
return ;
}
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
mFullyLoaded = FALSE ;
return ;
}
@ -1482,6 +1488,7 @@ void LLViewerFetchedTexture::processTextureStats()
mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2,
log((F32)mFullHeight / mKnownDrawHeight) / log_2) ;
mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ;
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
}
mKnownDrawSizeChanged = FALSE ;
@ -1514,7 +1521,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
}
if(mFullyLoaded && !mForceToSaveRawImage)//already loaded for static texture
{
return -4.0f ; //alreay fetched
return -1.0f ; //alreay fetched
}
S32 cur_discard = getCurrentDiscardLevelForFetching();
@ -1528,16 +1535,16 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
}
else if(mDesiredDiscardLevel >= cur_discard && cur_discard > -1)
{
priority = -1.0f ;
priority = -2.0f ;
}
else if(mCachedRawDiscardLevel > -1 && mDesiredDiscardLevel >= mCachedRawDiscardLevel)
{
priority = -1.0f;
priority = -3.0f;
}
else if (mDesiredDiscardLevel > getMaxDiscardLevel())
{
// Don't decode anything we don't need
priority = -1.0f;
priority = -4.0f;
}
else if ((mBoostLevel == LLViewerTexture::BOOST_UI || mBoostLevel == LLViewerTexture::BOOST_ICON) && !have_all_data)
{
@ -1551,9 +1558,14 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
// Always want high boosted images
priority = 1.f;
}
else if(mForceToSaveRawImage)
{
//force to fetch the raw image.
priority = 1.f;
}
else
{
priority = -1.f; //stop fetching
priority = -5.f; //stop fetching
}
}
else if (cur_discard < 0)
@ -1569,7 +1581,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
else if ((mMinDiscardLevel > 0) && (cur_discard <= mMinDiscardLevel))
{
// larger mips are corrupted
priority = -3.0f;
priority = -6.0f;
}
else
{
@ -2052,10 +2064,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
bool run_raw_callbacks = false;
bool need_readback = false;
mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
iter != mLoadedCallbackList.end(); )
{
LLLoadedCallbackEntry *entryp = *iter++;
mMinDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel, (S8)entryp->mDesiredDiscard) ;
if (entryp->mNeedsImageRaw)
{
if (mNeedsAux)
@ -2187,6 +2202,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
if (mLoadedCallbackList.empty())
{
gTextureList.mCallbackList.erase(this);
mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
}
// Done with any raw image data at this point (will be re-created if we still have callbacks)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB