From edb67a898c4d20a1d4f18ad0db9ad02d6157b2ed Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 16 Dec 2009 11:20:44 -0600 Subject: Convert ll_face_list_t in llviewertexture to a std::set to improve performance on face deletion. --- indra/newview/llviewertexture.cpp | 12 ++++++------ indra/newview/llviewertexture.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index faf7a93281..c9558860db 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -614,13 +614,13 @@ void LLViewerTexture::setKnownDrawSize(S32 width, S32 height) //virtual void LLViewerTexture::addFace(LLFace* facep) { - mFaceList.push_back(facep) ; + mFaceList.insert(facep) ; } //virtual void LLViewerTexture::removeFace(LLFace* facep) { - mFaceList.remove(facep) ; + mFaceList.erase(facep); } //virtual @@ -1519,7 +1519,7 @@ void LLViewerFetchedTexture::updateVirtualSize() } if(mFaceList.size() > 0) { - for(std::list::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) + for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) { LLFace* facep = *iter ; if(facep->getDrawable()->isRecentlyVisible()) @@ -2391,7 +2391,7 @@ BOOL LLViewerFetchedTexture::insertToAtlas() LLFace* facep; //if the atlas slot pointers for some faces are null, process them later. - ll_face_list_t waiting_list ; + std::vector waiting_list ; for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) { @@ -2475,7 +2475,7 @@ BOOL LLViewerFetchedTexture::insertToAtlas() } //process the waiting_list - for(ll_face_list_t::iterator iter = waiting_list.begin(); iter != waiting_list.end(); ++iter) + for(std::vector::iterator iter = waiting_list.begin(); iter != waiting_list.end(); ++iter) { facep = (LLFace*)*iter ; groupp = facep->getDrawable()->getSpatialGroup() ; @@ -3153,7 +3153,7 @@ F32 LLViewerMediaTexture::getMaxVirtualSize() { if(mFaceList.size() > 0) { - for(std::list::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) + for(ll_face_list_t::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) { LLFace* facep = *iter ; if(facep->getDrawable()->isRecentlyVisible()) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 141979052d..bf4b1cf800 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -139,7 +139,7 @@ public: static S32 getIndexFromCategory(S32 category) ; static S32 getCategoryFromIndex(S32 index) ; - typedef std::list ll_face_list_t ; + typedef std::set ll_face_list_t ; protected: virtual ~LLViewerTexture(); -- cgit v1.2.3