LLTextureFetch Class Reference

#include <lltexturefetch.h>

Inheritance diagram for LLTextureFetch:

Inheritance graph
[legend]
Collaboration diagram for LLTextureFetch:

Collaboration graph
[legend]
List of all members.

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)
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 ()
LLTextureFetchWorkergetWorker (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< LLUUIDqueue_t
typedef std::map< LLHost,
std::set< LLUUID > > 
cancel_queue_t

Private Member Functions

void sendRequestListToSimulators ()

Private Attributes

LLMutex mQueueMutex
LLTextureCachemTextureCache
map_t mRequestMap
queue_t mNetworkQueue
cancel_queue_t mCancelQueue
LLFrameTimer mNetworkTimer

Friends

class LLTextureFetchWorker

Detailed Description

Definition at line 46 of file lltexturefetch.h.


Member Typedef Documentation

typedef std::map<LLHost,std::set<LLUUID> > LLTextureFetch::cancel_queue_t [private]

Definition at line 104 of file lltexturefetch.h.

typedef std::map<LLUUID,LLTextureFetchWorker*> LLTextureFetch::map_t [private]

Definition at line 98 of file lltexturefetch.h.

typedef std::set<LLUUID> LLTextureFetch::queue_t [private]

Definition at line 102 of file lltexturefetch.h.


Constructor & Destructor Documentation

LLTextureFetch::LLTextureFetch ( LLTextureCache cache,
bool  threaded 
)

Definition at line 1259 of file lltexturefetch.cpp.

LLTextureFetch::~LLTextureFetch (  ) 

Definition at line 1270 of file lltexturefetch.cpp.


Member Function Documentation

void LLTextureFetch::addToNetworkQueue ( LLTextureFetchWorker worker  )  [protected]

Definition at line 1350 of file lltexturefetch.cpp.

References mCancelQueue, LLTextureFetchWorker::mID, mNetworkQueue, and mRequestMap.

Referenced by LLTextureFetchWorker::doWork().

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 1275 of file lltexturefetch.cpp.

References LLWorkerClass::addWork(), LLImageJ2C::calcDataSizeJ2C(), FIRST_PACKET_SIZE, LLWorkerClass::haveWork(), LLTextureFetchWorker::INIT, llendl, LLTextureFetchWorker, llwarns, LLTextureFetchWorker::lockWorkData(), LLTextureFetchWorker::mActiveCount, MAX_DISCARD_LEVEL, mDebugPause, 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().

Referenced by LLViewerImage::updateFetch().

void LLTextureFetch::deleteRequest ( const LLUUID id,
bool  cancel 
)

Definition at line 1337 of file lltexturefetch.cpp.

References getWorker(), mQueueMutex, and removeRequest().

Referenced by LLViewerImage::setIsMissingAsset(), LLViewerImage::updateFetch(), and LLViewerImage::~LLViewerImage().

void LLTextureFetch::dump (  ) 

Definition at line 1843 of file lltexturefetch.cpp.

References LLQueuedThread::QueuedRequest::getPriority(), LLWorkerThread::WorkRequest::getWorkerClass(), llendl, llformat(), llinfos, LLTextureFetchWorker::mID, LLQueuedThread::mRequestQueue, LLTextureFetchWorker::mState, and LLTextureFetchWorker::sStateDescs.

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 1793 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().

S32 LLTextureFetch::getNumRequests (  )  [inline]

Definition at line 70 of file lltexturefetch.h.

References mRequestMap.

Referenced by LLFloaterLagMeter::determineClient(), and LLGLTexMemBar::draw().

bool LLTextureFetch::getRequestFinished ( const LLUUID id,
S32 discard_level,
LLPointer< LLImageRaw > &  raw,
LLPointer< LLImageRaw > &  aux 
)

Definition at line 1396 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().

LLTextureFetchWorker * LLTextureFetch::getWorker ( const LLUUID id  ) 

Definition at line 1384 of file lltexturefetch.cpp.

References mRequestMap, and NULL.

Referenced by LLTextureFetchWorker::DecodeResponder::completed(), LLTextureFetchWorker::CacheWriteResponder::completed(), LLTextureFetchWorker::CacheReadResponder::completed(), LLTextureFetchWorker::HTTPGetResponder::completed(), deleteRequest(), LLTextureFetchWorker::URLResponder::error(), getFetchState(), getRequestFinished(), receiveImageHeader(), receiveImagePacket(), LLTextureFetchWorker::URLResponder::result(), sendRequestListToSimulators(), and updateRequestPriority().

void LLTextureFetch::lockQueue (  )  [inline]

Definition at line 73 of file lltexturefetch.h.

References LLMutex::lock(), and mQueueMutex.

Referenced by LLTextureFetchWorker::DecodeResponder::completed(), LLTextureFetchWorker::CacheWriteResponder::completed(), LLTextureFetchWorker::CacheReadResponder::completed(), LLTextureFetchWorker::HTTPGetResponder::completed(), LLTextureFetchWorker::doWork(), LLTextureFetchWorker::URLResponder::error(), and LLTextureFetchWorker::URLResponder::result().

bool LLTextureFetch::receiveImageHeader ( const LLHost host,
const LLUUID id,
U8  codec,
U16  packets,
U32  totalbytes,
U16  data_size,
U8 data 
)

Definition at line 1683 of file lltexturefetch.cpp.

References FIRST_PACKET_SIZE, getWorker(), LLTextureFetchWorker::insertPacket(), llassert_always, llendl, 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 1738 of file lltexturefetch.cpp.

References getWorker(), LLTextureFetchWorker::insertPacket(), llendl, 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().

void LLTextureFetch::removeFromNetworkQueue ( LLTextureFetchWorker worker  )  [protected]

Definition at line 1366 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 1372 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 1484 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(), mCancelQueue, mDebugCount, mDebugID, LLTextureFetchWorker::mDesiredDiscard, LLTextureFetchWorker::mHost, LLTextureFetchWorker::mID, LLTextureFetchWorker::mImagePriority, LLTextureFetchWorker::mLastPacket, mNetworkQueue, mQueueMutex, LLTextureFetchWorker::mRequestedPriority, LLTextureFetchWorker::mRequestedTimer, LLTextureFetchWorker::mSimRequestedDiscard, LLTextureFetchWorker::mTotalPackets, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), NULL, S32, LLMessageSystem::sendSemiReliable(), and LLTextureFetchWorker::SENT_SIM.

Referenced by update().

void LLTextureFetch::unlockQueue (  )  [inline]

Definition at line 74 of file lltexturefetch.h.

References mQueueMutex, and LLMutex::unlock().

Referenced by LLTextureFetchWorker::DecodeResponder::completed(), LLTextureFetchWorker::CacheWriteResponder::completed(), LLTextureFetchWorker::CacheReadResponder::completed(), LLTextureFetchWorker::HTTPGetResponder::completed(), LLTextureFetchWorker::doWork(), LLTextureFetchWorker::URLResponder::error(), and LLTextureFetchWorker::URLResponder::result().

S32 LLTextureFetch::update ( U32  max_time_ms  )  [virtual]

Reimplemented from LLWorkerThread.

Definition at line 1464 of file lltexturefetch.cpp.

References LLFrameTimer::getElapsedTimeF32(), mNetworkTimer, LLFrameTimer::reset(), S32, sendRequestListToSimulators(), and LLWorkerThread::update().

Referenced by cleanup_app(), LLViewerImageList::decodeAllImages(), main_loop(), and update_texture_fetch().

bool LLTextureFetch::updateRequestPriority ( const LLUUID id,
F32  priority 
)

Definition at line 1446 of file lltexturefetch.cpp.

References getWorker(), LLTextureFetchWorker::lockWorkData(), mQueueMutex, LLTextureFetchWorker::setImagePriority(), and LLTextureFetchWorker::unlockWorkData().

Referenced by LLViewerImage::updateFetch().


Friends And Related Function Documentation

friend class LLTextureFetchWorker [friend]

Definition at line 48 of file lltexturefetch.h.

Referenced by createRequest().


Member Data Documentation

S32 LLTextureFetch::mBadPacketCount

Definition at line 90 of file lltexturefetch.h.

Referenced by LLGLTexMemBar::draw(), receiveImageHeader(), and receiveImagePacket().

cancel_queue_t LLTextureFetch::mCancelQueue [private]

Definition at line 105 of file lltexturefetch.h.

Referenced by addToNetworkQueue(), receiveImageHeader(), receiveImagePacket(), removeRequest(), and sendRequestListToSimulators().

S32 LLTextureFetch::mDebugCount

Definition at line 87 of file lltexturefetch.h.

Referenced by LLViewerImage::calcDecodePriority(), LLTextureFetchWorker::doWork(), sendRequestListToSimulators(), and LLViewerImage::updateFetch().

LLUUID LLTextureFetch::mDebugID

Definition at line 86 of file lltexturefetch.h.

Referenced by LLViewerImage::calcDecodePriority(), LLTextureFetchWorker::doWork(), LLTextureBar::draw(), LLTextureBar::handleMouseDown(), sendRequestListToSimulators(), and LLViewerImage::updateFetch().

BOOL LLTextureFetch::mDebugPause

Definition at line 88 of file lltexturefetch.h.

Referenced by createRequest(), LLTextureFetchWorker::doWork(), LLGLTexMemBar::draw(), getRequestFinished(), LLTextureView::handleMouseDown(), LLTextureFetchWorker::LLTextureFetchWorker(), and LLTextureFetchWorker::setDesiredDiscard().

queue_t LLTextureFetch::mNetworkQueue [private]

Definition at line 103 of file lltexturefetch.h.

Referenced by addToNetworkQueue(), removeFromNetworkQueue(), removeRequest(), and sendRequestListToSimulators().

LLFrameTimer LLTextureFetch::mNetworkTimer [private]

Definition at line 107 of file lltexturefetch.h.

Referenced by update().

S32 LLTextureFetch::mPacketCount

Definition at line 89 of file lltexturefetch.h.

Referenced by LLGLTexMemBar::draw(), receiveImageHeader(), and receiveImagePacket().

LLMutex LLTextureFetch::mQueueMutex [private]

Definition at line 93 of file lltexturefetch.h.

Referenced by createRequest(), deleteRequest(), getFetchState(), getRequestFinished(), lockQueue(), receiveImageHeader(), receiveImagePacket(), sendRequestListToSimulators(), unlockQueue(), and updateRequestPriority().

map_t LLTextureFetch::mRequestMap [private]

Definition at line 99 of file lltexturefetch.h.

Referenced by addToNetworkQueue(), createRequest(), getNumRequests(), getWorker(), and removeRequest().

LLTextureCache* LLTextureFetch::mTextureCache [private]

Definition at line 95 of file lltexturefetch.h.

Referenced by LLTextureFetchWorker::deleteOK(), LLTextureFetchWorker::doWork(), LLTextureFetchWorker::finishWork(), LLTextureFetchWorker::removeFromCache(), LLTextureFetchWorker::writeToCacheComplete(), and LLTextureFetchWorker::~LLTextureFetchWorker().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:51 2010 for Second Life Viewer by  doxygen 1.4.7