#include <lltexturecache.h>
Inheritance diagram for LLTextureCache:
Definition at line 44 of file lltexturecache.h.
typedef std::vector<handle_t> LLTextureCache::handle_list_t [private] |
Definition at line 133 of file lltexturecache.h.
typedef std::map<handle_t, LLTextureCacheWorker*> LLTextureCache::handle_map_t [private] |
Definition at line 129 of file lltexturecache.h.
typedef std::map<LLUUID,S32> LLTextureCache::id_map_t [private] |
Definition at line 162 of file lltexturecache.h.
typedef std::map<S32,LLUUID> LLTextureCache::index_map_t [private] |
Definition at line 160 of file lltexturecache.h.
typedef std::vector<std::pair<LLPointer<Responder>, bool> > LLTextureCache::responder_list_t [private] |
Definition at line 136 of file lltexturecache.h.
typedef std::map<LLUUID,S32> LLTextureCache::size_map_t [private] |
Definition at line 168 of file lltexturecache.h.
LLTextureCache::LLTextureCache | ( | bool | threaded | ) |
LLTextureCache::~LLTextureCache | ( | ) |
Definition at line 1344 of file lltexturecache.cpp.
References mCompletedList, and mListMutex.
Referenced by LLTextureCacheWorker::finishWork().
Definition at line 805 of file lltexturecache.cpp.
References getFileAPRPool(), ll_apr_file_write_ex(), llassert_always, mDoPurge, mHeaderMutex, mTexturesDirEntriesFileName, mTexturesSizeMap, mTexturesSizeTotal, NULL, sCacheMaxTexturesSize, and TRUE.
Referenced by LLTextureCacheWorker::doWrite().
apr_pool_t* LLTextureCache::getFileAPRPool | ( | ) | [inline, protected] |
Definition at line 106 of file lltexturecache.h.
References mFileAPRPool.
Referenced by appendToTextureEntryList(), LLTextureCacheWorker::doRead(), LLTextureCacheWorker::doWrite(), and getHeaderCacheEntry().
S32 LLTextureCache::getHeaderCacheEntry | ( | const LLUUID & | id, | |
bool | touch, | |||
S32 * | imagesize = NULL | |||
) | [private] |
Definition at line 1175 of file lltexturecache.cpp.
References getFileAPRPool(), ll_apr_file_read_ex(), ll_apr_file_write_ex(), llassert_always, LLTextureCache::EntriesInfo::mEntries, mHeaderEntriesFileName, mHeaderEntriesInfo, mHeaderIDMap, mHeaderMutex, mLRU, mReadOnly, mTexturesSizeMap, NULL, readHeaderCache(), S32, and sCacheMaxEntries.
Referenced by LLTextureCacheWorker::doRead(), and LLTextureCacheWorker::doWrite().
std::string LLTextureCache::getLocalFileName | ( | const LLUUID & | id | ) | [protected] |
Definition at line 789 of file lltexturecache.cpp.
References gDirUtilp, LLDir::getExpandedFilename(), and LL_PATH_SKINS.
Referenced by LLTextureCacheWorker::doRead().
S32 LLTextureCache::getNumReads | ( | ) | [inline] |
Definition at line 101 of file lltexturecache.h.
References mReaders.
Referenced by LLGLTexMemBar::draw().
S32 LLTextureCache::getNumWrites | ( | ) | [inline] |
Definition at line 102 of file lltexturecache.h.
References mWriters.
Referenced by LLGLTexMemBar::draw().
LLTextureCacheWorker * LLTextureCache::getReader | ( | handle_t | handle | ) |
Definition at line 1150 of file lltexturecache.cpp.
References mReaders, and NULL.
Referenced by LLTextureCacheWorker::ReadResponder::completed().
std::string LLTextureCache::getTextureFileName | ( | const LLUUID & | id | ) | [protected] |
Definition at line 797 of file lltexturecache.cpp.
References gDirUtilp, LLDir::getDirDelimiter(), and mTexturesDirName.
Referenced by LLTextureCacheWorker::doRead(), LLTextureCacheWorker::doWrite(), purgeTextures(), and removeFromCache().
LLTextureCacheWorker * LLTextureCache::getWriter | ( | handle_t | handle | ) |
Definition at line 1161 of file lltexturecache.cpp.
References mWriters, and NULL.
Referenced by LLTextureCacheWorker::WriteResponder::completed().
Definition at line 872 of file lltexturecache.cpp.
References gDirUtilp, LLDir::getDirDelimiter(), i, llendl, llinfos, llmin(), LLFile::mkdir(), mReadOnly, mTexturesDirName, purgeTextures(), readHeaderCache(), S32, sCacheMaxEntries, sCacheMaxTexturesSize, setDirNames(), and TEXTURE_CACHE_ENTRY_SIZE.
Referenced by init_cache().
void LLTextureCache::lockHeaders | ( | ) | [inline, private] |
void LLTextureCache::lockWorkers | ( | ) | [inline] |
Definition at line 97 of file lltexturecache.h.
References LLMutex::lock(), and mWorkersMutex.
Referenced by LLTextureCacheWorker::WriteResponder::completed(), LLTextureCacheWorker::ReadResponder::completed(), readComplete(), update(), and writeComplete().
Definition at line 1336 of file lltexturecache.cpp.
References mListMutex, and mPrioritizeWriteList.
Referenced by LLTextureFetchWorker::doWork().
void LLTextureCache::purgeAllTextures | ( | bool | purge_directories | ) | [private] |
Definition at line 987 of file lltexturecache.cpp.
References LLDir::deleteFilesInDir(), gDirUtilp, LLDir::getDirDelimiter(), i, ll_apr_file_remove(), mask, mReadOnly, mTexturesDirEntriesFileName, mTexturesDirName, mTexturesSizeMap, NULL, LLFile::rmdir(), and S32.
Referenced by purgeCache(), and purgeTextures().
Definition at line 860 of file lltexturecache.cpp.
References ll_apr_file_remove(), mHeaderDataFileName, mHeaderEntriesFileName, mReadOnly, NULL, purgeAllTextures(), and setDirNames().
Referenced by purge_cache().
void LLTextureCache::purgeTextures | ( | bool | validate | ) | [private] |
Definition at line 1012 of file lltexturecache.cpp.
References getTextureFileName(), LLControlGroup::getU32(), gSavedSettings, ll_apr_file_read_ex(), ll_apr_file_remove(), ll_apr_file_size(), ll_apr_file_write_ex(), llassert, llendl, llinfos, llwarns, mHeaderMutex, mReadOnly, mSize, mTexturesDirEntriesFileName, mTexturesSizeMap, mTexturesSizeTotal, NULL, purgeAllTextures(), S32, sCacheMaxTexturesSize, and LLControlGroup::setU32().
Referenced by initCache(), and writeToCache().
bool LLTextureCache::readComplete | ( | handle_t | handle, | |
bool | abort | |||
) |
Definition at line 1263 of file lltexturecache.cpp.
References llassert_always, lockWorkers(), mReaders, and unlockWorkers().
Referenced by LLTextureFetchWorker::deleteOK(), LLTextureFetchWorker::doWork(), LLTextureFetchWorker::finishWork(), and LLTextureFetchWorker::~LLTextureFetchWorker().
LLTextureCache::handle_t LLTextureCache::readFromCache | ( | const LLUUID & | id, | |
U32 | priority, | |||
S32 | offset, | |||
S32 | size, | |||
ReadResponder * | responder | |||
) |
Definition at line 1249 of file lltexturecache.cpp.
References LLTextureCacheWorker, mReaders, mWorkersMutex, NULL, and LLTextureCacheWorker::read().
Referenced by LLTextureFetchWorker::doWork().
void LLTextureCache::readHeaderCache | ( | apr_pool_t * | poolp = NULL |
) | [private] |
Definition at line 931 of file lltexturecache.cpp.
References i, ll_apr_file_exists(), ll_apr_file_read_ex(), ll_apr_file_write_ex(), LLTextureCache::EntriesInfo::mEntries, mHeaderEntriesFileName, mHeaderEntriesInfo, mHeaderIDMap, mHeaderMutex, mLRU, mReadOnly, mSize, LLTextureCache::EntriesInfo::mVersion, S32, sCacheMaxEntries, and sHeaderCacheVersion.
Referenced by getHeaderCacheEntry(), and initCache().
Definition at line 1381 of file lltexturecache.cpp.
References getTextureFileName(), ll_apr_file_remove(), llendl, llwarns, mReadOnly, NULL, and removeHeaderCacheEntry().
Referenced by LLTextureCacheWorker::endWork(), and LLTextureFetchWorker::removeFromCache().
bool LLTextureCache::removeHeaderCacheEntry | ( | const LLUUID & | id | ) | [private] |
Definition at line 1354 of file lltexturecache.cpp.
References ll_apr_file_write_ex(), mHeaderEntriesFileName, mHeaderIDMap, mHeaderMutex, mLRU, mReadOnly, mTexturesSizeMap, NULL, and S32.
Referenced by removeFromCache().
Definition at line 851 of file lltexturecache.cpp.
References cache_filename, entries_filename, gDirUtilp, LLDir::getDirDelimiter(), LLDir::getExpandedFilename(), mHeaderDataFileName, mHeaderEntriesFileName, mTexturesDirEntriesFileName, mTexturesDirName, and textures_dirname.
Referenced by initCache(), and purgeCache().
void LLTextureCache::unlockHeaders | ( | ) | [inline, private] |
void LLTextureCache::unlockWorkers | ( | ) | [inline] |
Definition at line 98 of file lltexturecache.h.
References mWorkersMutex, and LLMutex::unlock().
Referenced by LLTextureCacheWorker::WriteResponder::completed(), LLTextureCacheWorker::ReadResponder::completed(), readComplete(), update(), and writeComplete().
Reimplemented from LLWorkerThread.
Definition at line 748 of file lltexturecache.cpp.
References LLMutex::lock(), lockWorkers(), mCompletedList, mListMutex, mPrioritizeWriteList, mWriters, LLQueuedThread::PRIORITY_HIGH, S32, LLMutex::unlock(), unlockWorkers(), and LLWorkerThread::update().
Referenced by cleanup_app(), LLViewerImageList::decodeAllImages(), main_loop(), and update_texture_fetch().
bool LLTextureCache::writeComplete | ( | handle_t | handle, | |
bool | abort = false | |||
) |
Definition at line 1316 of file lltexturecache.cpp.
References llassert_always, lockWorkers(), mWriters, and unlockWorkers().
Referenced by LLTextureFetchWorker::deleteOK(), LLTextureFetchWorker::finishWork(), LLTextureFetchWorker::writeToCacheComplete(), and LLTextureFetchWorker::~LLTextureFetchWorker().
LLTextureCache::handle_t LLTextureCache::writeToCache | ( | const LLUUID & | id, | |
U32 | priority, | |||
U8 * | data, | |||
S32 | datasize, | |||
S32 | imagesize, | |||
WriteResponder * | responder | |||
) |
Definition at line 1284 of file lltexturecache.cpp.
References FALSE, llassert_always, LLTextureCacheWorker, mDoPurge, mReadOnly, mWorkersMutex, mWriters, LLQueuedThread::nullHandle(), purgeTextures(), TEXTURE_CACHE_ENTRY_SIZE, and LLTextureCacheWorker::write().
Referenced by LLTextureFetchWorker::doWork().
friend class LLTextureCacheWorker [friend] |
LLAtomic32<BOOL> LLTextureCache::mDoPurge [private] |
Definition at line 171 of file lltexturecache.h.
Referenced by appendToTextureEntryList(), and writeToCache().
apr_pool_t* LLTextureCache::mFileAPRPool [private] |
Definition at line 127 of file lltexturecache.h.
Referenced by getFileAPRPool(), LLTextureCache(), and ~LLTextureCache().
std::string LLTextureCache::mHeaderDataFileName [private] |
Definition at line 158 of file lltexturecache.h.
Referenced by LLTextureCacheWorker::doRead(), LLTextureCacheWorker::doWrite(), purgeCache(), and setDirNames().
std::string LLTextureCache::mHeaderEntriesFileName [private] |
Definition at line 157 of file lltexturecache.h.
Referenced by getHeaderCacheEntry(), purgeCache(), readHeaderCache(), removeHeaderCacheEntry(), and setDirNames().
Definition at line 159 of file lltexturecache.h.
Referenced by getHeaderCacheEntry(), and readHeaderCache().
id_map_t LLTextureCache::mHeaderIDMap [private] |
Definition at line 163 of file lltexturecache.h.
Referenced by getHeaderCacheEntry(), readHeaderCache(), and removeHeaderCacheEntry().
LLMutex LLTextureCache::mHeaderMutex [private] |
Definition at line 125 of file lltexturecache.h.
Referenced by appendToTextureEntryList(), getHeaderCacheEntry(), lockHeaders(), purgeTextures(), readHeaderCache(), removeHeaderCacheEntry(), and unlockHeaders().
LLMutex LLTextureCache::mListMutex [private] |
Definition at line 126 of file lltexturecache.h.
Referenced by addCompleted(), prioritizeWrite(), and update().
index_map_t LLTextureCache::mLRU [private] |
Definition at line 161 of file lltexturecache.h.
Referenced by getHeaderCacheEntry(), readHeaderCache(), and removeHeaderCacheEntry().
handle_map_t LLTextureCache::mReaders [private] |
Definition at line 130 of file lltexturecache.h.
Referenced by getNumReads(), getReader(), readComplete(), and readFromCache().
BOOL LLTextureCache::mReadOnly [private] |
Definition at line 139 of file lltexturecache.h.
Referenced by getHeaderCacheEntry(), initCache(), purgeAllTextures(), purgeCache(), purgeTextures(), readHeaderCache(), removeFromCache(), removeHeaderCacheEntry(), and writeToCache().
std::string LLTextureCache::mTexturesDirEntriesFileName [private] |
Definition at line 167 of file lltexturecache.h.
Referenced by appendToTextureEntryList(), purgeAllTextures(), purgeTextures(), and setDirNames().
std::string LLTextureCache::mTexturesDirName [private] |
Definition at line 166 of file lltexturecache.h.
Referenced by getTextureFileName(), initCache(), purgeAllTextures(), and setDirNames().
size_map_t LLTextureCache::mTexturesSizeMap [private] |
Definition at line 169 of file lltexturecache.h.
Referenced by appendToTextureEntryList(), getHeaderCacheEntry(), purgeAllTextures(), purgeTextures(), and removeHeaderCacheEntry().
S64 LLTextureCache::mTexturesSizeTotal [private] |
Definition at line 170 of file lltexturecache.h.
Referenced by appendToTextureEntryList(), and purgeTextures().
LLMutex LLTextureCache::mWorkersMutex [private] |
Definition at line 124 of file lltexturecache.h.
Referenced by lockWorkers(), readFromCache(), unlockWorkers(), and writeToCache().
handle_map_t LLTextureCache::mWriters [private] |
Definition at line 131 of file lltexturecache.h.
Referenced by getNumWrites(), getWriter(), update(), writeComplete(), and writeToCache().
U32 LLTextureCache::sCacheMaxEntries = MAX_REASONABLE_FILE_SIZE / TEXTURE_CACHE_ENTRY_SIZE [static, private] |
Definition at line 175 of file lltexturecache.h.
Referenced by getHeaderCacheEntry(), initCache(), and readHeaderCache().
S64 LLTextureCache::sCacheMaxTexturesSize = 0 [static, private] |
Definition at line 176 of file lltexturecache.h.
Referenced by appendToTextureEntryList(), initCache(), and purgeTextures().
F32 LLTextureCache::sHeaderCacheVersion = 1.0f [static, private] |