Snowgobe 1.4.2 to 1.5.0 patch part 1 (no rejects)

This commit is contained in:
Siana Gearz
2010-10-18 10:25:32 +02:00
parent 8148416f42
commit babc0dc420
15 changed files with 410 additions and 227 deletions

View File

@@ -336,6 +336,8 @@ JB Kraft
VWR-7802 VWR-7802
Joghert LeSabre Joghert LeSabre
VWR-64 VWR-64
Jonathan Yap
VWR-8999
Kage Pixel Kage Pixel
VWR-11 VWR-11
Ken March Ken March

View File

@@ -72,6 +72,21 @@ if (WINDOWS)
if (NOT VS_DISABLE_FATAL_WARNINGS) if (NOT VS_DISABLE_FATAL_WARNINGS)
add_definitions(/WX) add_definitions(/WX)
endif (NOT VS_DISABLE_FATAL_WARNINGS) endif (NOT VS_DISABLE_FATAL_WARNINGS)
# Various libs are compiler specific, generate some variables here we can just use
# when we require them instead of reimplementing the test each time.
if (MSVC71)
set(MSVC_DIR 7.1)
set(MSVC_SUFFIX 71)
elseif (MSVC80)
set(MSVC_DIR 8.0)
set(MSVC_SUFFIX 80)
elseif (MSVC90)
set(MSVC_DIR 9.0)
set(MSVC_SUFFIX 90)
endif (MSVC71)
endif (WINDOWS) endif (WINDOWS)

View File

@@ -11,8 +11,8 @@ else (STANDALONE)
use_prebuilt_binary(jsoncpp) use_prebuilt_binary(jsoncpp)
if (WINDOWS) if (WINDOWS)
set(JSONCPP_LIBRARIES set(JSONCPP_LIBRARIES
debug json_vc80d debug json_vc${MSVC_SUFFIX}d
optimized json_vc80) optimized json_vc${MSVC_SUFFIX})
elseif (DARWIN) elseif (DARWIN)
set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt) set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt)
elseif (LINUX) elseif (LINUX)

View File

@@ -73,7 +73,7 @@ ENDMACRO(ADD_SIMULATOR_BUILD_TEST name parent)
MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files) MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
# Optional additional parameter: pathname of Python wrapper script # Optional additional parameter: pathname of Python wrapper script
SET(wrapper "${ARGN}") SET(wrapper "${ARGN}")
#MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} wrapper = ${wrapper}") #MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} libraries = \"${libraries}\"; source_files = \"${source_files}\"; wrapper = \"${wrapper}\"")
SET(TEST_SOURCE_FILES ${source_files}) SET(TEST_SOURCE_FILES ${source_files})
SET(HEADER "${name}.h") SET(HEADER "${name}.h")
@@ -96,11 +96,19 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
ENDIF ("${wrapper}" STREQUAL "") ENDIF ("${wrapper}" STREQUAL "")
#MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} test_cmd = ${TEST_CMD}") #MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} test_cmd = ${TEST_CMD}")
#MESSAGE(STATUS "CMAKE_BINARY_DIR = \"${CMAKE_BINARY_DIR}\"")
SET(LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/llcommon:/usr/lib:/usr/local/lib")
IF (NOT "${ARCH_PREBUILT_DIRS}" STREQUAL "")
SET(LD_LIBRARY_PATH "${ARCH_PREBUILT_DIRS}:${LD_LIBRARY_PATH}")
ENDIF (NOT "${ARCH_PREBUILT_DIRS}" STREQUAL "")
IF (NOT "$ENV{LD_LIBRARY_PATH}" STREQUAL "")
SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}")
ENDIF (NOT "$ENV{LD_LIBRARY_PATH}" STREQUAL "")
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${TEST_OUTPUT} OUTPUT ${TEST_OUTPUT}
COMMAND COMMAND
${CMAKE_COMMAND} ${CMAKE_COMMAND}
"-DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib" "-DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
"-DTEST_CMD:STRING=${TEST_CMD}" "-DTEST_CMD:STRING=${TEST_CMD}"
-P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
DEPENDS ${name}_test DEPENDS ${name}_test

View File

@@ -30,6 +30,7 @@ set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX}) set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX}) set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX}) set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
"Location of prebuilt libraries.") "Location of prebuilt libraries.")

View File

@@ -46,7 +46,7 @@ void LLCurl::Responder::completed(U32 status, std::basic_string<char, std::char_
} }
else else
{ {
error(status, reason, mContent); errorWithContent(status, reason, mContent);
} }
} }
@@ -63,7 +63,7 @@ void LLCurl::Responder::completedRaw(unsigned,
{ {
} }
void LLCurl::Responder::error(unsigned, void LLCurl::Responder::errorWithContent(unsigned,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
LLSD const&) LLSD const&)
{ {

View File

@@ -3003,6 +3003,17 @@
<key>Value</key> <key>Value</key>
<integer>1</integer> <integer>1</integer>
</map> </map>
<key>ChatSpacing</key>
<map>
<key>Comment</key>
<string>Add extra vertical spacing between local chat lines</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ChatVisible</key> <key>ChatVisible</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -206,11 +206,26 @@ void LLConsole::draw()
F32 line_height = mFont->getLineHeight(); F32 line_height = mFont->getLineHeight();
S32 message_spacing=4; S32 message_spacing = 0;
//080813 Spatters: This section makes a single huge black box behind all the text. //080813 Spatters: This section makes a single huge black box behind all the text.
S32 bkg_height=4; S32 bkg_height=8;
S32 bkg_width=0; S32 bkg_width=0;
// VWR-8999
// ChatSpacing: 0 -- chat lines are close together, as they were in the 1.20 viewer.
// 4 -- chat lines are farther apart as they are in SnowGlobe 1.4.
static LLCachedControl<S32> chat_spacing("ChatSpacing", 0);
// Perform clamping.
S32 const clamped_chat_spacing = llclamp((S32)chat_spacing, -16, 128);
if (chat_spacing != clamped_chat_spacing)
{
gSavedSettings.setS32("ChatSpacing", clamped_chat_spacing);
}
// Adjust spacing.
message_spacing += chat_spacing;
bkg_height -= chat_spacing;
for(paragraph_it = mParagraphs.rbegin(); paragraph_it != mParagraphs.rend(); paragraph_it++) for(paragraph_it = mParagraphs.rbegin(); paragraph_it != mParagraphs.rend(); paragraph_it++)
{ {
S32 target_height = llfloor( (*paragraph_it)->mLines.size() * line_height + message_spacing); S32 target_height = llfloor( (*paragraph_it)->mLines.size() * line_height + message_spacing);

View File

@@ -868,7 +868,7 @@ bool LLTextureCache::updateTextureEntryList(const LLUUID& id, S32 bodysize)
//static //static
const S32 MAX_REASONABLE_FILE_SIZE = 512*1024*1024; // 512 MB const S32 MAX_REASONABLE_FILE_SIZE = 512*1024*1024; // 512 MB
F32 LLTextureCache::sHeaderCacheVersion = 1.2f; F32 LLTextureCache::sHeaderCacheVersion = 1.4f;
U32 LLTextureCache::sCacheMaxEntries = MAX_REASONABLE_FILE_SIZE / TEXTURE_CACHE_ENTRY_SIZE; U32 LLTextureCache::sCacheMaxEntries = MAX_REASONABLE_FILE_SIZE / TEXTURE_CACHE_ENTRY_SIZE;
S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit
const char* entries_filename = "texture.entries"; const char* entries_filename = "texture.entries";

View File

@@ -168,6 +168,9 @@ public:
mGetReason = reason; mGetReason = reason;
} }
void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;}
bool getCanUseHTTP()const {return mCanUseHTTP ;}
protected: protected:
LLTextureFetchWorker(LLTextureFetch* fetcher, const LLUUID& id, const LLHost& host, LLTextureFetchWorker(LLTextureFetch* fetcher, const LLUUID& id, const LLHost& host,
F32 priority, S32 discard, S32 size); F32 priority, S32 discard, S32 size);
@@ -217,8 +220,15 @@ private:
QUEUED = 1, QUEUED = 1,
SENT_SIM = 2 SENT_SIM = 2
}; };
enum e_write_to_cache_state //mWriteToCacheState
{
NOT_WRITE = 0,
CAN_WRITE = 1,
SHOULD_WRITE = 2
};
static const char* sStateDescs[]; static const char* sStateDescs[];
e_state mState; e_state mState;
e_write_to_cache_state mWriteToCacheState;
LLTextureFetch* mFetcher; LLTextureFetch* mFetcher;
LLPointer<LLImageFormatted> mFormattedImage; LLPointer<LLImageFormatted> mFormattedImage;
LLPointer<LLImageRaw> mRawImage; LLPointer<LLImageRaw> mRawImage;
@@ -253,6 +263,8 @@ private:
BOOL mNeedsAux; BOOL mNeedsAux;
BOOL mHaveAllData; BOOL mHaveAllData;
BOOL mInLocalCache; BOOL mInLocalCache;
bool mCanUseHTTP ;
bool mCanUseNET ; //can get from asset server.
S32 mHTTPFailCount; S32 mHTTPFailCount;
S32 mRetryAttempt; S32 mRetryAttempt;
S32 mActiveCount; S32 mActiveCount;
@@ -378,6 +390,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
S32 size) // Desired size S32 size) // Desired size
: LLWorkerClass(fetcher, "TextureFetch"), : LLWorkerClass(fetcher, "TextureFetch"),
mState(INIT), mState(INIT),
mWriteToCacheState(NOT_WRITE),
mFetcher(fetcher), mFetcher(fetcher),
mID(id), mID(id),
mHost(host), mHost(host),
@@ -406,6 +419,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
mNeedsAux(FALSE), mNeedsAux(FALSE),
mHaveAllData(FALSE), mHaveAllData(FALSE),
mInLocalCache(FALSE), mInLocalCache(FALSE),
mCanUseHTTP(true),
mHTTPFailCount(0), mHTTPFailCount(0),
mRetryAttempt(0), mRetryAttempt(0),
mActiveCount(0), mActiveCount(0),
@@ -416,6 +430,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
mTotalPackets(0), mTotalPackets(0),
mImageCodec(IMG_CODEC_INVALID) mImageCodec(IMG_CODEC_INVALID)
{ {
mCanUseNET = mUrl.empty() ;
calcWorkPriority(); calcWorkPriority();
mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL; mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL;
// llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl; // llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl;
@@ -572,13 +588,25 @@ bool LLTextureFetchWorker::doWork(S32 param)
{ {
LLMutexLock lock(&mWorkMutex); LLMutexLock lock(&mWorkMutex);
if ((mFetcher->isQuitting() || (mImagePriority <= 0.0f) || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
{ {
if (mState < WRITE_TO_CACHE) if (mState < DECODE_IMAGE)
{
return true; // abort
}
}
if(mImagePriority < 1.0f)
{
if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR)
{ {
return true; // abort return true; // abort
} }
} }
if(mState > CACHE_POST && !mCanUseNET && !mCanUseHTTP)
{
//nowhere to get data, abort.
return true ;
}
if (mFetcher->mDebugPause) if (mFetcher->mDebugPause)
{ {
@@ -656,7 +684,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority,
offset, size, responder); offset, size, responder);
} }
else else if(mCanUseHTTP)
{ {
if (!(mUrl.compare(0, 7, "http://") == 0)) if (!(mUrl.compare(0, 7, "http://") == 0))
{ {
@@ -666,6 +694,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
mState = SEND_HTTP_REQ; mState = SEND_HTTP_REQ;
} }
else
{
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
mState = LOAD_FROM_NETWORK;
}
} }
if (mLoaded) if (mLoaded)
@@ -698,6 +731,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
// we have enough data, decode it // we have enough data, decode it
llassert_always(mFormattedImage->getDataSize() > 0); llassert_always(mFormattedImage->getDataSize() > 0);
mState = DECODE_IMAGE; mState = DECODE_IMAGE;
mWriteToCacheState = NOT_WRITE ;
LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize()
<< " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight())
<< " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL;
// fall through // fall through
} }
else else
@@ -726,7 +763,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
bool get_url = image_pipeline_use_http; bool get_url = image_pipeline_use_http;
if (!mUrl.empty()) get_url = false; if (!mUrl.empty()) get_url = false;
// if (mHost != LLHost::invalid) get_url = false; // if (mHost != LLHost::invalid) get_url = false;
if ( get_url ) if ( get_url && mCanUseHTTP && mUrl.empty())//get http url.
{ {
LLViewerRegion* region = NULL; LLViewerRegion* region = NULL;
if (mHost == LLHost::invalid) if (mHost == LLHost::invalid)
@@ -740,23 +777,35 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (!http_url.empty()) if (!http_url.empty())
{ {
mUrl = http_url + "/?texture_id=" + mID.asString().c_str(); mUrl = http_url + "/?texture_id=" + mID.asString().c_str();
mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id.
}
else
{
mCanUseHTTP = false ;
} }
} }
else else
{ {
llwarns << "Region not found for host: " << mHost << llendl; // 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 (!mUrl.empty()) if (mCanUseHTTP && !mUrl.empty())
{ {
mState = LLTextureFetchWorker::SEND_HTTP_REQ; mState = LLTextureFetchWorker::SEND_HTTP_REQ;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if(mWriteToCacheState != NOT_WRITE)
{
mWriteToCacheState = CAN_WRITE ;
}
// don't return, fall through to next state // don't return, fall through to next state
} }
else if (mSentRequest == UNSENT) else if (mSentRequest == UNSENT)
{ {
// Add this to the network queue and sit here. // Add this to the network queue and sit here.
// LLTextureFetch::update() will send off a request which will change our state // LLTextureFetch::update() will send off a request which will change our state
mWriteToCacheState = CAN_WRITE ;
mRequestedSize = mDesiredSize; mRequestedSize = mDesiredSize;
mRequestedDiscard = mDesiredDiscard; mRequestedDiscard = mDesiredDiscard;
mSentRequest = QUEUED; mSentRequest = QUEUED;
@@ -788,6 +837,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
} }
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
mState = DECODE_IMAGE; mState = DECODE_IMAGE;
mWriteToCacheState = SHOULD_WRITE ;
} }
else else
{ {
@@ -798,6 +848,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mState == SEND_HTTP_REQ) if (mState == SEND_HTTP_REQ)
{ {
if(mCanUseHTTP)
{ {
const S32 HTTP_QUEUE_MAX_SIZE = 32; const S32 HTTP_QUEUE_MAX_SIZE = 32;
// *TODO: Integrate this with llviewerthrottle // *TODO: Integrate this with llviewerthrottle
@@ -864,28 +915,82 @@ bool LLTextureFetchWorker::doWork(S32 param)
S32 cur_size = mFormattedImage.notNull() ? mFormattedImage->getDataSize() : 0; S32 cur_size = mFormattedImage.notNull() ? mFormattedImage->getDataSize() : 0;
if (mRequestedSize < 0) if (mRequestedSize < 0)
{ {
const S32 HTTP_MAX_RETRY_COUNT = 4; S32 max_attempts;
llinfos << "HTTP GET failed for: " << mUrl if (mGetStatus == HTTP_NOT_FOUND)
<< " Status: " << mGetStatus << " Reason: " << mGetReason
<< " Try:" << mHTTPFailCount+1 << "/" << HTTP_MAX_RETRY_COUNT << llendl;
if (cur_size == 0)
{ {
++mHTTPFailCount; mHTTPFailCount = max_attempts = 1; // Don't retry
if (mGetStatus == HTTP_NOT_FOUND || mHTTPFailCount >= HTTP_MAX_RETRY_COUNT) llwarns << "Texture missing from server (404): " << mUrl << llendl;
//roll back to try UDP
if(mCanUseNET)
{ {
resetFormattedData(); llinfos << "Falling back to UDP fetch for texture " << mID << llendl;
return true; // failed mState = INIT ;
mCanUseHTTP = false ;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
return false ;
} }
else else
{ {
mState = SEND_HTTP_REQ; // UDP is not an option, we are dead
return false; // retry llwarns << "No UDP fallback available for texture " << mID << llendl;
resetFormattedData();
return true; // failed
}
}
else if (mGetStatus == HTTP_SERVICE_UNAVAILABLE)
{
// *TODO: Should probably introduce a timer here to delay future HTTP requsts
// for a short time (~1s) to ease server load? Ideally the server would queue
// requests instead of returning 503... we already limit the number pending.
++mHTTPFailCount;
max_attempts = mHTTPFailCount+1; // Keep retrying
LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL;
}
else
{
const S32 HTTP_MAX_RETRY_COUNT = 3;
max_attempts = HTTP_MAX_RETRY_COUNT + 1;
++mHTTPFailCount;
llinfos << "HTTP GET failed for: " << mUrl
<< " Status: " << mGetStatus << " Reason: '" << mGetReason << "'"
<< " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl;
}
if (mHTTPFailCount >= max_attempts)
{
// Make max_attempts attempt at decoding what data we have, then bail forever on this image
if (cur_size > 0 && (mHTTPFailCount < (max_attempts+1)) )
{
// Use available data
mLoadedDiscard = mFormattedImage->getDiscardLevel();
mState = DECODE_IMAGE;
return false;
}
else
{
//roll back to try UDP
if(mCanUseNET)
{
llinfos << "Falling back to UDP fetch for texture " << mID << llendl;
mState = INIT ;
mCanUseHTTP = false ;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
return false ;
}
else
{
// UDP is not an option, we are dead
llwarns << "No UDP fallback available for texture " << mID << llendl;
resetFormattedData();
return true; // failed
}
} }
} }
else else
{ {
mState = DECODE_IMAGE; mState = SEND_HTTP_REQ;
return false; // use what we have return false; // retry
} }
} }
@@ -901,10 +1006,15 @@ bool LLTextureFetchWorker::doWork(S32 param)
} }
llassert_always(mBufferSize == cur_size + mRequestedSize); llassert_always(mBufferSize == cur_size + mRequestedSize);
if (mHaveAllData) if (mHaveAllData && mRequestedDiscard == 0) //the image file is fully loaded.
{ {
mFileSize = mBufferSize; mFileSize = mBufferSize;
} }
else //the file size is unknown.
{
mFileSize = mBufferSize + 1 ; //flag the file is not fully loaded.
}
U8* buffer = new U8[mBufferSize]; U8* buffer = new U8[mBufferSize];
if (cur_size > 0) if (cur_size > 0)
{ {
@@ -919,6 +1029,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
mBufferSize = 0; mBufferSize = 0;
mLoadedDiscard = mRequestedDiscard; mLoadedDiscard = mRequestedDiscard;
mState = DECODE_IMAGE; mState = DECODE_IMAGE;
if(mWriteToCacheState != NOT_WRITE)
{
mWriteToCacheState = SHOULD_WRITE ;
}
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
return false; return false;
} }
@@ -983,7 +1097,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mState == WRITE_TO_CACHE) if (mState == WRITE_TO_CACHE)
{ {
if (mInLocalCache || mSentRequest == UNSENT || mFormattedImage.isNull()) if (mWriteToCacheState != SHOULD_WRITE || mFormattedImage.isNull())
{ {
// If we're in a local cache or we didn't actually receive any new data, // If we're in a local cache or we didn't actually receive any new data,
// or we failed to load anything, skip // or we failed to load anything, skip
@@ -1035,8 +1149,16 @@ bool LLTextureFetchWorker::doWork(S32 param)
else else
{ {
setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
if(mDecodedDiscard<=0)
{
return true; return true;
} }
else
{
return false;
}
}
} }
return false; return false;
@@ -1379,7 +1501,7 @@ LLTextureFetch::~LLTextureFetch()
} }
bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux) S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http)
{ {
if (mDebugPause) if (mDebugPause)
{ {
@@ -1441,6 +1563,7 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con
worker->lockWorkMutex(); worker->lockWorkMutex();
worker->setImagePriority(priority); worker->setImagePriority(priority);
worker->setDesiredDiscard(desired_discard, desired_size); worker->setDesiredDiscard(desired_discard, desired_size);
worker->setCanUseHTTP(can_use_http) ;
worker->unlockWorkMutex(); worker->unlockWorkMutex();
if (!worker->haveWork()) if (!worker->haveWork())
{ {

View File

@@ -60,7 +60,7 @@ public:
/*virtual*/ S32 update(U32 max_time_ms); /*virtual*/ S32 update(U32 max_time_ms);
bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
S32 w, S32 h, S32 c, S32 discard, bool needs_aux); S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http);
void deleteRequest(const LLUUID& id, bool cancel); void deleteRequest(const LLUUID& id, bool cancel);
bool getRequestFinished(const LLUUID& id, S32& discard_level, bool getRequestFinished(const LLUUID& id, S32& discard_level,
LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux);

View File

@@ -412,6 +412,8 @@ void LLViewerImage::init(bool firstinit)
mForceToSaveRawImage = FALSE ; mForceToSaveRawImage = FALSE ;
mSavedRawDiscardLevel = -1 ; mSavedRawDiscardLevel = -1 ;
mDesiredSavedRawDiscardLevel = -1 ; mDesiredSavedRawDiscardLevel = -1 ;
mCanUseHTTP = true; //default on if cap/settings allows us
} }
// virtual // virtual
@@ -1251,7 +1253,7 @@ bool LLViewerImage::updateFetch()
// bypass texturefetch directly by pulling from LLTextureCache // bypass texturefetch directly by pulling from LLTextureCache
bool fetch_request_created = false; bool fetch_request_created = false;
fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), decode_priority, fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), decode_priority,
w, h, c, desired_discard, needsAux()); w, h, c, desired_discard, needsAux(), mCanUseHTTP);
if (fetch_request_created) if (fetch_request_created)
{ {
@@ -1330,7 +1332,7 @@ BOOL LLViewerImage::forceFetch()
c = getComponents(); c = getComponents();
} }
fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), maxDecodePriority(), fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mUrl, getID(),getTargetHost(), maxDecodePriority(),
w, h, c, desired_discard, needsAux()); w, h, c, desired_discard, needsAux(), mCanUseHTTP);
if (fetch_request_created) if (fetch_request_created)
{ {

View File

@@ -319,6 +319,9 @@ public:
void addFace(LLFace* facep) ; void addFace(LLFace* facep) ;
void removeFace(LLFace* facep) ; void removeFace(LLFace* facep) ;
void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;};
private: private:
/*virtual*/ void cleanup(); // Cleanup the LLViewerImage (so we can reinitialize it) /*virtual*/ void cleanup(); // Cleanup the LLViewerImage (so we can reinitialize it)
@@ -424,6 +427,8 @@ private:
typedef std::list<LLFace*> ll_face_list_t ; typedef std::list<LLFace*> ll_face_list_t ;
ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture
bool mCanUseHTTP; // can this image be fetched by http
public: public:
static const U32 sCurrentFileVersion; static const U32 sCurrentFileVersion;
// Default textures // Default textures

View File

@@ -5517,6 +5517,7 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerImage* imagep,
void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) void LLVOAvatar::addBakedTextureStats( LLViewerImage* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level)
{ {
imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures.
mMaxPixelArea = llmax(pixel_area, mMaxPixelArea); mMaxPixelArea = llmax(pixel_area, mMaxPixelArea);
mMinPixelArea = llmin(pixel_area, mMinPixelArea); mMinPixelArea = llmin(pixel_area, mMinPixelArea);
imagep->addTextureStats(pixel_area / texel_area_ratio); imagep->addTextureStats(pixel_area / texel_area_ratio);

View File

@@ -1,193 +1,193 @@
// Microsoft Visual C++ generated resource script. // Microsoft Visual C++ generated resource script.
// //
#include "resource.h" #include "resource.h"
#ifdef IDC_STATIC #ifdef IDC_STATIC
#undef IDC_STATIC #undef IDC_STATIC
#endif #endif
#define IDC_STATIC (-1) #define IDC_STATIC (-1)
#include "winresrc.h" #include "winresrc.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
// Commented out because it only compiles if you have MFC installed. // Commented out because it only compiles if you have MFC installed.
//#include "winres.h" //#include "winres.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources // English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32 #ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252) #pragma code_page(1252)
#endif //_WIN32 #endif //_WIN32
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// TEXTINCLUDE // TEXTINCLUDE
// //
1 TEXTINCLUDE 1 TEXTINCLUDE
BEGIN BEGIN
"resource.h\0" "resource.h\0"
END END
2 TEXTINCLUDE 2 TEXTINCLUDE
BEGIN BEGIN
"#include ""winres.h""\r\n" "#include ""winres.h""\r\n"
"\0" "\0"
END END
3 TEXTINCLUDE 3 TEXTINCLUDE
BEGIN BEGIN
"\r\n" "\r\n"
"\0" "\0"
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Icon // Icon
// //
// Icon with lowest ID value placed first to ensure application icon // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems. // remains consistent on all systems.
IDI_LL_ICON ICON "snowglobe_icon.ico" IDI_LL_ICON ICON "snowglobe_icon.ico"
IDI_LCD_LL_ICON ICON "icon1.ico" IDI_LCD_LL_ICON ICON "icon1.ico"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Dialog // Dialog
// //
SPLASHSCREEN DIALOG 32, 32, 144, 34 SPLASHSCREEN DIALOG 32, 32, 144, 34
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE
FONT 8, "MS Sans Serif" FONT 8, "MS Sans Serif"
BEGIN BEGIN
ICON IDI_LL_ICON,IDC_STATIC,7,7,20,20 ICON IDI_LL_ICON,IDC_STATIC,7,7,20,20
LTEXT "Loading Second Life...",666,36,13,91,8 LTEXT "Loading Second Life...",666,36,13,91,8
END END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// DESIGNINFO // DESIGNINFO
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO GUIDELINES DESIGNINFO
BEGIN BEGIN
"SPLASHSCREEN", DIALOG "SPLASHSCREEN", DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 137 RIGHTMARGIN, 137
VERTGUIDE, 36 VERTGUIDE, 36
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 27 BOTTOMMARGIN, 27
END END
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Cursor // Cursor
// //
TOOLGRAB CURSOR "lltoolgrab.cur" TOOLGRAB CURSOR "lltoolgrab.cur"
TOOLLAND CURSOR "lltoolland.cur" TOOLLAND CURSOR "lltoolland.cur"
TOOLZOOMIN CURSOR "lltoolzoomin.cur" TOOLZOOMIN CURSOR "lltoolzoomin.cur"
TOOLCREATE CURSOR "lltoolcreate.cur" TOOLCREATE CURSOR "lltoolcreate.cur"
ARROWDRAG CURSOR "llarrowdrag.cur" ARROWDRAG CURSOR "llarrowdrag.cur"
ARROW CURSOR "llarrow.cur" ARROW CURSOR "llarrow.cur"
NOLOCKED CURSOR "llnolocked.cur" NOLOCKED CURSOR "llnolocked.cur"
ARROWLOCKED CURSOR "llarrowlocked.cur" ARROWLOCKED CURSOR "llarrowlocked.cur"
GRABLOCKED CURSOR "llgrablocked.cur" GRABLOCKED CURSOR "llgrablocked.cur"
TOOLROTATE CURSOR "lltoolrotate.cur" TOOLROTATE CURSOR "lltoolrotate.cur"
TOOLTRANSLATE CURSOR "lltooltranslate.cur" TOOLTRANSLATE CURSOR "lltooltranslate.cur"
TOOLSCALE CURSOR "lltoolscale.cur" TOOLSCALE CURSOR "lltoolscale.cur"
TOOLCAMERA CURSOR "lltoolcamera.cur" TOOLCAMERA CURSOR "lltoolcamera.cur"
TOOLPAN CURSOR "lltoolpan.cur" TOOLPAN CURSOR "lltoolpan.cur"
TOOLFOCUS CURSOR "lltoolfocus.cur" TOOLFOCUS CURSOR "lltoolfocus.cur"
TOOLPICKOBJECT3 CURSOR "toolpickobject3.cur" TOOLPICKOBJECT3 CURSOR "toolpickobject3.cur"
ARROWCOPY CURSOR "arrowcop.cur" ARROWCOPY CURSOR "arrowcop.cur"
ARROWDRAGMULTI CURSOR "llarrowdragmulti.cur" ARROWDRAGMULTI CURSOR "llarrowdragmulti.cur"
ARROWCOPYMULTI CURSOR "arrowcopmulti.cur" ARROWCOPYMULTI CURSOR "arrowcopmulti.cur"
TOOLSIT CURSOR "toolsit.cur" TOOLSIT CURSOR "toolsit.cur"
TOOLBUY CURSOR "toolbuy.cur" TOOLBUY CURSOR "toolbuy.cur"
TOOLPAY CURSOR "toolpay.cur" TOOLPAY CURSOR "toolpay.cur"
TOOLOPEN CURSOR "toolopen.cur" TOOLOPEN CURSOR "toolopen.cur"
TOOLPIPETTE CURSOR "toolpipette.cur" TOOLPIPETTE CURSOR "toolpipette.cur"
TOOLPLAY CURSOR "toolplay.cur" TOOLPLAY CURSOR "toolplay.cur"
TOOLPAUSE CURSOR "toolpause.cur" TOOLPAUSE CURSOR "toolpause.cur"
TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" TOOLMEDIAOPEN CURSOR "toolmediaopen.cur"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Version // Version
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,0,0 FILEVERSION 1,4,0,0
PRODUCTVERSION 1,4,0,0 PRODUCTVERSION 1,4,0,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
#else #else
FILEFLAGS 0x0L FILEFLAGS 0x0L
#endif #endif
FILEOS 0x40004L FILEOS 0x40004L
FILETYPE 0x1L FILETYPE 0x1L
FILESUBTYPE 0x0L FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", "Linden Lab" VALUE "CompanyName", "Linden Lab"
VALUE "FileDescription", "Ascent" VALUE "FileDescription", "Ascent"
VALUE "FileVersion", "1.4.0.0" VALUE "FileVersion", "1.4.0.0"
VALUE "InternalName", "Second Life" VALUE "InternalName", "Second Life"
VALUE "LegalCopyright", "Copyright <20> 2001-2010, Linden Research, Inc." VALUE "LegalCopyright", "Copyright <20> 2001-2010, Linden Research, Inc."
VALUE "OriginalFilename", "Ascent.exe" VALUE "OriginalFilename", "Ascent.exe"
VALUE "ProductName", "Ascent" VALUE "ProductName", "Ascent"
VALUE "ProductVersion", "1.4.0.0" VALUE "ProductVersion", "1.4.0.0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
BEGIN BEGIN
VALUE "Translation", 0x409, 1200 VALUE "Translation", 0x409, 1200
END END
END END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Bitmap // Bitmap
// //
#endif // English (U.S.) resources #endif // English (U.S.) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED #ifndef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Generated from the TEXTINCLUDE 3 resource. // Generated from the TEXTINCLUDE 3 resource.
// //
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED #endif // not APSTUDIO_INVOKED