summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontbitmapcache.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-10-01 14:28:39 -0700
committerRichard Linden <none@none>2013-10-01 14:28:39 -0700
commit59628d6f85deed89cb35d9343183069cfccd13c0 (patch)
tree6b4c35053c2291fd5ff1cccedf86bbd76ce78e1d /indra/llrender/llfontbitmapcache.cpp
parentad777b46d0fe5d790e43efb1771e9f64f3ad3dfb (diff)
parent9e486f6c6abbee6cb41ba9a6271d8a025ad924ef (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-release
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;