summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturectrl.cpp
diff options
context:
space:
mode:
authorcosmic-linden <111533034+cosmic-linden@users.noreply.github.com>2024-02-09 07:16:01 -0800
committerGitHub <noreply@github.com>2024-02-09 09:16:01 -0600
commitd6048bfcb2442ca7ec278864b9827d74873efa3a (patch)
tree9a76192342b7ca42ae754d9518606b2545109ca3 /indra/newview/lltexturectrl.cpp
parente24f631110c4fb3ca135b6d6dfaa448062e2f9bd (diff)
Put PBR material swatch behind feature flag (#775)
* secondlife/viewer#771: Put PBR material swatch behind feature flag * secondlife/viewer#771: Make viewer respect PBRMaterialSwatchEnabled from SimulatorFeatures
Diffstat (limited to 'indra/newview/lltexturectrl.cpp')
-rw-r--r--indra/newview/lltexturectrl.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 0439b0b115..5415f9bd9a 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -680,6 +680,10 @@ void LLFloaterTexturePicker::draw()
mGLTFPreview = gGLTFMaterialPreviewMgr.getPreview(mGLTFMaterial);
}
}
+ if (mGLTFPreview)
+ {
+ mGLTFPreview->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
+ }
}
else
{
@@ -735,7 +739,7 @@ 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();
- LLViewerTexture* preview = nullptr;
+ LLViewerTexture* preview;
if (mGLTFMaterial)
{
preview = mGLTFPreview.get();
@@ -743,15 +747,11 @@ void LLFloaterTexturePicker::draw()
else
{
preview = mTexturep.get();
- if (mTexturep)
- {
- // Pump the priority
- mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
- }
}
if( preview )
{
+ preview->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
if( preview->getComponents() == 4 )
{
gl_rect_2d_checkerboard( interior, alpha );
@@ -2219,6 +2219,10 @@ void LLTextureCtrl::draw()
mGLTFPreview = gGLTFMaterialPreviewMgr.getPreview(mGLTFMaterial);
}
}
+ if (mGLTFPreview)
+ {
+ mGLTFPreview->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
+ }
preview = mGLTFPreview;
}
@@ -2257,10 +2261,7 @@ void LLTextureCtrl::draw()
}
gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), preview, UI_VERTEX_COLOR % alpha);
- if (mTexturep)
- {
- mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
- }
+ preview->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
}
else if (!mFallbackImage.isNull())
{