Skip to content

Commit a0b5649

Browse files
committed
#3093 #3055 World Map tiles are blurry #2
1 parent 2cdf67c commit a0b5649

File tree

4 files changed

+227
-127
lines changed

4 files changed

+227
-127
lines changed

indra/newview/lltexturefetch.cpp

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
24812481
LL_PROFILE_ZONE_SCOPED;
24822482
if (mDebugPause)
24832483
{
2484-
return -1;
2484+
return CREATE_REQUEST_ERROR_DEFAULT;
24852485
}
24862486

24872487
if (f_type == FTT_SERVER_BAKE)
@@ -2497,7 +2497,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
24972497
<< host << " != " << worker->mHost << LL_ENDL;
24982498
removeRequest(worker, true);
24992499
worker = NULL;
2500-
return -1;
2500+
return CREATE_REQUEST_ERROR_MHOSTS;
25012501
}
25022502
}
25032503

@@ -2550,13 +2550,13 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
25502550
{
25512551
if (worker->wasAborted())
25522552
{
2553-
return -1; // need to wait for previous aborted request to complete
2553+
return CREATE_REQUEST_ERROR_ABORTED; // need to wait for previous aborted request to complete
25542554
}
25552555
worker->lockWorkMutex(); // +Mw
25562556
if (worker->mState == LLTextureFetchWorker::DONE && worker->mDesiredSize == llmax(desired_size, TEXTURE_CACHE_ENTRY_SIZE) && worker->mDesiredDiscard == desired_discard) {
25572557
worker->unlockWorkMutex(); // -Mw
25582558

2559-
return -1; // similar request has failed or is in a transitional state
2559+
return CREATE_REQUEST_ERROR_TRANSITION; // similar request has finished, failed or is in a transitional state
25602560
}
25612561
worker->mActiveCount++;
25622562
worker->mNeedsAux = needs_aux;
@@ -3149,6 +3149,43 @@ S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& r
31493149
return state;
31503150
}
31513151

3152+
// Threads: T*
3153+
S32 LLTextureFetch::getLastFetchState(const LLUUID& id, S32& requested_discard, S32& decoded_discard, bool& decoded)
3154+
{
3155+
LL_PROFILE_ZONE_SCOPED;
3156+
S32 state = LLTextureFetchWorker::INVALID;
3157+
3158+
LLTextureFetchWorker* worker = getWorker(id);
3159+
if (worker) // Don't check haveWork, intent is to get whatever is in the worker
3160+
{
3161+
worker->lockWorkMutex(); // +Mw
3162+
state = worker->mState;
3163+
requested_discard = worker->mDesiredDiscard;
3164+
decoded_discard = worker->mDecodedDiscard;
3165+
decoded = worker->mDecoded;
3166+
worker->unlockWorkMutex(); // -Mw
3167+
}
3168+
return state;
3169+
}
3170+
3171+
// Threads: T*
3172+
S32 LLTextureFetch::getLastRawImage(const LLUUID& id,
3173+
LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux)
3174+
{
3175+
LL_PROFILE_ZONE_SCOPED;
3176+
S32 decoded_discard = -1;
3177+
LLTextureFetchWorker* worker = getWorker(id);
3178+
if (worker && !worker->haveWork() && worker->mDecodedDiscard >= 0)
3179+
{
3180+
worker->lockWorkMutex(); // +Mw
3181+
raw = worker->mRawImage;
3182+
aux = worker->mAuxImage;
3183+
decoded_discard = worker->mDecodedDiscard;
3184+
worker->unlockWorkMutex(); // -Mw
3185+
}
3186+
return decoded_discard;
3187+
}
3188+
31523189
void LLTextureFetch::dump()
31533190
{
31543191
LL_INFOS(LOG_TXT) << "LLTextureFetch ACTIVE_HTTP:" << LL_ENDL;

indra/newview/lltexturefetch.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ class LLTextureFetch : public LLWorkerThread
7676
// Threads: Tmain
7777
void shutDownImageDecodeThread();
7878

79+
enum e_crete_request_errors
80+
{
81+
CREATE_REQUEST_ERROR_DEFAULT = -1,
82+
CREATE_REQUEST_ERROR_MHOSTS = -2,
83+
CREATE_REQUEST_ERROR_ABORTED = -3,
84+
CREATE_REQUEST_ERROR_TRANSITION = -4,
85+
};
86+
7987
// Threads: T* (but Tmain mostly)
8088
S32 createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
8189
S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http);
@@ -114,12 +122,20 @@ class LLTextureFetch : public LLWorkerThread
114122
// get the current fetch state, if any, from the given UUID
115123
S32 getFetchState(const LLUUID& id);
116124

117-
// @return Fetch state of given image and associates statistics
125+
// @return Fetch state of an active given image and associates statistics
118126
// See also getStateString
119127
// Threads: T*
120128
S32 getFetchState(const LLUUID& id, F32& decode_progress_p, F32& requested_priority_p,
121129
U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p, bool& can_use_http);
122130

131+
// @return Fetch last state of given image
132+
// Threads: T*
133+
S32 getLastFetchState(const LLUUID& id, S32& requested_discard, S32 &decoded_discard, bool &decoded);
134+
135+
// @return Fetch last raw image
136+
// Threads: T*
137+
S32 getLastRawImage(const LLUUID& id, LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux);
138+
123139
// Debug utility - generally not safe
124140
void dump();
125141

0 commit comments

Comments
 (0)