Skip to content

Commit

Permalink
viewer#3147 Thumbnail picker's image is grey #2
Browse files Browse the repository at this point in the history
Apparently made a blunder in previous commit since I missed mFetchState
being reset each run
  • Loading branch information
akleshchev committed Nov 27, 2024
1 parent a90377d commit 79fe883
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
20 changes: 13 additions & 7 deletions indra/newview/lltexturefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1503,18 +1503,13 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
if (http_not_found == mGetStatus)
{
if (mFTType != FTT_MAP_TILE)
{
LL_WARNS(LOG_TXT) << "Texture missing from server (404): " << mUrl << LL_ENDL;
}

if(mWriteToCacheState == NOT_WRITE) //map tiles or server bakes
{
setState(DONE);
releaseHttpSemaphore();
if (mFTType != FTT_MAP_TILE)
{
LL_WARNS(LOG_TXT) << mID << " abort: WAIT_HTTP_REQ not found" << LL_ENDL;
LL_WARNS(LOG_TXT) << mID << "NOT_WRITE texture missing from server (404), abort: " << mUrl << LL_ENDL;
}
return true;
}
Expand All @@ -1524,6 +1519,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
LLViewerRegion* region = getRegion();
if (!region || mLastRegionId != region->getRegionID())
{
if (mFTType != FTT_MAP_TILE)
{
LL_INFOS(LOG_TXT) << "Texture missing from server (404), retrying: " << mUrl << " mRetryAttempt " << mRetryAttempt << LL_ENDL;
}
// cap failure? try on new region.
mUrl.clear();
++mRetryAttempt;
Expand All @@ -1532,6 +1531,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
return false;
}
}

if (mFTType != FTT_MAP_TILE)
{
LL_WARNS(LOG_TXT) << "Texture missing from server (404): " << mUrl << LL_ENDL;
}
}
else if (http_service_unavail == mGetStatus)
{
Expand Down Expand Up @@ -2734,7 +2738,7 @@ LLTextureFetchWorker* LLTextureFetch::getWorker(const LLUUID& id)


// Threads: T*
bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,
bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, S32& worker_state,
LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux,
LLCore::HttpStatus& last_http_get_status)
{
Expand All @@ -2743,6 +2747,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,
LLTextureFetchWorker* worker = getWorker(id);
if (worker)
{
worker_state = worker->mState;
if (worker->wasAborted())
{
res = true;
Expand Down Expand Up @@ -2821,6 +2826,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,
}
else
{
worker_state = 0;
res = true;
}
return res;
Expand Down
2 changes: 1 addition & 1 deletion indra/newview/lltexturefetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class LLTextureFetch : public LLWorkerThread

// Threads: T*
// keep in mind that if fetcher isn't done, it still might need original raw image
bool getRequestFinished(const LLUUID& id, S32& discard_level,
bool getRequestFinished(const LLUUID& id, S32& discard_level, S32& worker_state,
LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux,
LLCore::HttpStatus& last_http_get_status);

Expand Down
3 changes: 2 additions & 1 deletion indra/newview/llviewertexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ bool LLViewerFetchedTexture::updateFetch()
if (mRawImage.notNull()) sRawCount--;
if (mAuxRawImage.notNull()) sAuxCount--;
// keep in mind that fetcher still might need raw image, don't modify original
bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage,
bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mFetchState, mRawImage, mAuxRawImage,
mLastHttpGetStatus);
if (mRawImage.notNull()) sRawCount++;
if (mAuxRawImage.notNull())
Expand Down Expand Up @@ -1979,6 +1979,7 @@ bool LLViewerFetchedTexture::updateFetch()
<< " mRawDiscardLevel " << mRawDiscardLevel
<< " current_discard " << current_discard
<< " stats " << mLastHttpGetStatus.toHex()
<< " worker state " << mFetchState
<< LL_ENDL;
}
setIsMissingAsset();
Expand Down

0 comments on commit 79fe883

Please sign in to comment.