summaryrefslogtreecommitdiff
path: root/indra/newview/lltextureview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltextureview.cpp')
-rw-r--r--indra/newview/lltextureview.cpp65
1 files changed, 33 insertions, 32 deletions
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 44cd8f0371..70a8ab9f61 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -49,8 +49,8 @@
#include "lltexturecache.h"
#include "lltexturefetch.h"
#include "llviewerobject.h"
-#include "llviewerimage.h"
-#include "llviewerimagelist.h"
+#include "llviewertexture.h"
+#include "llviewertexturelist.h"
#include "llappviewer.h"
extern F32 texmem_lower_bound_scale;
@@ -58,7 +58,7 @@ extern F32 texmem_lower_bound_scale;
LLTextureView *gTextureView = NULL;
//static
-std::set<LLViewerImage*> LLTextureView::sDebugImages;
+std::set<LLViewerFetchedTexture*> LLTextureView::sDebugImages;
////////////////////////////////////////////////////////////////////////////
@@ -79,7 +79,7 @@ static S32 texture_bar_height = 8;
class LLTextureBar : public LLView
{
public:
- LLPointer<LLViewerImage> mImagep;
+ LLPointer<LLViewerFetchedTexture> mImagep;
S32 mHilite;
public:
@@ -109,8 +109,8 @@ public:
{
LLTextureBar* bar1p = (LLTextureBar*)i1;
LLTextureBar* bar2p = (LLTextureBar*)i2;
- LLViewerImage *i1p = bar1p->mImagep;
- LLViewerImage *i2p = bar2p->mImagep;
+ LLViewerFetchedTexture *i1p = bar1p->mImagep;
+ LLViewerFetchedTexture *i2p = bar2p->mImagep;
F32 pri1 = i1p->getDecodePriority(); // i1p->mRequestedDownloadPriority
F32 pri2 = i2p->getDecodePriority(); // i2p->mRequestedDownloadPriority
if (pri1 > pri2)
@@ -128,10 +128,10 @@ public:
{
LLTextureBar* bar1p = (LLTextureBar*)i1;
LLTextureBar* bar2p = (LLTextureBar*)i2;
- LLViewerImage *i1p = bar1p->mImagep;
- LLViewerImage *i2p = bar2p->mImagep;
- U32 pri1 = i1p->mFetchPriority;
- U32 pri2 = i2p->mFetchPriority;
+ LLViewerFetchedTexture *i1p = bar1p->mImagep;
+ LLViewerFetchedTexture *i2p = bar2p->mImagep;
+ U32 pri1 = i1p->getFetchPriority() ;
+ U32 pri2 = i2p->getFetchPriority() ;
if (pri1 > pri2)
return true;
else if (pri2 > pri1)
@@ -315,10 +315,10 @@ void LLTextureBar::draw()
pip_x += pip_width + pip_space;
// we don't want to show bind/resident pips for textures using the default texture
- if (mImagep->getHasGLTexture())
+ if (mImagep->hasValidGLTexture())
{
// Draw the bound pip
- last_event = mImagep->sLastFrameTime - mImagep->mLastBindTime;
+ last_event = mImagep->getTimePassedSinceLastBound();
if (last_event < 1.f)
{
clr = mImagep->getMissed() ? LLColor4::red : LLColor4::magenta1;
@@ -342,7 +342,7 @@ void LLTextureBar::draw()
// draw the image size at the end
{
std::string num_str = llformat("%3dx%3d (%d) %7d", mImagep->getWidth(), mImagep->getHeight(),
- mImagep->getDiscardLevel(), mImagep->mTextureMemory);
+ mImagep->getDiscardLevel(), mImagep->hasGLTexture() ? mImagep->getTextureMemory() : 0);
LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, title_x4, getRect().getHeight(), color,
LLFontGL::LEFT, LLFontGL::TOP);
}
@@ -400,13 +400,13 @@ private:
void LLGLTexMemBar::draw()
{
- S32 bound_mem = BYTES_TO_MEGA_BYTES(LLViewerImage::sBoundTextureMemoryInBytes);
- S32 max_bound_mem = LLViewerImage::sMaxBoundTextureMemInMegaBytes;
- S32 total_mem = BYTES_TO_MEGA_BYTES(LLViewerImage::sTotalTextureMemoryInBytes);
- S32 max_total_mem = LLViewerImage::sMaxTotalTextureMemInMegaBytes;
- F32 discard_bias = LLViewerImage::sDesiredDiscardBias;
+ S32 bound_mem = BYTES_TO_MEGA_BYTES(LLViewerTexture::sBoundTextureMemoryInBytes);
+ S32 max_bound_mem = LLViewerTexture::sMaxBoundTextureMemInMegaBytes;
+ S32 total_mem = BYTES_TO_MEGA_BYTES(LLViewerTexture::sTotalTextureMemoryInBytes);
+ S32 max_total_mem = LLViewerTexture::sMaxTotalTextureMemInMegaBytes;
+ F32 discard_bias = LLViewerTexture::sDesiredDiscardBias;
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
- S32 h_offset = (S32)((texture_bar_height + 2.8f) * mTextureView->mNumTextureBars);
+ S32 h_offset = (S32)((texture_bar_height + 2.5f) * mTextureView->mNumTextureBars + 2.5f);
//----------------------------------------------------------------------------
LLGLSUIDefault gls_ui;
F32 text_color[] = {1.f, 1.f, 1.f, 0.75f};
@@ -477,14 +477,14 @@ void LLGLTexMemBar::draw()
//----------------------------------------------------------------------------
text = llformat("Textures: Count: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d(%d) RAW:%d mRaw:%d mAux:%d CB:%d",
- gImageList.getNumImages(),
+ gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(),
LLLFSThread::sLocal->getPending(),
LLImageWorker::sCount, LLImageWorker::getWorkerThread()->getNumDeletes(),
- LLImageRaw::sRawImageCount, LLViewerImage::sRawCount, LLViewerImage::sAuxCount,
- gImageList.mCallbackList.size());
+ LLImageRaw::sRawImageCount, LLViewerFetchedTexture::sRawCount, LLViewerFetchedTexture::sAuxCount,
+ gTextureList.mCallbackList.size());
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*2,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
@@ -557,7 +557,7 @@ LLTextureView::~LLTextureView()
mGLTexMemBar = 0;
}
-typedef std::pair<F32,LLViewerImage*> decode_pair_t;
+typedef std::pair<F32,LLViewerFetchedTexture*> decode_pair_t;
struct compare_decode_pair
{
bool operator()(const decode_pair_t& a, const decode_pair_t& b)
@@ -587,18 +587,19 @@ void LLTextureView::draw()
llinfos << "ID\tMEM\tBOOST\tPRI\tWIDTH\tHEIGHT\tDISCARD" << llendl;
}
- for (LLViewerImageList::image_priority_list_t::iterator iter = gImageList.mImageList.begin();
- iter != gImageList.mImageList.end(); )
+ for (LLViewerTextureList::image_priority_list_t::iterator iter = gTextureList.mImageList.begin();
+ iter != gTextureList.mImageList.end(); )
{
- LLPointer<LLViewerImage> imagep = *iter++;
+ LLPointer<LLViewerFetchedTexture> imagep = *iter++;
S32 cur_discard = imagep->getDiscardLevel();
S32 desired_discard = imagep->mDesiredDiscardLevel;
if (mPrintList)
{
+ S32 tex_mem = imagep->hasGLTexture() ? imagep->getTextureMemory() : 0 ;
llinfos << imagep->getID()
- << "\t" << imagep->mTextureMemory
+ << "\t" << tex_mem
<< "\t" << imagep->getBoostLevel()
<< "\t" << imagep->getDecodePriority()
<< "\t" << imagep->getWidth()
@@ -643,8 +644,8 @@ void LLTextureView::draw()
{
struct f : public LLSelectedTEFunctor
{
- LLViewerImage* mImage;
- f(LLViewerImage* image) : mImage(image) {}
+ LLViewerFetchedTexture* mImage;
+ f(LLViewerFetchedTexture* image) : mImage(image) {}
virtual bool apply(LLViewerObject* object, S32 te)
{
return (mImage == object->getTEImage(te));
@@ -705,7 +706,7 @@ void LLTextureView::draw()
for (display_list_t::iterator iter = display_image_list.begin();
iter != display_image_list.end(); iter++)
{
- LLViewerImage* imagep = iter->second;
+ LLViewerFetchedTexture* imagep = iter->second;
S32 hilite = 0;
F32 pri = iter->first;
if (pri >= 1 * HIGH_PRIORITY)
@@ -735,7 +736,7 @@ void LLTextureView::draw()
reshape(getRect().getWidth(), getRect().getHeight(), TRUE);
/*
- count = gImageList.getNumImages();
+ count = gTextureList.getNumImages();
std::string info_string;
info_string = llformat("Global Info:\nTexture Count: %d", count);
mInfoTextp->setText(info_string);
@@ -757,7 +758,7 @@ void LLTextureView::draw()
}
-BOOL LLTextureView::addBar(LLViewerImage *imagep, S32 hilite)
+BOOL LLTextureView::addBar(LLViewerFetchedTexture *imagep, S32 hilite)
{
llassert(imagep);