+#if defined(DEBUG_ENABLED)
+ Toolkit::AtlasGlyphManager::Metrics metrics = mGlyphManager.GetMetrics();
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
+ metrics.mGlyphCount,
+ metrics.mAtlasMetrics.mAtlasCount,
+ metrics.mAtlasMetrics.mTextureMemoryUsed / 1024 );
+
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str() );
+
+ for( uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i )
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, " Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n",
+ i + 1, i > 8 ? "" : " ",
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mPixelFormat == Pixel::L8 ? "L8 " : "BGRA",
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mWidth,
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mHeight,
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockWidth,
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockHeight,
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mBlocksUsed,
+ metrics.mAtlasMetrics.mAtlasMetrics[ i ].mTotalBlocks );
+ }
+#endif
+ }
+
+ void RemoveText()
+ {
+ for( Vector< TextCacheEntry >::Iterator oldTextIter = mTextCache.Begin(); oldTextIter != mTextCache.End(); ++oldTextIter )
+ {
+ mGlyphManager.AdjustReferenceCount( oldTextIter->mFontId, oldTextIter->mIndex, -1/*decrement*/ );
+ }
+ mTextCache.Resize( 0 );
+ }
+
+ Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize )
+ {
+ PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat );
+ quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ), meshRecord.mMesh.mVertices.Size() );
+
+ Geometry quadGeometry = Geometry::New();
+ quadGeometry.AddVertexBuffer( quadVertices );
+ quadGeometry.SetIndexBuffer( &meshRecord.mMesh.mIndices[0], meshRecord.mMesh.mIndices.Size() );
+
+ TextureSet textureSet( mGlyphManager.GetTextures( meshRecord.mAtlasId ) );
+ Shader shader( mGlyphManager.GetShader( meshRecord.mAtlasId ) );
+ Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, shader );
+ renderer.SetTextures( textureSet );
+ renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
+ renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT + mDepth );
+ Actor actor = Actor::New();
+#if defined(DEBUG_ENABLED)
+ actor.SetName( "Text renderable actor" );
+#endif
+ actor.AddRenderer( renderer );
+
+ // Keep all of the origins aligned
+ actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ actor.SetSize( actorSize );
+ actor.RegisterProperty("uOffset", Vector2::ZERO );
+ return actor;