summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r--indra/newview/lltexturectrl.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 3988bceb4e..f302426a43 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -719,17 +719,27 @@ void LLFloaterTexturePicker::draw()
// If the floater is focused, don't apply its alpha to the texture (STORM-677).
const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
- if( mTexturep )
+ LLViewerTexture* texture = nullptr;
+ if (mGLTFMaterial)
+ {
+ texture = mGLTFMaterial->getUITexture();
+ }
+ else
+ {
+ texture = mTexturep.get();
+ }
+
+ if( texture )
{
- if( mTexturep->getComponents() == 4 )
+ if( texture->getComponents() == 4 )
{
gl_rect_2d_checkerboard( interior, alpha );
}
- gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha );
+ gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), texture, UI_VERTEX_COLOR % alpha );
// Pump the priority
- mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
+ texture->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
}
else if (!mFallbackImage.isNull())
{
@@ -2140,11 +2150,21 @@ void LLTextureCtrl::draw()
if (texture.isNull())
{
- texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+ if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL)
+ {
+ LLPointer<LLFetchedGLTFMaterial> material = gGLTFMaterialList.getMaterial(mImageAssetID);
+ if (material)
+ {
+ texture = material->getUITexture();
+ }
+ }
+ else
+ {
+ texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+ texture->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
+ texture->forceToSaveRawImage(0);
+ }
}
-
- texture->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
- texture->forceToSaveRawImage(0) ;
mTexturep = texture;
}