diff options
author | Richard Linden <none@none> | 2013-10-01 13:46:43 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-10-01 13:46:43 -0700 |
commit | 12f0f8cb72f789e21b01b45063dcc5f1f5292087 (patch) | |
tree | d8777341699dcea574e261da8c982ad22860de13 /indra/llrender/llfontbitmapcache.cpp | |
parent | a96da325564f4e9769e85ad006f98a4ac08d4a47 (diff) |
changed over to manual naming of MemTrackable stats
changed claimMem and disclaimMem behavior to not pass through argument
added more mem tracking stats to floater_stats
Diffstat (limited to 'indra/llrender/llfontbitmapcache.cpp')
-rwxr-xr-x | indra/llrender/llfontbitmapcache.cpp | 20 |
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; |