summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp342
1 files changed, 176 insertions, 166 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 04ef441a69..4b94fe141c 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -100,6 +100,9 @@ U32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA;
bool LLViewerTexture::sFreezeImageUpdates = false;
F32 LLViewerTexture::sCurrentTime = 0.0f;
+constexpr F32 MIN_VRAM_BUDGET = 768.f;
+F32 LLViewerTexture::sFreeVRAMMegabytes = MIN_VRAM_BUDGET;
+
LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF;
const F64 log_2 = log(2.0);
@@ -116,11 +119,11 @@ const U32 DESIRED_NORMAL_TEXTURE_SIZE = (U32)LLViewerFetchedTexture::MAX_IMAGE_S
LLLoadedCallbackEntry::LLLoadedCallbackEntry(loaded_callback_func cb,
S32 discard_level,
- BOOL need_imageraw, // Needs image raw for the callback
+ bool need_imageraw, // Needs image raw for the callback
void* userdata,
LLLoadedCallbackEntry::source_callback_list_t* src_callback_list,
LLViewerFetchedTexture* target,
- BOOL pause)
+ bool pause)
: mCallback(cb),
mLastUsedDiscard(MAX_DISCARD_LEVEL+1),
mDesiredDiscard(discard_level),
@@ -141,7 +144,7 @@ LLLoadedCallbackEntry::~LLLoadedCallbackEntry()
void LLLoadedCallbackEntry::removeTexture(LLViewerFetchedTexture* tex)
{
- if(mSourceCallbackList)
+ if (mSourceCallbackList && tex)
{
mSourceCallbackList->erase(LLTextureKey(tex->getID(), (ETexListType)tex->getTextureListType()));
}
@@ -166,7 +169,7 @@ void LLLoadedCallbackEntry::cleanUpCallbackList(LLLoadedCallbackEntry::source_ca
}
}
-LLViewerMediaTexture* LLViewerTextureManager::createMediaTexture(const LLUUID &media_id, BOOL usemipmaps, LLImageGL* gl_image)
+LLViewerMediaTexture* LLViewerTextureManager::createMediaTexture(const LLUUID &media_id, bool usemipmaps, LLImageGL* gl_image)
{
return new LLViewerMediaTexture(media_id, usemipmaps, gl_image);
}
@@ -212,7 +215,7 @@ LLViewerMediaTexture* LLViewerTextureManager::findMediaTexture(const LLUUID &med
return LLViewerMediaTexture::findMediaTexture(media_id);
}
-LLViewerMediaTexture* LLViewerTextureManager::getMediaTexture(const LLUUID& id, BOOL usemipmaps, LLImageGL* gl_image)
+LLViewerMediaTexture* LLViewerTextureManager::getMediaTexture(const LLUUID& id, bool usemipmaps, LLImageGL* gl_image)
{
LLViewerMediaTexture* tex = LLViewerMediaTexture::findMediaTexture(id);
if(!tex)
@@ -225,7 +228,7 @@ LLViewerMediaTexture* LLViewerTextureManager::getMediaTexture(const LLUUID& id,
return tex;
}
-LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTexture* tex, BOOL report_error)
+LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTexture* tex, bool report_error)
{
if(!tex)
{
@@ -246,7 +249,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTex
return NULL;
}
-LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(BOOL usemipmaps, BOOL generate_gl_tex)
+LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(bool usemipmaps, bool generate_gl_tex)
{
LLPointer<LLViewerTexture> tex = new LLViewerTexture(usemipmaps);
if(generate_gl_tex)
@@ -256,7 +259,7 @@ LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(BOOL usemipma
}
return tex;
}
-LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLUUID& id, BOOL usemipmaps, BOOL generate_gl_tex)
+LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLUUID& id, bool usemipmaps, bool generate_gl_tex)
{
LLPointer<LLViewerTexture> tex = new LLViewerTexture(id, usemipmaps);
if(generate_gl_tex)
@@ -266,13 +269,13 @@ LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLUUID&
}
return tex;
}
-LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLImageRaw* raw, BOOL usemipmaps)
+LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLImageRaw* raw, bool usemipmaps)
{
LLPointer<LLViewerTexture> tex = new LLViewerTexture(raw, usemipmaps);
tex->setCategory(LLGLTexture::LOCAL);
return tex;
}
-LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex)
+LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex)
{
LLPointer<LLViewerTexture> tex = new LLViewerTexture(width, height, components, usemipmaps);
if(generate_gl_tex)
@@ -285,6 +288,7 @@ LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const U32 wid
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(const LLImageRaw* raw, FTType type, bool usemipmaps)
{
+ LLImageDataSharedLock lock(raw);
LLViewerFetchedTexture* ret = new LLViewerFetchedTexture(raw, type, usemipmaps);
gTextureList.addImage(ret, TEX_LIST_STANDARD);
return ret;
@@ -293,7 +297,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(const LLImageR
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(
const LLUUID &image_id,
FTType f_type,
- BOOL usemipmaps,
+ bool usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
S8 texture_type,
LLGLint internal_format,
@@ -306,7 +310,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromFile(
const std::string& filename,
FTType f_type,
- BOOL usemipmaps,
+ bool usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
S8 texture_type,
LLGLint internal_format,
@@ -319,7 +323,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromFile(
//static
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string& url,
FTType f_type,
- BOOL usemipmaps,
+ bool usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
S8 texture_type,
LLGLint internal_format,
@@ -338,12 +342,12 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromHost(const
// Create a bridge to the viewer texture manager.
class LLViewerTextureManagerBridge : public LLTextureManagerBridge
{
- /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE)
+ /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true)
{
return LLViewerTextureManager::getLocalTexture(usemipmaps, generate_gl_tex);
}
- /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE)
+ /*virtual*/ LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true)
{
return LLViewerTextureManager::getLocalTexture(width, height, components, usemipmaps, generate_gl_tex);
}
@@ -360,7 +364,7 @@ void LLViewerTextureManager::init()
{
LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,3);
raw->clear(0x77, 0x77, 0x77, 0xFF);
- LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE);
+ LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), true);
}
const S32 dim = 128;
@@ -368,7 +372,7 @@ void LLViewerTextureManager::init()
U8* data = image_raw->getData();
memset(data, 0, dim * dim * 3);
- LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE);
+ LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), true);
#if 1
LLPointer<LLViewerFetchedTexture> imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT);
@@ -400,7 +404,7 @@ void LLViewerTextureManager::init()
imagep->setCachedRawImage(0, image_raw);
image_raw = NULL;
#else
- LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
+ LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, true, LLGLTexture::BOOST_UI);
#endif
LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER);
@@ -418,7 +422,7 @@ void LLViewerTextureManager::init()
data[i+2] = color;
}
- LLViewerTexture::sCheckerBoardImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE);
+ LLViewerTexture::sCheckerBoardImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), true);
LLViewerTexture::initClass();
@@ -508,7 +512,10 @@ void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &p
timer.reset();
{
- gpu_res = (S32Megabytes)gViewerWindow->getWindow()->getAvailableVRAMMegabytes();
+ // For purposes of texture memory need to check both, actual free
+ // memory and estimated free texture memory from bias calculations
+ U32 free_memory = llmin(gViewerWindow->getWindow()->getAvailableVRAMMegabytes(), (U32)sFreeVRAMMegabytes);
+ gpu_res = (S32Megabytes)free_memory;
//check main memory, only works for windows and macos.
LLMemory::updateMemoryInfo();
@@ -545,7 +552,8 @@ void LLViewerTexture::updateClass()
F32 budget = max_vram_budget == 0 ? gGLManager.mVRAM : max_vram_budget;
// try to leave half a GB for everyone else, but keep at least 768MB for ourselves
- F32 target = llmax(budget - 512.f, 768.f);
+ F32 target = llmax(budget - 512.f, MIN_VRAM_BUDGET);
+ sFreeVRAMMegabytes = target - used;
F32 over_pct = llmax((used-target) / target, 0.f);
sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.f + over_pct);
@@ -562,7 +570,7 @@ void LLViewerTexture::updateClass()
//-------------------------------------------------------------------------------------------
const U32 LLViewerTexture::sCurrentFileVersion = 1;
-LLViewerTexture::LLViewerTexture(BOOL usemipmaps) :
+LLViewerTexture::LLViewerTexture(bool usemipmaps) :
LLGLTexture(usemipmaps)
{
init(true);
@@ -571,7 +579,7 @@ LLViewerTexture::LLViewerTexture(BOOL usemipmaps) :
sImageCount++;
}
-LLViewerTexture::LLViewerTexture(const LLUUID& id, BOOL usemipmaps) :
+LLViewerTexture::LLViewerTexture(const LLUUID& id, bool usemipmaps) :
LLGLTexture(usemipmaps),
mID(id)
{
@@ -580,7 +588,7 @@ LLViewerTexture::LLViewerTexture(const LLUUID& id, BOOL usemipmaps) :
sImageCount++;
}
-LLViewerTexture::LLViewerTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps) :
+LLViewerTexture::LLViewerTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps) :
LLGLTexture(width, height, components, usemipmaps)
{
init(true);
@@ -589,7 +597,7 @@ LLViewerTexture::LLViewerTexture(const U32 width, const U32 height, const U8 com
sImageCount++;
}
-LLViewerTexture::LLViewerTexture(const LLImageRaw* raw, BOOL usemipmaps) :
+LLViewerTexture::LLViewerTexture(const LLImageRaw* raw, bool usemipmaps) :
LLGLTexture(raw, usemipmaps)
{
init(true);
@@ -737,9 +745,9 @@ bool LLViewerTexture::bindDefaultImage(S32 stage)
}
//virtual
-BOOL LLViewerTexture::isMissingAsset()const
+bool LLViewerTexture::isMissingAsset()const
{
- return FALSE;
+ return false;
}
//virtual
@@ -747,12 +755,12 @@ void LLViewerTexture::forceImmediateUpdate()
{
}
-void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) const
+void LLViewerTexture::addTextureStats(F32 virtual_size, bool needs_gltexture) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
if(needs_gltexture)
{
- mNeedsGLTexture = TRUE;
+ mNeedsGLTexture = true;
}
virtual_size = llmin(virtual_size, LLViewerFetchedTexture::sMaxVirtualSize);
@@ -940,7 +948,7 @@ void LLViewerTexture::setCachedRawImage(S32 discard_level, LLImageRaw* imageraw)
//nothing here.
}
-BOOL LLViewerTexture::isLargeImage()
+bool LLViewerTexture::isLargeImage()
{
return (S32)mTexelsPerImage > LLViewerTexture::sMinLargeImageSize;
}
@@ -997,11 +1005,11 @@ LLViewerFetchedTexture* LLViewerFetchedTexture::getSmokeImage()
return sSmokeImagep;
}
-LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, const LLHost& host, BOOL usemipmaps)
+LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, const LLHost& host, bool usemipmaps)
: LLViewerTexture(id, usemipmaps),
mTargetHost(host)
{
- init(TRUE);
+ init(true);
mFTType = f_type;
if (mFTType == FTT_HOST_BAKE)
{
@@ -1010,18 +1018,18 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type,
generateGLTexture();
}
-LLViewerFetchedTexture::LLViewerFetchedTexture(const LLImageRaw* raw, FTType f_type, BOOL usemipmaps)
+LLViewerFetchedTexture::LLViewerFetchedTexture(const LLImageRaw* raw, FTType f_type, bool usemipmaps)
: LLViewerTexture(raw, usemipmaps)
{
- init(TRUE);
+ init(true);
mFTType = f_type;
}
-LLViewerFetchedTexture::LLViewerFetchedTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps)
+LLViewerFetchedTexture::LLViewerFetchedTexture(const std::string& url, FTType f_type, const LLUUID& id, bool usemipmaps)
: LLViewerTexture(id, usemipmaps),
mUrl(url)
{
- init(TRUE);
+ init(true);
mFTType = f_type;
generateGLTexture();
}
@@ -1030,20 +1038,20 @@ void LLViewerFetchedTexture::init(bool firstinit)
{
mOrigWidth = 0;
mOrigHeight = 0;
- mHasAux = FALSE;
- mNeedsAux = FALSE;
+ mHasAux = false;
+ mNeedsAux = false;
mRequestedDiscardLevel = -1;
mRequestedDownloadPriority = 0.f;
- mFullyLoaded = FALSE;
+ mFullyLoaded = false;
mCanUseHTTP = true;
mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
- mDecodingAux = FALSE;
+ mDecodingAux = false;
mKnownDrawWidth = 0;
mKnownDrawHeight = 0;
- mKnownDrawSizeChanged = FALSE;
+ mKnownDrawSizeChanged = false;
if (firstinit)
{
@@ -1052,43 +1060,43 @@ void LLViewerFetchedTexture::init(bool firstinit)
// Only set mIsMissingAsset true when we know for certain that the database
// does not contain this image.
- mIsMissingAsset = FALSE;
+ mIsMissingAsset = false;
mLoadedCallbackDesiredDiscardLevel = S8_MAX;
- mPauseLoadedCallBacks = FALSE;
+ mPauseLoadedCallBacks = false;
mNeedsCreateTexture = false;
- mIsRawImageValid = FALSE;
+ mIsRawImageValid = false;
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
mMinDiscardLevel = 0;
- mHasFetcher = FALSE;
- mIsFetching = FALSE;
+ mHasFetcher = false;
+ mIsFetching = false;
mFetchState = 0;
mFetchPriority = 0;
mDownloadProgress = 0.f;
mFetchDeltaTime = 999999.f;
mRequestDeltaTime = 0.f;
- mForSculpt = FALSE;
- mIsFetched = FALSE;
- mInFastCacheList = FALSE;
+ mForSculpt = false;
+ mIsFetched = false;
+ mInFastCacheList = false;
mCachedRawImage = NULL;
mCachedRawDiscardLevel = -1;
- mCachedRawImageReady = FALSE;
+ mCachedRawImageReady = false;
mSavedRawImage = NULL;
- mForceToSaveRawImage = FALSE;
- mSaveRawImage = FALSE;
+ mForceToSaveRawImage = false;
+ mSaveRawImage = false;
mSavedRawDiscardLevel = -1;
mDesiredSavedRawDiscardLevel = -1;
mLastReferencedSavedRawImageTime = 0.0f;
mKeptSavedRawImageTime = 0.f;
mLastCallBackActiveTime = 0.f;
- mForceCallbackFetch = FALSE;
- mInDebug = FALSE;
- mUnremovable = FALSE;
+ mForceCallbackFetch = false;
+ mInDebug = false;
+ mUnremovable = false;
mFTType = FTT_UNKNOWN;
}
@@ -1126,18 +1134,18 @@ void LLViewerFetchedTexture::cleanup()
LLLoadedCallbackEntry *entryp = *iter++;
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
- entryp->mCallback( FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData );
+ entryp->mCallback( false, this, NULL, NULL, 0, true, entryp->mUserData );
entryp->removeTexture(this);
delete entryp;
}
mLoadedCallbackList.clear();
- mNeedsAux = FALSE;
+ mNeedsAux = false;
// Clean up image data
destroyRawImage();
mCachedRawImage = NULL;
mCachedRawDiscardLevel = -1;
- mCachedRawImageReady = FALSE;
+ mCachedRawImageReady = false;
mSavedRawImage = NULL;
mSavedRawDiscardLevel = -1;
}
@@ -1150,7 +1158,7 @@ void LLViewerFetchedTexture::loadFromFastCache()
{
return; //no need to access the fast cache.
}
- mInFastCacheList = FALSE;
+ mInFastCacheList = false;
add(LLTextureFetch::sCacheAttempt, 1.0);
@@ -1203,7 +1211,7 @@ void LLViewerFetchedTexture::loadFromFastCache()
}
mRequestedDiscardLevel = mDesiredDiscardLevel + 1;
- mIsRawImageValid = TRUE;
+ mIsRawImageValid = true;
addToCreateTexture();
}
}
@@ -1217,7 +1225,7 @@ void LLViewerFetchedTexture::setForSculpt()
{
static const S32 MAX_INTERVAL = 8; //frames
- mForSculpt = TRUE;
+ mForSculpt = true;
if(isForSculptOnly() && hasGLTexture() && !getBoundRecently())
{
destroyGLTexture(); //sculpt image does not need gl texture.
@@ -1227,22 +1235,22 @@ void LLViewerFetchedTexture::setForSculpt()
setMaxVirtualSizeResetInterval(MAX_INTERVAL);
}
-BOOL LLViewerFetchedTexture::isForSculptOnly() const
+bool LLViewerFetchedTexture::isForSculptOnly() const
{
return mForSculpt && !mNeedsGLTexture;
}
-BOOL LLViewerFetchedTexture::isDeleted()
+bool LLViewerFetchedTexture::isDeleted()
{
return mTextureState == DELETED;
}
-BOOL LLViewerFetchedTexture::isInactive()
+bool LLViewerFetchedTexture::isInactive()
{
return mTextureState == INACTIVE;
}
-BOOL LLViewerFetchedTexture::isDeletionCandidate()
+bool LLViewerFetchedTexture::isDeletionCandidate()
{
return mTextureState == DELETION_CANDIDATE;
}
@@ -1264,7 +1272,7 @@ void LLViewerFetchedTexture::setInactive()
}
}
-BOOL LLViewerFetchedTexture::isFullyLoaded() const
+bool LLViewerFetchedTexture::isFullyLoaded() const
{
// Unfortunately, the boolean "mFullyLoaded" is never updated correctly so we use that logic
// to check if the texture is there and completely downloaded
@@ -1311,7 +1319,7 @@ void LLViewerFetchedTexture::destroyTexture()
//LL_DEBUGS("Avatar") << mID << LL_ENDL;
destroyGLTexture();
- mFullyLoaded = FALSE;
+ mFullyLoaded = false;
}
void LLViewerFetchedTexture::addToCreateTexture()
@@ -1337,7 +1345,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
}
//discard the cached raw image and the saved raw image
- mCachedRawImageReady = FALSE;
+ mCachedRawImageReady = false;
mCachedRawDiscardLevel = -1;
mCachedRawImage = NULL;
mSavedRawDiscardLevel = -1;
@@ -1347,7 +1355,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
if(isForSculptOnly())
{
//just update some variables, not to create a real GL texture.
- createGLTexture(mRawDiscardLevel, mRawImage, 0, FALSE);
+ createGLTexture(mRawDiscardLevel, mRawImage, 0, false);
mNeedsCreateTexture = false;
destroyRawImage();
}
@@ -1409,7 +1417,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
}
// ONLY called from LLViewerTextureList
-BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
+bool LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
#if LL_IMAGEGL_THREAD_CHECK
@@ -1419,7 +1427,7 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
if (!mNeedsCreateTexture)
{
destroyRawImage();
- return FALSE;
+ return false;
}
mNeedsCreateTexture = false;
@@ -1431,13 +1439,13 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
{
LL_WARNS() << "Can't create a texture: invalid image data" << LL_ENDL;
destroyRawImage();
- return FALSE;
+ return false;
}
// LL_INFOS() << llformat("IMAGE Creating (%d) [%d x %d] Bytes: %d ",
// mRawDiscardLevel,
// mRawImage->getWidth(), mRawImage->getHeight(),mRawImage->getDataSize())
// << mID.getString() << LL_ENDL;
- BOOL res = TRUE;
+ bool res = true;
// store original size only for locally-sourced images
if (mUrl.compare(0, 7, "file://") == 0)
@@ -1453,7 +1461,7 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
}
else
{ // leave black border, do not scale image content
- mRawImage->expandToPowerOfTwo(MAX_IMAGE_SIZE, FALSE);
+ mRawImage->expandToPowerOfTwo(MAX_IMAGE_SIZE, false);
}
mFullWidth = mRawImage->getWidth();
@@ -1499,7 +1507,7 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
LL_WARNS() << "!size_ok, setting as missing" << LL_ENDL;
setIsMissingAsset();
destroyRawImage();
- return FALSE;
+ return false;
}
if (mGLTexturep->getHasExplicitFormat())
@@ -1518,21 +1526,21 @@ BOOL LLViewerFetchedTexture::preCreateTexture(S32 usename/*= 0*/)
setIsMissingAsset();
destroyRawImage();
LLAppViewer::getTextureCache()->removeFromCache(mID);
- return FALSE;
+ return false;
}
}
return res;
}
-BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/)
+bool LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/)
{
if (!mNeedsCreateTexture)
{
- return FALSE;
+ return false;
}
- BOOL res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel);
+ bool res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, true, mBoostLevel);
return res;
}
@@ -1552,7 +1560,7 @@ void LLViewerFetchedTexture::postCreateTexture()
if (!needsToSaveRawImage())
{
- mNeedsAux = FALSE;
+ mNeedsAux = false;
destroyRawImage();
}
@@ -1645,8 +1653,8 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height)
mKnownDrawWidth = llmax(mKnownDrawWidth, width);
mKnownDrawHeight = llmax(mKnownDrawHeight, height);
- mKnownDrawSizeChanged = TRUE;
- mFullyLoaded = FALSE;
+ mKnownDrawSizeChanged = true;
+ mFullyLoaded = false;
}
addTextureStats((F32)(mKnownDrawWidth * mKnownDrawHeight));
}
@@ -1681,7 +1689,7 @@ void LLViewerFetchedTexture::processTextureStats()
if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more
{
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel);
- mFullyLoaded = FALSE;
+ mFullyLoaded = false;
}
//setDebugText("fully loaded");
}
@@ -1731,11 +1739,11 @@ void LLViewerFetchedTexture::processTextureStats()
mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel());
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel);
}
- mKnownDrawSizeChanged = FALSE;
+ mKnownDrawSizeChanged = false;
if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel))
{
- mFullyLoaded = TRUE;
+ mFullyLoaded = true;
}
}
}
@@ -1745,7 +1753,7 @@ void LLViewerFetchedTexture::processTextureStats()
mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel);
if(getDiscardLevel() < 0 || getDiscardLevel() > mDesiredDiscardLevel)
{
- mFullyLoaded = FALSE;
+ mFullyLoaded = false;
}
}
}
@@ -1781,10 +1789,10 @@ bool LLViewerFetchedTexture::setDebugFetching(S32 debug_level)
{
if(debug_level < 0)
{
- mInDebug = FALSE;
+ mInDebug = false;
return false;
}
- mInDebug = TRUE;
+ mInDebug = true;
mDesiredDiscardLevel = debug_level;
@@ -1877,12 +1885,12 @@ bool LLViewerFetchedTexture::updateFetch()
if (mRawImage.notNull()) sRawCount++;
if (mAuxRawImage.notNull())
{
- mHasAux = TRUE;
+ mHasAux = true;
sAuxCount++;
}
if (finished)
{
- mIsFetching = FALSE;
+ mIsFetching = false;
mLastFetchState = -1;
mLastPacketTimer.reset();
}
@@ -1899,7 +1907,7 @@ bool LLViewerFetchedTexture::updateFetch()
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
- mIsFetched = TRUE;
+ mIsFetched = true;
tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID));
}
mRawDiscardLevel = fetch_discard;
@@ -1918,12 +1926,12 @@ bool LLViewerFetchedTexture::updateFetch()
LL_WARNS() << "oversize, setting as missing" << LL_ENDL;
setIsMissingAsset();
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
- mIsFetching = FALSE;
+ mIsFetching = false;
mLastPacketTimer.reset();
}
else
{
- mIsRawImageValid = TRUE;
+ mIsRawImageValid = true;
addToCreateTexture();
}
@@ -1951,7 +1959,7 @@ bool LLViewerFetchedTexture::updateFetch()
}
}
- return TRUE;
+ return true;
}
else
{
@@ -2095,8 +2103,8 @@ bool LLViewerFetchedTexture::updateFetch()
if (fetch_request_discard >= 0)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created");
- mHasFetcher = TRUE;
- mIsFetching = TRUE;
+ mHasFetcher = true;
+ mIsFetching = true;
// in some cases createRequest can modify discard, as an example
// bake textures are always at discard 0
mRequestedDiscardLevel = llmin(desired_discard, fetch_request_discard);
@@ -2120,7 +2128,7 @@ bool LLViewerFetchedTexture::updateFetch()
{
LL_DEBUGS("Texture") << "exceeded idle time " << FETCH_IDLE_TIME << ", deleting request: " << getID() << LL_ENDL;
LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
- mHasFetcher = FALSE;
+ mHasFetcher = false;
}
}
@@ -2147,8 +2155,8 @@ void LLViewerFetchedTexture::forceToDeleteRequest()
{
if (mHasFetcher)
{
- mHasFetcher = FALSE;
- mIsFetching = FALSE;
+ mHasFetcher = false;
+ mIsFetching = false;
}
resetTextureStats();
@@ -2156,7 +2164,7 @@ void LLViewerFetchedTexture::forceToDeleteRequest()
mDesiredDiscardLevel = getMaxDiscardLevel() + 1;
}
-void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing)
+void LLViewerFetchedTexture::setIsMissingAsset(bool is_missing)
{
if (is_missing == mIsMissingAsset)
{
@@ -2181,8 +2189,8 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing)
if (mHasFetcher)
{
LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
- mHasFetcher = FALSE;
- mIsFetching = FALSE;
+ mHasFetcher = false;
+ mIsFetching = false;
mLastPacketTimer.reset();
mFetchState = 0;
mFetchPriority = 0;
@@ -2196,8 +2204,8 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing)
}
void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_callback,
- S32 discard_level, BOOL keep_imageraw, BOOL needs_aux, void* userdata,
- LLLoadedCallbackEntry::source_callback_list_t* src_callback_list, BOOL pause)
+ S32 discard_level, bool keep_imageraw, bool needs_aux, void* userdata,
+ LLLoadedCallbackEntry::source_callback_list_t* src_callback_list, bool pause)
{
//
// Don't do ANYTHING here, just add it to the global callback list
@@ -2231,7 +2239,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call
mNeedsAux |= needs_aux;
if(keep_imageraw)
{
- mSaveRawImage = TRUE;
+ mSaveRawImage = true;
}
if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0)
{
@@ -2264,7 +2272,7 @@ void LLViewerFetchedTexture::clearCallbackEntryList()
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
- entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData);
+ entryp->mCallback(false, this, NULL, NULL, 0, true, entryp->mUserData);
iter = mLoadedCallbackList.erase(iter);
delete entryp;
}
@@ -2296,7 +2304,7 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so
{
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
- entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData);
+ entryp->mCallback(false, this, NULL, NULL, 0, true, entryp->mUserData);
iter = mLoadedCallbackList.erase(iter);
delete entryp;
}
@@ -2340,30 +2348,30 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry:
{
if(!callback_list)
{
- mPauseLoadedCallBacks = FALSE;
+ mPauseLoadedCallBacks = false;
return;
}
- BOOL need_raw = FALSE;
+ bool need_raw = false;
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
iter != mLoadedCallbackList.end(); )
{
LLLoadedCallbackEntry *entryp = *iter++;
if(entryp->mSourceCallbackList == callback_list)
{
- entryp->mPaused = FALSE;
+ entryp->mPaused = false;
if(entryp->mNeedsImageRaw)
{
- need_raw = TRUE;
+ need_raw = true;
}
}
}
- mPauseLoadedCallBacks = FALSE ;
+ mPauseLoadedCallBacks = false ;
mLastCallBackActiveTime = sCurrentTime ;
- mForceCallbackFetch = TRUE;
+ mForceCallbackFetch = true;
if(need_raw)
{
- mSaveRawImage = TRUE;
+ mSaveRawImage = true;
}
}
@@ -2382,7 +2390,7 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s
LLLoadedCallbackEntry *entryp = *iter++;
if(entryp->mSourceCallbackList == callback_list)
{
- entryp->mPaused = TRUE;
+ entryp->mPaused = true;
}
else if(!entryp->mPaused)
{
@@ -2392,9 +2400,9 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s
if(paused)
{
- mPauseLoadedCallBacks = TRUE;//when set, loaded callback is paused.
+ mPauseLoadedCallBacks = true;//when set, loaded callback is paused.
resetTextureStats();
- mSaveRawImage = FALSE;
+ mSaveRawImage = false;
}
}
@@ -2445,7 +2453,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
LLLoadedCallbackEntry *entryp = *iter++;
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
- entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData);
+ entryp->mCallback(false, this, NULL, NULL, 0, true, entryp->mUserData);
delete entryp;
}
mLoadedCallbackList.clear();
@@ -2578,11 +2586,11 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
{
LL_WARNS() << "Raw Image with no Aux Data for callback" << LL_ENDL;
}
- BOOL final = mRawDiscardLevel <= entryp->mDesiredDiscard ? TRUE : FALSE;
+ bool final = mRawDiscardLevel <= entryp->mDesiredDiscard ? true : false;
//LL_INFOS() << "Running callback for " << getID() << LL_ENDL;
//LL_INFOS() << mRawImage->getWidth() << "x" << mRawImage->getHeight() << LL_ENDL;
entryp->mLastUsedDiscard = mRawDiscardLevel;
- entryp->mCallback(TRUE, this, mRawImage, mAuxRawImage, mRawDiscardLevel, final, entryp->mUserData);
+ entryp->mCallback(true, this, mRawImage, mAuxRawImage, mRawDiscardLevel, final, entryp->mUserData);
if (final)
{
iter = mLoadedCallbackList.erase(curiter);
@@ -2609,9 +2617,9 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
if (!entryp->mNeedsImageRaw && (entryp->mLastUsedDiscard > gl_discard))
{
mLastCallBackActiveTime = sCurrentTime;
- BOOL final = gl_discard <= entryp->mDesiredDiscard ? TRUE : FALSE;
+ bool final = gl_discard <= entryp->mDesiredDiscard ? true : false;
entryp->mLastUsedDiscard = gl_discard;
- entryp->mCallback(TRUE, this, NULL, NULL, gl_discard, final, entryp->mUserData);
+ entryp->mCallback(true, this, NULL, NULL, gl_discard, final, entryp->mUserData);
if (final)
{
iter = mLoadedCallbackList.erase(curiter);
@@ -2636,7 +2644,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
{
//wait for long enough but no fetching request issued, force one.
forceToRefetchTexture(mLoadedCallbackDesiredDiscardLevel, 5.f);
- mForceCallbackFetch = FALSE; //fire once.
+ mForceCallbackFetch = false; //fire once.
}
return res;
@@ -2709,7 +2717,7 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level)
mRawDiscardLevel = discard_level;
}
}
- mIsRawImageValid = TRUE;
+ mIsRawImageValid = true;
sRawCount++;
return mRawImage;
@@ -2744,7 +2752,7 @@ void LLViewerFetchedTexture::destroyRawImage()
mRawImage = NULL;
- mIsRawImageValid = FALSE;
+ mIsRawImageValid = false;
mRawDiscardLevel = INVALID_DISCARD_LEVEL;
}
}
@@ -2768,7 +2776,7 @@ void LLViewerFetchedTexture::switchToCachedImage()
gTextureList.dirtyImage(this);
}
- mIsRawImageValid = TRUE;
+ mIsRawImageValid = true;
mRawDiscardLevel = mCachedRawDiscardLevel;
scheduleCreateTexture();
@@ -2814,7 +2822,7 @@ void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* im
mCachedRawImage = imageraw;
}
mCachedRawDiscardLevel = discard_level;
- mCachedRawImageReady = TRUE;
+ mCachedRawImageReady = true;
}
}
@@ -2885,7 +2893,7 @@ void LLViewerFetchedTexture::checkCachedRawSculptImage()
{
if(getDiscardLevel() != 0)
{
- mCachedRawImageReady = FALSE;
+ mCachedRawImageReady = false;
}
else if(isForSculptOnly())
{
@@ -2902,6 +2910,8 @@ void LLViewerFetchedTexture::saveRawImage()
return;
}
+ LLImageDataSharedLock lock(mRawImage);
+
mSavedRawDiscardLevel = mRawDiscardLevel;
if (mBoostLevel == LLGLTexture::BOOST_ICON)
{
@@ -2938,7 +2948,7 @@ void LLViewerFetchedTexture::saveRawImage()
if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel)
{
- mForceToSaveRawImage = FALSE;
+ mForceToSaveRawImage = false;
}
mLastReferencedSavedRawImageTime = sCurrentTime;
@@ -2954,7 +2964,7 @@ void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard, F32 kept
}
//trigger a new fetch.
- mForceToSaveRawImage = TRUE ;
+ mForceToSaveRawImage = true ;
mDesiredSavedRawDiscardLevel = desired_discard ;
mKeptSavedRawImageTime = kept_time ;
mLastReferencedSavedRawImageTime = sCurrentTime ;
@@ -2974,7 +2984,7 @@ void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, F32 kept_t
if(!mForceToSaveRawImage || mDesiredSavedRawDiscardLevel < 0 || mDesiredSavedRawDiscardLevel > desired_discard)
{
- mForceToSaveRawImage = TRUE;
+ mForceToSaveRawImage = true;
mDesiredSavedRawDiscardLevel = desired_discard;
//copy from the cached raw image if exists.
@@ -2997,14 +3007,14 @@ void LLViewerFetchedTexture::destroySavedRawImage()
return; //keep the saved raw image.
}
- mForceToSaveRawImage = FALSE;
- mSaveRawImage = FALSE;
+ mForceToSaveRawImage = false;
+ mSaveRawImage = false;
clearCallbackEntryList();
mSavedRawImage = NULL ;
- mForceToSaveRawImage = FALSE ;
- mSaveRawImage = FALSE ;
+ mForceToSaveRawImage = false ;
+ mSaveRawImage = false ;
mSavedRawDiscardLevel = -1 ;
mDesiredSavedRawDiscardLevel = -1 ;
mLastReferencedSavedRawImageTime = 0.0f ;
@@ -3024,7 +3034,7 @@ LLImageRaw* LLViewerFetchedTexture::getSavedRawImage()
return mSavedRawImage;
}
-BOOL LLViewerFetchedTexture::hasSavedRawImage() const
+bool LLViewerFetchedTexture::hasSavedRawImage() const
{
return mSavedRawImage.notNull();
}
@@ -3041,16 +3051,16 @@ F32 LLViewerFetchedTexture::getElapsedLastReferencedSavedRawImageTime() const
//----------------------------------------------------------------------------------------------
//start of LLViewerLODTexture
//----------------------------------------------------------------------------------------------
-LLViewerLODTexture::LLViewerLODTexture(const LLUUID& id, FTType f_type, const LLHost& host, BOOL usemipmaps)
+LLViewerLODTexture::LLViewerLODTexture(const LLUUID& id, FTType f_type, const LLHost& host, bool usemipmaps)
: LLViewerFetchedTexture(id, f_type, host, usemipmaps)
{
- init(TRUE);
+ init(true);
}
-LLViewerLODTexture::LLViewerLODTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps)
+LLViewerLODTexture::LLViewerLODTexture(const std::string& url, FTType f_type, const LLUUID& id, bool usemipmaps)
: LLViewerFetchedTexture(url, f_type, id, usemipmaps)
{
- init(TRUE);
+ init(true);
}
void LLViewerLODTexture::init(bool firstinit)
@@ -3276,7 +3286,7 @@ LLViewerMediaTexture* LLViewerMediaTexture::findMediaTexture(const LLUUID& media
return media_tex;
}
-LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LLImageGL* gl_image)
+LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, bool usemipmaps, LLImageGL* gl_image)
: LLViewerTexture(id, usemipmaps),
mMediaImplp(NULL),
mUpdateVirtualSizeTime(0)
@@ -3292,9 +3302,9 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL
mGLTexturep->setAllowCompression(false);
- mGLTexturep->setNeedsAlphaAndPickMask(FALSE);
+ mGLTexturep->setNeedsAlphaAndPickMask(false);
- mIsPlaying = FALSE;
+ mIsPlaying = false;
setMediaImpl();
@@ -3317,17 +3327,17 @@ LLViewerMediaTexture::~LLViewerMediaTexture()
}
}
-void LLViewerMediaTexture::reinit(BOOL usemipmaps /* = TRUE */)
+void LLViewerMediaTexture::reinit(bool usemipmaps /* = true */)
{
llassert(mGLTexturep.notNull());
mUseMipMaps = usemipmaps;
getLastReferencedTimer()->reset();
mGLTexturep->setUseMipMaps(mUseMipMaps);
- mGLTexturep->setNeedsAlphaAndPickMask(FALSE);
+ mGLTexturep->setNeedsAlphaAndPickMask(false);
}
-void LLViewerMediaTexture::setUseMipMaps(BOOL mipmap)
+void LLViewerMediaTexture::setUseMipMaps(bool mipmap)
{
mUseMipMaps = mipmap;
@@ -3359,11 +3369,11 @@ void LLViewerMediaTexture::setMediaImpl()
//return true if all faces to reference to this media texture are found
//Note: mMediaFaceList is valid only for the current instant
// because it does not check the face validity after the current frame.
-BOOL LLViewerMediaTexture::findFaces()
+bool LLViewerMediaTexture::findFaces()
{
mMediaFaceList.clear();
- BOOL ret = TRUE;
+ bool ret = true;
LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_STANDARD);
if(tex) //this media is a parcel media for tex.
@@ -3384,7 +3394,7 @@ BOOL LLViewerMediaTexture::findFaces()
if(!mMediaImplp)
{
- return TRUE;
+ return true;
}
//for media on a face.
@@ -3400,13 +3410,13 @@ BOOL LLViewerMediaTexture::findFaces()
// If this happens, viewer is likely to crash
llassert(0);
LL_WARNS() << "Dead object in mMediaImplp's object list" << LL_ENDL;
- ret = FALSE;
+ ret = false;
continue;
}
if (obj->mDrawable.isNull() || obj->mDrawable->isDead())
{
- ret = FALSE;
+ ret = false;
continue;
}
@@ -3421,7 +3431,7 @@ BOOL LLViewerMediaTexture::findFaces()
}
else
{
- ret = FALSE;
+ ret = false;
}
}
}
@@ -3470,9 +3480,9 @@ void LLViewerMediaTexture::removeMediaFromFace(LLFace* facep)
return; //no need to remove the face because the media is not in playing.
}
- mIsPlaying = FALSE; //set to remove the media from the face.
+ mIsPlaying = false; //set to remove the media from the face.
switchTexture(LLRender::DIFFUSE_MAP, facep);
- mIsPlaying = TRUE; //set the flag back.
+ mIsPlaying = true; //set the flag back.
if(getTotalNumFaces() < 1) //no face referencing to this media
{
@@ -3603,7 +3613,7 @@ void LLViewerMediaTexture::stopPlaying()
// {
// mMediaImplp->stop();
// }
- mIsPlaying = FALSE;
+ mIsPlaying = false;
}
void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep)
@@ -3644,7 +3654,7 @@ void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep)
}
}
-void LLViewerMediaTexture::setPlaying(BOOL playing)
+void LLViewerMediaTexture::setPlaying(bool playing)
{
if(!mMediaImplp)
{
@@ -3666,7 +3676,7 @@ void LLViewerMediaTexture::setPlaying(BOOL playing)
if(findFaces())
{
//about to update all faces.
- mMediaImplp->setUpdated(FALSE);
+ mMediaImplp->setUpdated(false);
}
if(mMediaFaceList.empty())//no face pointing to this media
@@ -3704,7 +3714,7 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
if(!mMaxVirtualSizeResetCounter)
{
- addTextureStats(0.f, FALSE);//reset
+ addTextureStats(0.f, false);//reset
}
if(mIsPlaying) //media is playing
@@ -3799,13 +3809,13 @@ void LLTexturePipelineTester::update()
//start a new fetching session
reset();
mStartFetchingTime = LLImageGL::sLastFrameTime;
- mPause = FALSE;
+ mPause = false;
}
//update total gray time
if(mUsingDefaultTexture)
{
- mUsingDefaultTexture = FALSE;
+ mUsingDefaultTexture = false;
mTotalGrayTime = LLImageGL::sLastFrameTime - mStartFetchingTime;
}
@@ -3817,7 +3827,7 @@ void LLTexturePipelineTester::update()
else if(!mPause)
{
//stop the current fetching session
- mPause = TRUE;
+ mPause = true;
outputTestResults();
reset();
}
@@ -3825,9 +3835,9 @@ void LLTexturePipelineTester::update()
void LLTexturePipelineTester::reset()
{
- mPause = TRUE;
+ mPause = true;
- mUsingDefaultTexture = FALSE;
+ mUsingDefaultTexture = false;
mStartStablizingTime = 0.0f;
mEndStablizingTime = 0.0f;
@@ -3878,7 +3888,7 @@ void LLTexturePipelineTester::updateTextureBindingStats(const LLViewerTexture* i
}
}
-void LLTexturePipelineTester::updateTextureLoadingStats(const LLViewerFetchedTexture* imagep, const LLImageRaw* raw_imagep, BOOL from_cache)
+void LLTexturePipelineTester::updateTextureLoadingStats(const LLViewerFetchedTexture* imagep, const LLImageRaw* raw_imagep, bool from_cache)
{
U32Bytes data_size = (U32Bytes)raw_imagep->getDataSize();
mTotalBytesLoaded += data_size;
@@ -3907,7 +3917,7 @@ void LLTexturePipelineTester::updateTextureLoadingStats(const LLViewerFetchedTex
void LLTexturePipelineTester::updateGrayTextureBinding()
{
- mUsingDefaultTexture = TRUE;
+ mUsingDefaultTexture = true;
}
void LLTexturePipelineTester::setStablizingTime()
@@ -4034,7 +4044,7 @@ LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::lo
//load a session
std::string currentLabel = getCurrentLabelName();
- BOOL in_log = (*log).has(currentLabel);
+ bool in_log = (*log).has(currentLabel);
while (in_log)
{
LLSD::String label = currentLabel;