summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontbitmapcache.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-12-02 14:57:29 -0800
committerRichard Linden <none@none>2013-12-02 14:57:29 -0800
commit34ff2fc46ba8c623f0eab8fe1dccb5db327775a8 (patch)
tree7bc422dd969e1d18e9d83e52a9a6dcfa2bd6139f /indra/llrender/llfontbitmapcache.cpp
parent787ccaf297e81291469aaf269f563d862fb150a3 (diff)
parentd8e92867162f8c4ff9489d8eefde53546e907dff (diff)
merge with 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;