diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 1ed44cad85..90b407da8a 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -1102,6 +1102,9 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)
mDefaultImageAssetID(p.default_image_id),
mDefaultImageName(p.default_image_name),
mFallbackImage(p.fallback_image),
+ // Mask texture if desired
+ mIsMasked(FALSE),
+ // Mask texture if desired
mPreviewMode(!p.enabled) // For texture preview mode
{
setAllowNoTexture(p.allow_no_texture);
@@ -1535,6 +1538,13 @@ void LLTextureCtrl::draw()
gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha);
mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
+ // Mask texture if desired
+ if (mIsMasked)
+ {
+ gl_rect_2d( interior, LLColor4(0.5, 0.5, 0.5, 0.44), TRUE);
+ gl_draw_x( interior, LLColor4::black );
+ }
+ // Mask texture if desired
}
else if (!mFallbackImage.isNull())
{
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index c4b18a5a54..bd1217be0d 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -186,6 +186,9 @@ public:
LLViewerFetchedTexture* getTexture() { return mTexturep; }
+ // Mask texture if desired
+ void setIsMasked(BOOL masked) { mIsMasked = masked; }
+
private:
BOOL allowDrop(LLInventoryItem* item);
BOOL doDrop(LLInventoryItem* item);
@@ -220,6 +223,9 @@ private:
std::string mLoadingPlaceholderString;
S32 mLabelWidth;
BOOL mPreviewMode; // If true open texture in preview floater
+
+ // Mask texture if desired
+ BOOL mIsMasked;
};
// XUI HACK: When floaters converted, switch this file to lltexturepicker.h/cpp