summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontbitmapcache.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2014-05-07 10:56:41 -0700
committersimon <none@none>2014-05-07 10:56:41 -0700
commit250db74bf9325acdc1169f6c13d297e7fe44b753 (patch)
treec6926efeefeb10ec3a36b296aa1ac7bd8521e0e3 /indra/llrender/llfontbitmapcache.cpp
parent676bad148a72c235ec79742e3f490ca66b4f40d0 (diff)
parentd0ef02c23a7a37c8c9bfe3a86bae88bb811fc9fe (diff)
Pull and merge viewer-release as version 3.7.8
Diffstat (limited to 'indra/llrender/llfontbitmapcache.cpp')
-rwxr-xr-xindra/llrender/llfontbitmapcache.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp
index c985f6b959..f128636ab2 100755
--- a/indra/llrender/llfontbitmapcache.cpp
+++ b/indra/llrender/llfontbitmapcache.cpp
@@ -29,7 +29,8 @@
#include "llgl.h"
#include "llfontbitmapcache.h"
-LLFontBitmapCache::LLFontBitmapCache():
+LLFontBitmapCache::LLFontBitmapCache()
+: LLTrace::MemTrackable<LLFontBitmapCache>("LLFontBitmapCache"),
mNumComponents(0),
mBitmapWidth(0),
mBitmapHeight(0),
@@ -81,6 +82,7 @@ BOOL LLFontBitmapCache::nextOpenPos(S32 width, S32 &pos_x, S32 &pos_y, S32& bitm
{
// We're out of space in the current image, or no image
// has been allocated yet. Make a new one.
+
mImageRawVec.push_back(new LLImageRaw);
mBitmapNum = mImageRawVec.size()-1;
LLImageRaw *image_raw = getImageRaw(mBitmapNum);
@@ -122,6 +124,9 @@ BOOL LLFontBitmapCache::nextOpenPos(S32 width, S32 &pos_x, S32 &pos_y, S32& bitm
image_gl->createGLTexture(0, image_raw);
gGL.getTexUnit(0)->bind(image_gl);
image_gl->setFilteringOption(LLTexUnit::TFO_POINT); // was setMipFilterNearest(TRUE, TRUE);
+
+ claimMem(image_raw);
+ claimMem(image_gl);
}
else
{
@@ -151,7 +156,20 @@ void LLFontBitmapCache::destroyGL()
void LLFontBitmapCache::reset()
{
+ for (std::vector<LLPointer<LLImageRaw> >::iterator it = mImageRawVec.begin(), end_it = mImageRawVec.end();
+ it != end_it;
+ ++it)
+ {
+ disclaimMem(**it);
+ }
mImageRawVec.clear();
+
+ for (std::vector<LLPointer<LLImageGL> >::iterator it = mImageGLVec.begin(), end_it = mImageGLVec.end();
+ it != end_it;
+ ++it)
+ {
+ disclaimMem(**it);
+ }
mImageGLVec.clear();
mBitmapWidth = 0;