#include <lltexturefetch.h>
Public Member Functions | |
LLTextureFetch (LLTextureCache *cache, bool threaded) | |
~LLTextureFetch () | |
S32 | update (U32 max_time_ms) |
bool | createRequest (const LLUUID &id, const LLHost &host, F32 priority, S32 w, S32 h, S32 c, S32 discard, bool needs_aux) |
bool | createRequest (const LLString &filename, const LLUUID &id, const LLHost &host, F32 priority, S32 w, S32 h, S32 c, S32 discard, bool needs_aux) |
void | deleteRequest (const LLUUID &id, bool cancel) |
bool | getRequestFinished (const LLUUID &id, S32 &discard_level, LLPointer< LLImageRaw > &raw, LLPointer< LLImageRaw > &aux) |
bool | updateRequestPriority (const LLUUID &id, F32 priority) |
bool | receiveImageHeader (const LLHost &host, const LLUUID &id, U8 codec, U16 packets, U32 totalbytes, U16 data_size, U8 *data) |
bool | receiveImagePacket (const LLHost &host, const LLUUID &id, U16 packet_num, U16 data_size, U8 *data) |
S32 | getFetchState (const LLUUID &id, F32 &decode_progress_p, F32 &requested_priority_p, U32 &fetch_priority_p, F32 &fetch_dtime_p, F32 &request_dtime_p) |
void | dump () |
S32 | getNumRequests () |
void | lockQueue () |
void | unlockQueue () |
LLTextureFetchWorker * | getWorker (const LLUUID &id) |
Public Attributes | |
LLUUID | mDebugID |
S32 | mDebugCount |
BOOL | mDebugPause |
S32 | mPacketCount |
S32 | mBadPacketCount |
Protected Member Functions | |
void | addToNetworkQueue (LLTextureFetchWorker *worker) |
void | removeFromNetworkQueue (LLTextureFetchWorker *worker) |
void | removeRequest (LLTextureFetchWorker *worker, bool cancel) |
Private Types | |
typedef std::map< LLUUID, LLTextureFetchWorker * > | map_t |
typedef std::set< LLUUID > | queue_t |
typedef std::map< LLHost, std::set< LLUUID > > | cancel_queue_t |
Private Member Functions | |
void | sendRequestListToSimulators () |
Private Attributes | |
LLMutex | mQueueMutex |
LLTextureCache * | mTextureCache |
map_t | mRequestMap |
queue_t | mNetworkQueue |
cancel_queue_t | mCancelQueue |
LLFrameTimer | mNetworkTimer |
Friends | |
class | LLTextureFetchWorker |
Definition at line 46 of file lltexturefetch.h.
typedef std::map<LLUUID,LLTextureFetchWorker*> LLTextureFetch::map_t [private] |
Definition at line 100 of file lltexturefetch.h.
typedef std::set<LLUUID> LLTextureFetch::queue_t [private] |
Definition at line 104 of file lltexturefetch.h.
typedef std::map<LLHost,std::set<LLUUID> > LLTextureFetch::cancel_queue_t [private] |
Definition at line 106 of file lltexturefetch.h.
LLTextureFetch::LLTextureFetch | ( | LLTextureCache * | cache, | |
bool | threaded | |||
) |
Definition at line 1297 of file lltexturefetch.cpp.
LLTextureFetch::~LLTextureFetch | ( | ) |
Definition at line 1308 of file lltexturefetch.cpp.
Reimplemented from LLWorkerThread.
Definition at line 1535 of file lltexturefetch.cpp.
References LLFrameTimer::getElapsedTimeF32(), mNetworkTimer, LLFrameTimer::reset(), S32, sendRequestListToSimulators(), and LLWorkerThread::update().
Referenced by LLAppViewer::cleanup(), LLViewerImageList::decodeAllImages(), LLAppViewer::mainLoop(), and update_texture_fetch().
bool LLTextureFetch::createRequest | ( | const LLUUID & | id, | |
const LLHost & | host, | |||
F32 | priority, | |||
S32 | w, | |||
S32 | h, | |||
S32 | c, | |||
S32 | discard, | |||
bool | needs_aux | |||
) |
Definition at line 1313 of file lltexturefetch.cpp.
References LLStringBase< char >::null.
Referenced by LLViewerImage::updateFetch().
bool LLTextureFetch::createRequest | ( | const LLString & | filename, | |
const LLUUID & | id, | |||
const LLHost & | host, | |||
F32 | priority, | |||
S32 | w, | |||
S32 | h, | |||
S32 | c, | |||
S32 | discard, | |||
bool | needs_aux | |||
) |
Definition at line 1319 of file lltexturefetch.cpp.
References LLWorkerClass::addWork(), LLImageJ2C::calcDataSizeJ2C(), FIRST_PACKET_SIZE, LLWorkerClass::haveWork(), LLTextureFetchWorker::INIT, LLTextureFetchWorker, llwarns, LLTextureFetchWorker::lockWorkData(), LLTextureFetchWorker::mActiveCount, MAX_DISCARD_LEVEL, MAX_IMAGE_DATA_SIZE, mDebugPause, LLTextureFetchWorker::mFileSize, LLTextureFetchWorker::mHost, LLTextureFetchWorker::mNeedsAux, mQueueMutex, mRequestMap, LLTextureFetchWorker::mState, LLTextureFetchWorker::mWorkPriority, NULL, LLQueuedThread::PRIORITY_HIGH, removeRequest(), S32, LLTextureFetchWorker::setDesiredDiscard(), LLTextureFetchWorker::setImagePriority(), LLTextureFetchWorker::unlockWorkData(), and LLWorkerClass::wasAborted().
void LLTextureFetch::deleteRequest | ( | const LLUUID & | id, | |
bool | cancel | |||
) |
Definition at line 1408 of file lltexturefetch.cpp.
References getWorker(), mQueueMutex, and removeRequest().
Referenced by LLViewerImage::setIsMissingAsset(), LLViewerImage::updateFetch(), and LLViewerImage::~LLViewerImage().
bool LLTextureFetch::getRequestFinished | ( | const LLUUID & | id, | |
S32 & | discard_level, | |||
LLPointer< LLImageRaw > & | raw, | |||
LLPointer< LLImageRaw > & | aux | |||
) |
Definition at line 1467 of file lltexturefetch.cpp.
References LLWorkerClass::addWork(), LLWorkerClass::checkWork(), getWorker(), LLWorkerClass::haveWork(), LLTextureFetchWorker::lockWorkData(), LLTextureFetchWorker::mAuxImage, mDebugPause, LLTextureFetchWorker::mDecodedDiscard, mQueueMutex, LLTextureFetchWorker::mRawImage, LLTextureFetchWorker::mState, LLTextureFetchWorker::mWorkPriority, NULL, LLQueuedThread::PRIORITY_HIGH, LLTextureFetchWorker::unlockWorkData(), LLTextureFetchWorker::WAIT_ON_WRITE, and LLWorkerClass::wasAborted().
Referenced by LLViewerImage::updateFetch().
Definition at line 1517 of file lltexturefetch.cpp.
References getWorker(), LLTextureFetchWorker::lockWorkData(), mQueueMutex, LLTextureFetchWorker::setImagePriority(), and LLTextureFetchWorker::unlockWorkData().
Referenced by LLViewerImage::updateFetch().
bool LLTextureFetch::receiveImageHeader | ( | const LLHost & | host, | |
const LLUUID & | id, | |||
U8 | codec, | |||
U16 | packets, | |||
U32 | totalbytes, | |||
U16 | data_size, | |||
U8 * | data | |||
) |
Definition at line 1754 of file lltexturefetch.cpp.
References FIRST_PACKET_SIZE, getWorker(), LLTextureFetchWorker::insertPacket(), llassert_always, llwarns, LLTextureFetchWorker::LOAD_FROM_NETWORK, LLTextureFetchWorker::LOAD_FROM_SIMULATOR, LLTextureFetchWorker::lockWorkData(), mBadPacketCount, mCancelQueue, LLTextureFetchWorker::mFileSize, LLTextureFetchWorker::mImageCodec, LLTextureFetchWorker::mLastPacket, mPacketCount, mQueueMutex, LLTextureFetchWorker::mSentRequest, LLTextureFetchWorker::mState, LLTextureFetchWorker::mTotalPackets, LLTextureFetchWorker::mWorkPriority, LLQueuedThread::PRIORITY_HIGH, S32, LLTextureFetchWorker::SENT_SIM, LLWorkerClass::setPriority(), and LLTextureFetchWorker::unlockWorkData().
Referenced by LLViewerImageList::receiveImageHeader().
bool LLTextureFetch::receiveImagePacket | ( | const LLHost & | host, | |
const LLUUID & | id, | |||
U16 | packet_num, | |||
U16 | data_size, | |||
U8 * | data | |||
) |
Definition at line 1809 of file lltexturefetch.cpp.
References getWorker(), LLTextureFetchWorker::insertPacket(), llwarns, LLTextureFetchWorker::LOAD_FROM_NETWORK, LLTextureFetchWorker::LOAD_FROM_SIMULATOR, LLTextureFetchWorker::lockWorkData(), mBadPacketCount, mCancelQueue, LLTextureFetchWorker::mLastPacket, mPacketCount, mQueueMutex, LLTextureFetchWorker::mState, LLTextureFetchWorker::mWorkPriority, LLQueuedThread::PRIORITY_HIGH, removeFromNetworkQueue(), LLWorkerClass::setPriority(), and LLTextureFetchWorker::unlockWorkData().
Referenced by LLViewerImageList::receiveImagePacket().
S32 LLTextureFetch::getFetchState | ( | const LLUUID & | id, | |
F32 & | decode_progress_p, | |||
F32 & | requested_priority_p, | |||
U32 & | fetch_priority_p, | |||
F32 & | fetch_dtime_p, | |||
F32 & | request_dtime_p | |||
) |
Definition at line 1864 of file lltexturefetch.cpp.
References FIRST_PACKET_SIZE, LLFrameTimer::getElapsedTimeF32(), LLWorkerClass::getPriority(), getWorker(), LLWorkerClass::haveWork(), LLTextureFetchWorker::INVALID, llmax(), LLTextureFetchWorker::LOAD_FROM_HTTP_GET_DATA, LLTextureFetchWorker::LOAD_FROM_NETWORK, LLTextureFetchWorker::LOAD_FROM_SIMULATOR, LLTextureFetchWorker::lockWorkData(), MAX_IMG_PACKET_SIZE, LLTextureFetchWorker::mFetchTimer, LLTextureFetchWorker::mFileSize, LLTextureFetchWorker::mFormattedImage, LLTextureFetchWorker::mImagePriority, LLTextureFetchWorker::mLastPacket, mQueueMutex, LLTextureFetchWorker::mRequestedPriority, LLTextureFetchWorker::mRequestedTimer, LLTextureFetchWorker::mState, LLPointer< Type >::notNull(), S32, and LLTextureFetchWorker::unlockWorkData().
Referenced by LLViewerImage::updateFetch().
void LLTextureFetch::dump | ( | ) |
Definition at line 1914 of file lltexturefetch.cpp.
References LLQueuedThread::QueuedRequest::getPriority(), LLWorkerThread::WorkRequest::getWorkerClass(), llformat(), llinfos, LLTextureFetchWorker::mID, LLQueuedThread::mRequestQueue, LLTextureFetchWorker::mState, and LLTextureFetchWorker::sStateDescs.
S32 LLTextureFetch::getNumRequests | ( | ) | [inline] |
Definition at line 72 of file lltexturefetch.h.
References mRequestMap.
Referenced by LLGLTexMemBar::draw().
void LLTextureFetch::lockQueue | ( | ) | [inline] |
Definition at line 75 of file lltexturefetch.h.
References LLMutex::lock(), and mQueueMutex.
Referenced by LLTextureFetchWorker::DecodeResponder::completed(), LLTextureFetchWorker::CacheWriteResponder::completed(), LLTextureFetchWorker::CacheReadResponder::completed(), and LLTextureFetchWorker::doWork().
void LLTextureFetch::unlockQueue | ( | ) | [inline] |
Definition at line 76 of file lltexturefetch.h.
References mQueueMutex, and LLMutex::unlock().
Referenced by LLTextureFetchWorker::DecodeResponder::completed(), LLTextureFetchWorker::CacheWriteResponder::completed(), LLTextureFetchWorker::CacheReadResponder::completed(), and LLTextureFetchWorker::doWork().
LLTextureFetchWorker * LLTextureFetch::getWorker | ( | const LLUUID & | id | ) |
Definition at line 1455 of file lltexturefetch.cpp.
References mRequestMap, and NULL.
Referenced by LLTextureFetchWorker::DecodeResponder::completed(), LLTextureFetchWorker::CacheWriteResponder::completed(), LLTextureFetchWorker::CacheReadResponder::completed(), deleteRequest(), getFetchState(), getRequestFinished(), receiveImageHeader(), receiveImagePacket(), sendRequestListToSimulators(), and updateRequestPriority().
void LLTextureFetch::addToNetworkQueue | ( | LLTextureFetchWorker * | worker | ) | [protected] |
Definition at line 1421 of file lltexturefetch.cpp.
References mCancelQueue, LLTextureFetchWorker::mID, mNetworkQueue, and mRequestMap.
Referenced by LLTextureFetchWorker::doWork().
void LLTextureFetch::removeFromNetworkQueue | ( | LLTextureFetchWorker * | worker | ) | [protected] |
Definition at line 1437 of file lltexturefetch.cpp.
References LLTextureFetchWorker::mID, and mNetworkQueue.
Referenced by LLTextureFetchWorker::doWork(), and receiveImagePacket().
void LLTextureFetch::removeRequest | ( | LLTextureFetchWorker * | worker, | |
bool | cancel | |||
) | [protected] |
Definition at line 1443 of file lltexturefetch.cpp.
References mCancelQueue, LLTextureFetchWorker::mHost, LLTextureFetchWorker::mID, mNetworkQueue, mRequestMap, and LLWorkerClass::scheduleDelete().
Referenced by createRequest(), and deleteRequest().
void LLTextureFetch::sendRequestListToSimulators | ( | ) | [private] |
Definition at line 1555 of file lltexturefetch.cpp.
References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_DiscardLevel, _PREHASH_DownloadPriority, _PREHASH_Image, _PREHASH_Packet, _PREHASH_RequestImage, _PREHASH_SessionID, _PREHASH_Type, LLMessageSystem::addF32Fast(), LLMessageSystem::addS8Fast(), LLMessageSystem::addU32Fast(), LLMessageSystem::addU8Fast(), LLMessageSystem::addUUIDFast(), gAgent, LLControlGroup::getBOOL(), LLViewerRegion::getCapability(), LLFrameTimer::getElapsedTimeF32(), LLAgent::getID(), LLAgent::getRegion(), LLAgent::getRegionHost(), LLAgent::getSessionID(), getWorker(), gMessageSystem, gSavedSettings, IMAGES_PER_REQUEST, LLHost::invalid, llabs(), LLTextureFetchWorker::lockWorkData(), mCancelQueue, mDebugCount, mDebugID, LLTextureFetchWorker::mDesiredDiscard, LLTextureFetchWorker::mHost, LLTextureFetchWorker::mID, LLTextureFetchWorker::mImagePriority, LLTextureFetchWorker::mLastPacket, mNetworkQueue, mQueueMutex, LLTextureFetchWorker::mRequestedPriority, LLTextureFetchWorker::mRequestedTimer, LLTextureFetchWorker::mSentRequest, LLTextureFetchWorker::mSimRequestedDiscard, LLTextureFetchWorker::mTotalPackets, LLTextureFetchWorker::mType, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), NULL, LLFrameTimer::reset(), S32, LLMessageSystem::sendSemiReliable(), LLTextureFetchWorker::SENT_SIM, and LLTextureFetchWorker::unlockWorkData().
Referenced by update().
friend class LLTextureFetchWorker [friend] |
Definition at line 88 of file lltexturefetch.h.
Referenced by LLTextureFetchWorker::doWork(), LLTextureBar::draw(), LLTextureBar::handleMouseDown(), and sendRequestListToSimulators().
Definition at line 89 of file lltexturefetch.h.
Referenced by LLViewerImage::calcDecodePriority(), LLTextureFetchWorker::doWork(), sendRequestListToSimulators(), and LLViewerImage::updateFetch().
Definition at line 90 of file lltexturefetch.h.
Referenced by createRequest(), LLTextureFetchWorker::doWork(), getRequestFinished(), LLTextureView::handleMouseDown(), LLTextureFetchWorker::LLTextureFetchWorker(), and LLTextureFetchWorker::setDesiredDiscard().
Definition at line 91 of file lltexturefetch.h.
Referenced by LLGLTexMemBar::draw(), receiveImageHeader(), and receiveImagePacket().
Definition at line 92 of file lltexturefetch.h.
Referenced by LLGLTexMemBar::draw(), receiveImageHeader(), and receiveImagePacket().
LLMutex LLTextureFetch::mQueueMutex [private] |
Definition at line 95 of file lltexturefetch.h.
Referenced by createRequest(), deleteRequest(), getFetchState(), getRequestFinished(), lockQueue(), receiveImageHeader(), receiveImagePacket(), sendRequestListToSimulators(), unlockQueue(), and updateRequestPriority().
LLTextureCache* LLTextureFetch::mTextureCache [private] |
Definition at line 97 of file lltexturefetch.h.
Referenced by LLTextureFetchWorker::deleteOK(), LLTextureFetchWorker::doWork(), LLTextureFetchWorker::finishWork(), LLTextureFetchWorker::removeFromCache(), LLTextureFetchWorker::writeToCacheComplete(), and LLTextureFetchWorker::~LLTextureFetchWorker().
map_t LLTextureFetch::mRequestMap [private] |
Definition at line 101 of file lltexturefetch.h.
Referenced by addToNetworkQueue(), createRequest(), getNumRequests(), getWorker(), and removeRequest().
queue_t LLTextureFetch::mNetworkQueue [private] |
Definition at line 105 of file lltexturefetch.h.
Referenced by addToNetworkQueue(), removeFromNetworkQueue(), removeRequest(), and sendRequestListToSimulators().
cancel_queue_t LLTextureFetch::mCancelQueue [private] |
Definition at line 107 of file lltexturefetch.h.
Referenced by addToNetworkQueue(), receiveImageHeader(), receiveImagePacket(), removeRequest(), and sendRequestListToSimulators().
LLFrameTimer LLTextureFetch::mNetworkTimer [private] |