summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-02-16 20:44:53 +0200
committerandreykproductengine <akleshchev@productengine.com>2016-02-16 20:44:53 +0200
commita0e9ee475758c1825ba4a0957f4047e1dc24c8a3 (patch)
tree1fbef6cef6a23b47af1a29266d28120dadfeffc5 /indra/newview/llviewertexture.cpp
parentd8f7a40dea011b3a68fdf8120c8bc7035e93019a (diff)
MAINT-2199 separating UI elements from in-world textures.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rwxr-xr-xindra/newview/llviewertexture.cpp68
1 files changed, 45 insertions, 23 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index c8c71b74b7..50d9467b4a 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -131,7 +131,7 @@ LLLoadedCallbackEntry::LLLoadedCallbackEntry(loaded_callback_func cb,
{
if(mSourceCallbackList)
{
- mSourceCallbackList->insert(target->getID());
+ mSourceCallbackList->insert(LLTextureKey(target->getID(), target->isUITexture()));
}
}
@@ -143,7 +143,7 @@ void LLLoadedCallbackEntry::removeTexture(LLViewerFetchedTexture* tex)
{
if(mSourceCallbackList)
{
- mSourceCallbackList->erase(tex->getID());
+ mSourceCallbackList->erase(LLTextureKey(tex->getID(), tex->isUITexture()));
}
}
@@ -170,24 +170,39 @@ LLViewerMediaTexture* LLViewerTextureManager::createMediaTexture(const LLUUID &m
{
return new LLViewerMediaTexture(media_id, usemipmaps, gl_image);
}
-
-LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id)
+
+void LLViewerTextureManager::findFetchedTextures(const LLUUID& id, std::vector<LLViewerFetchedTexture*> &output)
{
- LLViewerTexture* tex;
- //search fetched texture list
- tex = gTextureList.findImage(id);
-
- //search media texture list
- if(!tex)
- {
- tex = LLViewerTextureManager::findMediaTexture(id);
- }
- return tex;
+ return gTextureList.findTexturesByID(id, output);
+}
+
+void LLViewerTextureManager::findTextures(const LLUUID& id, std::vector<LLViewerTexture*> &output)
+{
+ std::vector<LLViewerFetchedTexture*> fetched_output;
+ gTextureList.findTexturesByID(id, fetched_output);
+ std::vector<LLViewerFetchedTexture*>::iterator iter = fetched_output.begin();
+ while (iter != fetched_output.end())
+ {
+ output.push_back(*iter);
+ iter++;
+ }
+
+ //search media texture list
+ if (output.empty())
+ {
+ LLViewerTexture* tex;
+ tex = LLViewerTextureManager::findMediaTexture(id);
+ if (tex)
+ {
+ output.push_back(tex);
+ }
+ }
+
}
-LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id)
+LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id, bool is_ui)
{
- return gTextureList.findImage(id);
+ return gTextureList.findImage(id, is_ui);
}
LLViewerMediaTexture* LLViewerTextureManager::findMediaTexture(const LLUUID &media_id)
@@ -714,6 +729,13 @@ void LLViewerTexture::setBoostLevel(S32 level)
}
+bool LLViewerTexture::isUITexture()
+{
+ // can be substituted with mDontDiscard
+ return mBoostLevel == LLViewerTexture::BOOST_ICON
+ || mBoostLevel == LLViewerTexture::BOOST_UI;
+}
+
bool LLViewerTexture::isActiveFetching()
{
return false;
@@ -3307,7 +3329,7 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL
setCategory(LLGLTexture::MEDIA);
- LLViewerTexture* tex = gTextureList.findImage(mID);
+ LLViewerTexture* tex = gTextureList.findImage(mID, false);
if(tex) //this media is a parcel media for tex.
{
tex->setParcelMedia(this);
@@ -3317,7 +3339,7 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL
//virtual
LLViewerMediaTexture::~LLViewerMediaTexture()
{
- LLViewerTexture* tex = gTextureList.findImage(mID);
+ LLViewerTexture* tex = gTextureList.findImage(mID, false);
if(tex) //this media is a parcel media for tex.
{
tex->setParcelMedia(NULL);
@@ -3372,7 +3394,7 @@ BOOL LLViewerMediaTexture::findFaces()
BOOL ret = TRUE;
- LLViewerTexture* tex = gTextureList.findImage(mID);
+ LLViewerTexture* tex = gTextureList.findImage(mID, false);
if(tex) //this media is a parcel media for tex.
{
for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch)
@@ -3481,7 +3503,7 @@ void LLViewerMediaTexture::addFace(U32 ch, LLFace* facep)
const LLTextureEntry* te = facep->getTextureEntry();
if(te && te->getID().notNull())
{
- LLViewerTexture* tex = gTextureList.findImage(te->getID());
+ LLViewerTexture* tex = gTextureList.findImage(te->getID(), false);
if(tex)
{
mTextureList.push_back(tex);//increase the reference number by one for tex to avoid deleting it.
@@ -3510,7 +3532,7 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
const LLTextureEntry* te = facep->getTextureEntry();
if(te && te->getID().notNull())
{
- LLViewerTexture* tex = gTextureList.findImage(te->getID());
+ LLViewerTexture* tex = gTextureList.findImage(te->getID(), false);
if(tex)
{
for(std::list< LLPointer<LLViewerTexture> >::iterator iter = mTextureList.begin();
@@ -3619,10 +3641,10 @@ void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep)
const LLTextureEntry* te = facep->getTextureEntry();
if(te)
{
- LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL;
+ LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), false) : NULL;
if(!tex && te->getID() != mID)//try parcel media.
{
- tex = gTextureList.findImage(mID);
+ tex = gTextureList.findImage(mID, false);
}
if(!tex)
{