diff options
author | Richard Linden <none@none> | 2013-10-01 14:28:39 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-10-01 14:28:39 -0700 |
commit | 59628d6f85deed89cb35d9343183069cfccd13c0 (patch) | |
tree | 6b4c35053c2291fd5ff1cccedf86bbd76ce78e1d /indra/newview/lltexturecache.cpp | |
parent | ad777b46d0fe5d790e43efb1771e9f64f3ad3dfb (diff) | |
parent | 9e486f6c6abbee6cb41ba9a6271d8a025ad924ef (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rwxr-xr-x | indra/newview/lltexturecache.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 5bc2e971eb..ef852bc905 100755 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -191,7 +191,7 @@ bool LLTextureCacheLocalFileWorker::doRead() if (mImageFormat == IMG_CODEC_INVALID) { -// llwarns << "Unrecognized file extension " << extension << " for local texture " << mFileName << llendl; +// LL_WARNS() << "Unrecognized file extension " << extension << " for local texture " << mFileName << LL_ENDL; mDataSize = 0; // no data return true; } @@ -232,9 +232,9 @@ bool LLTextureCacheLocalFileWorker::doRead() { if (mBytesRead != mBytesToRead) { -// llwarns << "Error reading file from local cache: " << local_filename +// LL_WARNS() << "Error reading file from local cache: " << local_filename // << " Bytes: " << mDataSize << " Offset: " << mOffset -// << " / " << mDataSize << llendl; +// << " / " << mDataSize << LL_ENDL; mDataSize = 0; // failed FREE_MEM(LLImageBase::getPrivatePool(), mReadData); mReadData = NULL; @@ -257,9 +257,9 @@ bool LLTextureCacheLocalFileWorker::doRead() if (bytes_read != mDataSize) { -// llwarns << "Error reading file from local cache: " << mFileName +// LL_WARNS() << "Error reading file from local cache: " << mFileName // << " Bytes: " << mDataSize << " Offset: " << mOffset -// << " / " << mDataSize << llendl; +// << " / " << mDataSize << LL_ENDL; mDataSize = 0; FREE_MEM(LLImageBase::getPrivatePool(), mReadData); mReadData = NULL; @@ -390,16 +390,16 @@ bool LLTextureCacheRemoteWorker::doRead() mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); if (bytes_read != mDataSize) { - llwarns << "Error reading file from local cache: " << local_filename + LL_WARNS() << "Error reading file from local cache: " << local_filename << " Bytes: " << mDataSize << " Offset: " << mOffset - << " / " << mDataSize << llendl; + << " / " << mDataSize << LL_ENDL; mDataSize = 0; FREE_MEM(LLImageBase::getPrivatePool(), mReadData); mReadData = NULL; } else { - //llinfos << "texture " << mID.asString() << " found in local_assets" << llendl; + //LL_INFOS() << "texture " << mID.asString() << " found in local_assets" << LL_ENDL; mImageSize = local_size; mImageLocal = TRUE; } @@ -442,9 +442,9 @@ bool LLTextureCacheRemoteWorker::doRead() mReadData, offset, size, mCache->getLocalAPRFilePool()); if (bytes_read != size) { - llwarns << "LLTextureCacheWorker: " << mID + LL_WARNS() << "LLTextureCacheWorker: " << mID << " incorrect number of bytes read from header: " << bytes_read - << " / " << size << llendl; + << " / " << size << LL_ENDL; FREE_MEM(LLImageBase::getPrivatePool(), mReadData); mReadData = NULL; mDataSize = -1; // failed @@ -511,9 +511,9 @@ bool LLTextureCacheRemoteWorker::doRead() mCache->getLocalAPRFilePool()); if (bytes_read != file_size) { - llwarns << "LLTextureCacheWorker: " << mID + LL_WARNS() << "LLTextureCacheWorker: " << mID << " incorrect number of bytes read from body: " << bytes_read - << " / " << file_size << llendl; + << " / " << file_size << LL_ENDL; FREE_MEM(LLImageBase::getPrivatePool(), mReadData); mReadData = NULL; mDataSize = -1; // failed @@ -524,7 +524,7 @@ bool LLTextureCacheRemoteWorker::doRead() { // No body, we're done. mDataSize = llmax(TEXTURE_CACHE_ENTRY_SIZE - mOffset, 0); - lldebugs << "No body file for: " << filename << llendl; + LL_DEBUGS() << "No body file for: " << filename << LL_ENDL; } // Nothing else to do at that point... done = true; @@ -571,10 +571,10 @@ bool LLTextureCacheRemoteWorker::doWrite() // (almost always) write to the fast cache. if (mRawImage->getDataSize()) { - llassert_always(mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)); - } + llassert_always(mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)); } } + } else { alreadyCached = mCache->updateEntry(idx, entry, mImageSize, mDataSize); // update the existing entry. @@ -582,8 +582,8 @@ bool LLTextureCacheRemoteWorker::doWrite() if (idx < 0) { - llwarns << "LLTextureCacheWorker: " << mID - << " Unable to create header entry for writing!" << llendl; + LL_WARNS() << "LLTextureCacheWorker: " << mID + << " Unable to create header entry for writing!" << LL_ENDL; mDataSize = -1; // failed done = true; } @@ -628,8 +628,8 @@ bool LLTextureCacheRemoteWorker::doWrite() if (bytes_written <= 0) { - llwarns << "LLTextureCacheWorker: " << mID - << " Unable to write header entry!" << llendl; + LL_WARNS() << "LLTextureCacheWorker: " << mID + << " Unable to write header entry!" << LL_ENDL; mDataSize = -1; // failed done = true; } @@ -655,16 +655,16 @@ bool LLTextureCacheRemoteWorker::doWrite() { // build the cache file name from the UUID std::string filename = mCache->getTextureFileName(mID); -// llinfos << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << llendl; +// LL_INFOS() << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << LL_ENDL; S32 bytes_written = LLAPRFile::writeEx( filename, mWriteData + TEXTURE_CACHE_ENTRY_SIZE, 0, file_size, mCache->getLocalAPRFilePool()); if (bytes_written <= 0) { - llwarns << "LLTextureCacheWorker: " << mID + LL_WARNS() << "LLTextureCacheWorker: " << mID << " incorrect number of bytes written to body: " << bytes_written - << " / " << file_size << llendl; + << " / " << file_size << LL_ENDL; mDataSize = -1; // failed done = true; } @@ -922,7 +922,7 @@ void LLTextureCache::setDirNames(ELLPath location) mFastCacheFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, fast_cache_filename); } -void LLTextureCache::purgeCache(ELLPath location) +void LLTextureCache::purgeCache(ELLPath location, bool remove_dir) { LLMutexLock lock(&mHeaderMutex); @@ -948,7 +948,7 @@ void LLTextureCache::purgeCache(ELLPath location) } //remove the current texture cache. - purgeAllTextures(true); + purgeAllTextures(remove_dir); } //is called in the main thread before initCache(...) is called. @@ -1135,7 +1135,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create } if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why { - llwarns << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << llendl ; + LL_WARNS() << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << LL_ENDL ; //erase this entry and the cached texture from the cache. std::string tex_filename = getTextureFileName(id); @@ -1303,13 +1303,13 @@ U32 LLTextureCache::openAndReadEntries(std::vector<Entry>& entries) S32 bytes_read = aprfile->read((void*)(&entry), (S32)sizeof(Entry)); if (bytes_read < sizeof(Entry)) { - llwarns << "Corrupted header entries, failed at " << idx << " / " << num_entries << llendl; + LL_WARNS() << "Corrupted header entries, failed at " << idx << " / " << num_entries << LL_ENDL; closeHeaderEntriesFile(); purgeAllTextures(false); return 0; } entries.push_back(entry); -// llinfos << "ENTRY: " << entry.mTime << " TEX: " << entry.mID << " IDX: " << idx << " Size: " << entry.mImageSize << llendl; +// LL_INFOS() << "ENTRY: " << entry.mTime << " TEX: " << entry.mID << " IDX: " << idx << " Size: " << entry.mImageSize << LL_ENDL; if(entry.mImageSize > entry.mBodySize) { mHeaderIDMap[entry.mID] = idx; @@ -1439,7 +1439,7 @@ void LLTextureCache::readHeaderCache() if (entry.mBodySize > entry.mImageSize) { // Shouldn't happen, failsafe only - llwarns << "Bad entry: " << i << ": " << entry.mID << ": BodySize: " << entry.mBodySize << llendl; + LL_WARNS() << "Bad entry: " << i << ": " << entry.mID << ": BodySize: " << entry.mBodySize << LL_ENDL; purge_list.insert(i); } } @@ -1450,7 +1450,7 @@ void LLTextureCache::readHeaderCache() // Special case: cache size was reduced, need to remove entries // Note: After we prune entries, we will call this again and create the LRU U32 entries_to_purge = (num_entries - empty_entries) - sCacheMaxEntries; - llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl; + LL_INFOS() << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << LL_ENDL; // We can exit the following loop with the given condition, since if we'd reach the end of the lru set we'd have: // purge_list.size() = lru.size() = num_entries - empty_entries = entries_to_purge + sCacheMaxEntries >= entries_to_purge // So, it's certain that iter will never reach lru.end() first. @@ -1467,7 +1467,7 @@ void LLTextureCache::readHeaderCache() for (std::set<lru_data_t>::iterator iter = lru.begin(); iter != lru.end(); ++iter) { mLRU.insert(entries[iter->second].mID); -// llinfos << "LRU: " << iter->first << " : " << iter->second << llendl; +// LL_INFOS() << "LRU: " << iter->first << " : " << iter->second << LL_ENDL; if (--lru_entries <= 0) break; } @@ -1513,7 +1513,7 @@ void LLTextureCache::readHeaderCache() //the header mutex is locked before calling this. void LLTextureCache::clearCorruptedCache() { - llwarns << "the texture cache is corrupted, need to be cleared." << llendl ; + LL_WARNS() << "the texture cache is corrupted, need to be cleared." << LL_ENDL ; closeHeaderEntriesFile();//close possible file handler purgeAllTextures(false) ; //clear the cache. @@ -1543,7 +1543,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) for (S32 i=0; i<16; i++) { std::string dirname = mTexturesDirName + delem + subdirs[i]; - llinfos << "Deleting files in directory: " << dirname << llendl; + LL_INFOS() << "Deleting files in directory: " << dirname << LL_ENDL; gDirUtilp->deleteFilesInDir(dirname, mask); if (purge_directories) { @@ -1568,7 +1568,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) mHeaderEntriesInfo.mEntries = 0; writeEntriesHeader(); - llinfos << "The entire texture cache is cleared." << llendl ; + LL_INFOS() << "The entire texture cache is cleared." << LL_ENDL ; } void LLTextureCache::purgeTextures(bool validate) @@ -1586,7 +1586,7 @@ void LLTextureCache::purgeTextures(bool validate) LLMutexLock lock(&mHeaderMutex); - llinfos << "TEXTURE CACHE: Purging." << llendl; + LL_INFOS() << "TEXTURE CACHE: Purging." << LL_ENDL; // Read the entries list std::vector<Entry> entries; @@ -1609,11 +1609,11 @@ void LLTextureCache::purgeTextures(bool validate) { S32 idx = iter2->second; time_idx_set.insert(std::make_pair(entries[idx].mTime, idx)); -// llinfos << "TIME: " << entries[idx].mTime << " TEX: " << entries[idx].mID << " IDX: " << idx << " Size: " << entries[idx].mImageSize << llendl; +// LL_INFOS() << "TIME: " << entries[idx].mTime << " TEX: " << entries[idx].mID << " IDX: " << idx << " Size: " << entries[idx].mImageSize << LL_ENDL; } else { - llerrs << "mTexturesSizeMap / mHeaderIDMap corrupted." << llendl ; + LL_ERRS() << "mTexturesSizeMap / mHeaderIDMap corrupted." << LL_ENDL ; } } } @@ -1682,7 +1682,7 @@ void LLTextureCache::purgeTextures(bool validate) << " PURGED: " << purge_count << " ENTRIES: " << num_entries << " CACHE SIZE: " << mTexturesSizeTotal / (1024 * 1024) << " MB" - << llendl; + << LL_ENDL; } ////////////////////////////////////////////////////////////////////////////// @@ -1900,7 +1900,7 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis //rescale image if needed if (raw.isNull() || !raw->getData()) { - llerrs << "Attempted to write NULL raw image to fastcache" << llendl; + LL_ERRS() << "Attempted to write NULL raw image to fastcache" << LL_ENDL; return false; } @@ -2094,7 +2094,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) bool LLTextureCache::removeFromCache(const LLUUID& id) { - //llwarns << "Removing texture from cache: " << id << llendl; + //LL_WARNS() << "Removing texture from cache: " << id << LL_ENDL; bool ret = false ; if (!mReadOnly) { |