summaryrefslogtreecommitdiff
path: root/indra/newview/llinspecttexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinspecttexture.cpp')
-rw-r--r--indra/newview/llinspecttexture.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp
index f4197e475a..947ee4200d 100644
--- a/indra/newview/llinspecttexture.cpp
+++ b/indra/newview/llinspecttexture.cpp
@@ -115,6 +115,7 @@ public:
protected:
LLPointer<LLViewerFetchedTexture> m_Image;
+ S32 mImageBoostLevel = LLGLTexture::BOOST_NONE;
std::string mLoadingText;
};
@@ -127,7 +128,11 @@ LLTexturePreviewView::LLTexturePreviewView(const LLView::Params& p)
LLTexturePreviewView::~LLTexturePreviewView()
{
- m_Image = nullptr;
+ if (m_Image)
+ {
+ m_Image->setBoostLevel(mImageBoostLevel);
+ m_Image = nullptr;
+ }
}
void LLTexturePreviewView::draw()
@@ -141,26 +146,26 @@ void LLTexturePreviewView::draw()
if (4 == m_Image->getComponents())
{
const LLColor4 color(.098f, .098f, .098f);
- gl_rect_2d(rctClient, color, TRUE);
+ gl_rect_2d(rctClient, color, true);
}
gl_draw_scaled_image(rctClient.mLeft, rctClient.mBottom, rctClient.getWidth(), rctClient.getHeight(), m_Image);
bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0);
if (isLoading)
- LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, llfloor(rctClient.mLeft + 3), llfloor(rctClient.mTop - 25), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
-
- m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
+ LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, rctClient.mLeft + 3, rctClient.mTop - 25, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
+ m_Image->addTextureStats((isLoading) ? MAX_IMAGE_AREA : (F32)(rctClient.getWidth() * rctClient.getHeight()));
}
}
void LLTexturePreviewView::setImageFromAssetId(const LLUUID& idAsset)
{
- m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_THUMBNAIL);
+ m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
if (m_Image)
{
+ mImageBoostLevel = m_Image->getBoostLevel();
+ m_Image->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
m_Image->forceToSaveRawImage(0);
- m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
- if ((!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()))
+ if ( (!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()) )
{
if (m_Image->isInFastCacheList())
{