+ if(0 != delta)
+ {
+ DALI_LOG_INFO(gLogFilter, Debug::General, "AdjustReferenceCount %d, font: %d index: %d\n", delta, fontId, index);
+
+ for(std::vector<FontGlyphRecord>::iterator fontGlyphRecordIt = mFontGlyphRecords.begin();
+ fontGlyphRecordIt != mFontGlyphRecords.end();
+ ++fontGlyphRecordIt)
+ {
+ if(fontGlyphRecordIt->mFontId == fontId)
+ {
+ for(Vector<GlyphRecordEntry>::Iterator glyphRecordIt = fontGlyphRecordIt->mGlyphRecords.Begin();
+ glyphRecordIt != fontGlyphRecordIt->mGlyphRecords.End();
+ ++glyphRecordIt)
+ {
+ if((glyphRecordIt->mIndex == index) &&
+ (glyphRecordIt->mOutlineWidth == style.outline) &&
+ (glyphRecordIt->isItalic == style.isItalic) &&
+ (glyphRecordIt->isBold == style.isBold))
+ {
+ glyphRecordIt->mCount += delta;
+ DALI_ASSERT_DEBUG(glyphRecordIt->mCount >= 0 && "Glyph ref-count should not be negative");
+
+ if(!glyphRecordIt->mCount)
+ {
+ mAtlasManager.Remove(glyphRecordIt->mImageId);
+ fontGlyphRecordIt->mGlyphRecords.Remove(glyphRecordIt);
+ }
+ return;
+ }
+ }
+ }
+ }
+
+ // Should not arrive here
+ DALI_ASSERT_DEBUG(false && "Failed to adjust ref-count");
+ }