summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-10-04 00:42:31 +0000
committerDon Kjer <don@lindenlab.com>2012-10-04 00:42:31 +0000
commit8c0aa31536c447edb6ef4fbee43f99debf593a20 (patch)
treef12847d717afae2a57a68e614e6dd602396847e0 /indra/llrender/llimagegl.cpp
parentfe52f09952c78534377f26fc2eef9acff4a9b24d (diff)
Adding optimization to skip alpha image analysis when it isn't needed.
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rwxr-xr-xindra/llrender/llimagegl.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index d561f63544..44224ba72f 100755
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -74,6 +74,9 @@ S32 LLImageGL::sCurTexSizeBar = -1 ;
S32 LLImageGL::sCurTexPickSize = -1 ;
S32 LLImageGL::sMaxCategories = 1 ;
+//optimization for when we don't need to calculate mIsMask
+BOOL LLImageGL::sSkipAnalyzeAlpha;
+
//------------------------
//****************************************************************************************************
//End for texture auditing use only
@@ -169,8 +172,9 @@ BOOL is_little_endian()
return (*c == 0x78) ;
}
//static
-void LLImageGL::initClass(S32 num_catagories)
+void LLImageGL::initClass(S32 num_catagories, BOOL skip_analyze_alpha /* = false */)
{
+ sSkipAnalyzeAlpha = skip_analyze_alpha;
}
//static
@@ -1700,6 +1704,12 @@ BOOL LLImageGL::getBoundRecently() const
return (BOOL)(sLastFrameTime - mLastBindTime < MIN_TEXTURE_LIFETIME);
}
+BOOL LLImageGL::getIsAlphaMask() const
+{
+ llassert_always(!sSkipAnalyzeAlpha);
+ return mIsMask;
+}
+
void LLImageGL::setTarget(const LLGLenum target, const LLTexUnit::eTextureType bind_target)
{
mTarget = target;
@@ -1797,7 +1807,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride()
void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
{
- if(!mNeedsAlphaAndPickMask)
+ if(sSkipAnalyzeAlpha || !mNeedsAlphaAndPickMask)
{
return ;
}