2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h>
22 #include <dali/dali.h>
23 #include <dali/devel-api/object/property-buffer.h>
24 #include <dali/devel-api/rendering/geometry.h>
25 #include <dali/devel-api/rendering/renderer.h>
26 #include <dali/devel-api/rendering/sampler.h>
27 #include <dali/devel-api/rendering/shader.h>
28 #include <dali/devel-api/text-abstraction/font-client.h>
29 #include <dali/integration-api/debug.h>
31 #include <dali-toolkit/public-api/controls/control-depth-index-ranges.h>
32 #include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
35 using namespace Dali::Toolkit;
36 using namespace Dali::Toolkit::Text;
40 #if defined(DEBUG_ENABLED)
41 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
44 const float ZERO( 0.0f );
45 const float HALF( 0.5f );
46 const float ONE( 1.0f );
47 const float TWO( 2.0f );
48 const uint32_t DEFAULT_ATLAS_WIDTH = 512u;
49 const uint32_t DEFAULT_ATLAS_HEIGHT = 512u;
51 struct AtlasRenderer::Impl : public ConnectionTracker
64 AtlasManager::Mesh2D mMesh;
65 FrameBufferImage mBuffer;
74 float mUnderlinePosition;
75 float mUnderlineThickness;
76 uint32_t mMeshRecordIndex;
82 uint32_t mNeededBlockWidth;
83 uint32_t mNeededBlockHeight;
89 Text::GlyphIndex mIndex;
95 Text::GlyphIndex mIndex;
102 mGlyphManager = AtlasGlyphManager::Get();
103 mFontClient = TextAbstraction::FontClient::Get();
105 mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
106 mQuadVertexFormat[ "aTexCoord" ] = Property::VECTOR2;
107 mQuadIndexFormat[ "indices" ] = Property::INTEGER;
110 void AddGlyphs( Text::ViewInterface& view,
111 const std::vector<Vector2>& positions,
112 const Vector<GlyphInfo>& glyphs,
115 AtlasManager::AtlasSlot slot;
116 std::vector< MeshRecord > meshContainer;
117 Vector< Extent > extents;
118 TextCacheEntry textCacheEntry;
121 const Vector2& actorSize( view.GetControlSize() );
122 Vector2 halfActorSize( actorSize * 0.5f );
123 const Vector4& textColor( view.GetTextColor() );
124 const Vector2& shadowOffset( view.GetShadowOffset() );
125 const Vector4& shadowColor( view.GetShadowColor() );
126 bool underlineEnabled( view.IsUnderlineEnabled() );
127 const Vector4& underlineColor( view.GetUnderlineColor() );
128 float underlineHeight( view.GetUnderlineHeight() );
130 float currentUnderlinePosition = ZERO;
131 float currentUnderlineThickness = underlineHeight;
132 uint32_t currentBlockSize = 0;
133 FontId lastFontId = 0;
134 Style style = STYLE_NORMAL;
136 if ( fabsf( shadowOffset.x ) > Math::MACHINE_EPSILON_1 || fabsf( shadowOffset.y ) > Math::MACHINE_EPSILON_1 )
138 style = STYLE_DROP_SHADOW;
141 CalculateBlocksSize( glyphs );
143 // Avoid emptying mTextCache (& removing references) until after incremented references for the new text
144 Vector< TextCacheEntry > newTextCache;
146 for( uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i )
148 const GlyphInfo& glyph = glyphs[ i ];
150 // No operation for white space
151 if ( glyph.width && glyph.height )
153 // Are we still using the same fontId as previous
154 if ( glyph.fontId != lastFontId )
156 // We need to fetch fresh font underline metrics
157 FontMetrics fontMetrics;
158 mFontClient.GetFontMetrics( glyph.fontId, fontMetrics );
159 currentUnderlinePosition = ceil( fabsf( fontMetrics.underlinePosition ) );
160 float descender = ceil( fabsf( fontMetrics.descender ) );
162 if ( underlineHeight == ZERO )
164 currentUnderlineThickness = fontMetrics.underlineThickness;
166 // Ensure underline will be at least a pixel high
167 if ( currentUnderlineThickness < ONE )
169 currentUnderlineThickness = ONE;
173 currentUnderlineThickness = ceil( currentUnderlineThickness );
177 // Clamp the underline position at the font descender and check for ( as EFL describes it ) a broken font
178 if ( currentUnderlinePosition > descender )
180 currentUnderlinePosition = descender;
182 if ( ZERO == currentUnderlinePosition )
184 // Move offset down by one ( EFL behavior )
185 currentUnderlinePosition = ONE;
189 if ( !mGlyphManager.Cached( glyph.fontId, glyph.index, slot ) )
191 // Select correct size for new atlas if needed....?
192 if ( lastFontId != glyph.fontId )
194 for ( uint32_t j = 0; j < mBlockSizes.size(); ++j )
196 if ( mBlockSizes[ j ].mFontId == glyph.fontId )
198 currentBlockSize = j;
199 mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
200 DEFAULT_ATLAS_HEIGHT,
201 mBlockSizes[ j ].mNeededBlockWidth,
202 mBlockSizes[ j ].mNeededBlockHeight );
207 // Create a new image for the glyph
208 BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
211 // Ensure that the next image will fit into the current block size
212 bool setSize = false;
213 if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
216 mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
218 if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
221 mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
226 mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
227 DEFAULT_ATLAS_HEIGHT,
228 mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
229 mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
232 // Locate a new slot for our glyph
233 mGlyphManager.Add( glyph, bitmap, slot );
238 // We have 2+ copies of the same glyph
239 mGlyphManager.AdjustReferenceCount( glyph.fontId, glyph.index, 1/*increment*/ );
242 // Move the origin (0,0) of the mesh to the center of the actor
243 Vector2 position = positions[ i ] - halfActorSize;
245 // Generate mesh data for this quad, plugging in our supplied position
246 AtlasManager::Mesh2D newMesh;
247 mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
248 textCacheEntry.mFontId = glyph.fontId;
249 textCacheEntry.mImageId = slot.mImageId;
250 textCacheEntry.mIndex = glyph.index;
251 newTextCache.PushBack( textCacheEntry );
253 // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
254 StitchTextMesh( meshContainer,
258 position.y + glyph.yBearing,
259 currentUnderlinePosition,
260 currentUnderlineThickness,
262 lastFontId = glyph.fontId;
266 // Now remove references for the old text
268 mTextCache.Swap( newTextCache );
270 if ( underlineEnabled )
272 // Check to see if any of the text needs an underline
273 GenerateUnderlines( meshContainer, extents, underlineColor, textColor );
276 // For each MeshData object, create a mesh actor and add to the renderable actor
277 if ( meshContainer.size() )
279 for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(); mIt != meshContainer.end(); ++mIt )
281 Actor actor = CreateMeshActor( *mIt, actorSize );
283 // Create an effect if necessary
284 if ( style == STYLE_DROP_SHADOW )
286 actor.Add( GenerateShadow( *mIt, actorSize, shadowOffset, shadowColor ) );
299 #if defined(DEBUG_ENABLED)
300 Toolkit::AtlasGlyphManager::Metrics metrics = mGlyphManager.GetMetrics();
301 DALI_LOG_INFO( gLogFilter, Debug::General, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
303 metrics.mAtlasMetrics.mAtlasCount,
304 metrics.mAtlasMetrics.mTextureMemoryUsed / 1024 );
306 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str() );
308 for ( uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i )
310 DALI_LOG_INFO( gLogFilter, Debug::Verbose, " Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n",
311 i + 1, i > 8 ? "" : " ",
312 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mPixelFormat == Pixel::L8 ? "L8 " : "BGRA",
313 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mWidth,
314 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mHeight,
315 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockWidth,
316 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockHeight,
317 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mBlocksUsed,
318 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mTotalBlocks );
325 for ( Vector< TextCacheEntry >::Iterator oldTextIter = mTextCache.Begin(); oldTextIter != mTextCache.End(); ++oldTextIter )
327 mGlyphManager.AdjustReferenceCount( oldTextIter->mFontId, oldTextIter->mIndex, -1/*decrement*/ );
329 mTextCache.Resize( 0 );
332 Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize )
334 PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat, meshRecord.mMesh.mVertices.Size() );
335 PropertyBuffer quadIndices = PropertyBuffer::New( mQuadIndexFormat, meshRecord.mMesh.mIndices.Size() );
336 quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ) );
337 quadIndices.SetData( const_cast< unsigned int* >( &meshRecord.mMesh.mIndices[ 0 ] ) );
339 Geometry quadGeometry = Geometry::New();
340 quadGeometry.AddVertexBuffer( quadVertices );
341 quadGeometry.SetIndexBuffer( quadIndices );
343 Material material = mGlyphManager.GetMaterial( meshRecord.mAtlasId );
344 Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material );
345 renderer.SetDepthIndex( CONTENT_DEPTH_INDEX + mDepth );
346 Actor actor = Actor::New();
347 #if defined(DEBUG_ENABLED)
348 actor.SetName( "Text renderable actor" );
350 actor.AddRenderer( renderer );
351 actor.SetParentOrigin( ParentOrigin::CENTER ); // Keep all of the origins aligned
352 actor.SetSize( actorSize );
353 actor.SetColor( meshRecord.mColor );
355 if ( meshRecord.mIsUnderline )
357 actor.SetColorMode( USE_OWN_COLOR );
361 actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
366 void StitchTextMesh( std::vector< MeshRecord >& meshContainer,
367 AtlasManager::Mesh2D& newMesh,
368 Vector< Extent >& extents,
369 const Vector4& color,
371 float underlinePosition,
372 float underlineThickness,
373 AtlasManager::AtlasSlot& slot )
377 float left = newMesh.mVertices[ 0 ].mPosition.x;
378 float right = newMesh.mVertices[ 1 ].mPosition.x;
380 // Check to see if there's a mesh data object that references the same atlas ?
382 for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(); mIt != meshContainer.end(); ++mIt, ++index )
384 if ( slot.mAtlasId == mIt->mAtlasId && color == mIt->mColor )
386 // Stitch the mesh to the existing mesh and adjust any extents
387 mGlyphManager.StitchMesh( mIt->mMesh, newMesh );
388 AdjustExtents( extents,
395 underlineThickness );
400 // No mesh data object currently exists that references this atlas, so create a new one
401 MeshRecord meshRecord;
402 meshRecord.mAtlasId = slot.mAtlasId;
403 meshRecord.mMesh = newMesh;
404 meshRecord.mColor = color;
405 meshRecord.mIsUnderline = false;
406 meshContainer.push_back( meshRecord );
408 // Adjust extents for this new meshrecord
409 AdjustExtents( extents,
411 meshContainer.size() - 1u,
416 underlineThickness );
421 void AdjustExtents( Vector< Extent >& extents,
422 std::vector< MeshRecord>& meshRecords,
427 float underlinePosition,
428 float underlineThickness )
430 bool foundExtent = false;
431 for ( Vector< Extent >::Iterator eIt = extents.Begin(); eIt != extents.End(); ++eIt )
433 if ( Equals( baseLine, eIt->mBaseLine ) )
436 if ( left < eIt->mLeft )
440 if ( right > eIt->mRight )
445 if ( underlinePosition > eIt->mUnderlinePosition )
447 eIt->mUnderlinePosition = underlinePosition;
449 if ( underlineThickness > eIt->mUnderlineThickness )
451 eIt->mUnderlineThickness = underlineThickness;
459 extent.mRight = right;
460 extent.mBaseLine = baseLine;
461 extent.mUnderlinePosition = underlinePosition;
462 extent.mUnderlineThickness = underlineThickness;
463 extent.mMeshRecordIndex = index;
464 extents.PushBack( extent );
468 void CalculateBlocksSize( const Vector<GlyphInfo>& glyphs )
470 MaxBlockSize maxBlockSize;
471 for ( uint32_t i = 0; i < glyphs.Size(); ++i )
473 FontId fontId = glyphs[ i ].fontId;
474 bool foundFont = false;
475 for ( uint32_t j = 0; j < mBlockSizes.size(); ++j )
477 if ( mBlockSizes[ j ].mFontId == fontId )
484 FontMetrics fontMetrics;
485 mFontClient.GetFontMetrics( fontId, fontMetrics );
486 maxBlockSize.mNeededBlockWidth = static_cast< uint32_t >( fontMetrics.height );
487 maxBlockSize.mNeededBlockHeight = static_cast< uint32_t >( fontMetrics.height );
488 maxBlockSize.mFontId = fontId;
489 mBlockSizes.push_back( maxBlockSize );
494 void GenerateUnderlines( std::vector< MeshRecord>& meshRecords,
495 Vector< Extent >& extents,
496 const Vector4& underlineColor,
497 const Vector4& textColor )
499 AtlasManager::Mesh2D newMesh;
500 unsigned short faceIndex = 0;
501 for ( Vector< Extent >::ConstIterator eIt = extents.Begin(); eIt != extents.End(); ++eIt )
503 AtlasManager::Vertex2D vert;
504 uint32_t index = eIt->mMeshRecordIndex;
505 Vector2 uv = mGlyphManager.GetAtlasSize( meshRecords[ index ].mAtlasId );
507 // Make sure we don't hit texture edge for single pixel texture ( filled pixel is in top left of every atlas )
508 float u = HALF / uv.x;
509 float v = HALF / uv.y;
510 float thickness = eIt->mUnderlineThickness;
511 float baseLine = eIt->mBaseLine + eIt->mUnderlinePosition - ( thickness * HALF );
512 float tlx = eIt->mLeft;
513 float brx = eIt->mRight;
515 vert.mPosition.x = tlx;
516 vert.mPosition.y = baseLine;
517 vert.mTexCoords.x = ZERO;
518 vert.mTexCoords.y = ZERO;
519 newMesh.mVertices.PushBack( vert );
521 vert.mPosition.x = brx;
522 vert.mPosition.y = baseLine;
523 vert.mTexCoords.x = u;
524 newMesh.mVertices.PushBack( vert );
526 vert.mPosition.x = tlx;
527 vert.mPosition.y = baseLine + thickness;
528 vert.mTexCoords.x = ZERO;
529 vert.mTexCoords.y = v;
530 newMesh.mVertices.PushBack( vert );
532 vert.mPosition.x = brx;
533 vert.mPosition.y = baseLine + thickness;
534 vert.mTexCoords.x = u;
535 newMesh.mVertices.PushBack( vert );
537 // Six indices in counter clockwise winding
538 newMesh.mIndices.PushBack( faceIndex + 1u );
539 newMesh.mIndices.PushBack( faceIndex );
540 newMesh.mIndices.PushBack( faceIndex + 2u );
541 newMesh.mIndices.PushBack( faceIndex + 2u );
542 newMesh.mIndices.PushBack( faceIndex + 3u );
543 newMesh.mIndices.PushBack( faceIndex + 1u );
546 if ( underlineColor == textColor )
548 mGlyphManager.StitchMesh( meshRecords[ index ].mMesh, newMesh );
553 record.mMesh = newMesh;
554 record.mAtlasId = meshRecords[ index ].mAtlasId;
555 record.mColor = underlineColor;
556 record.mIsUnderline = true;
557 meshRecords.push_back( record );
562 Actor GenerateShadow( MeshRecord& meshRecord,
563 const Vector2& actorSize,
564 const Vector2& shadowOffset,
565 const Vector4& shadowColor )
567 // Scan vertex buffer to determine width and height of effect buffer needed
568 const Vector< AtlasManager::Vertex2D >& verts = meshRecord.mMesh.mVertices;
569 float tlx = verts[ 0 ].mPosition.x;
570 float tly = verts[ 0 ].mPosition.y;
574 for ( uint32_t i = 0; i < verts.Size(); ++i )
576 if ( verts[ i ].mPosition.x < tlx )
578 tlx = verts[ i ].mPosition.x;
580 if ( verts[ i ].mPosition.y < tly )
582 tly = verts[ i ].mPosition.y;
584 if ( verts[ i ].mPosition.x > brx )
586 brx = verts[ i ].mPosition.x;
588 if ( verts[ i ].mPosition.y > bry )
590 bry = verts[ i ].mPosition.y;
594 float width = brx - tlx;
595 float height = bry - tly;
596 float divWidth = TWO / width;
597 float divHeight = TWO / height;
599 // Create a buffer to render to
600 meshRecord.mBuffer = FrameBufferImage::New( width, height );
602 // We will render a quad into this buffer
603 unsigned int indices[ 6 ] = { 1, 0, 2, 2, 3, 1 };
604 PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat, 4u );
605 PropertyBuffer quadIndices = PropertyBuffer::New( mQuadIndexFormat, sizeof(indices)/sizeof(indices[0]) );
607 AtlasManager::Vertex2D vertices[ 4 ] = {
608 { Vector2( tlx + shadowOffset.x, tly + shadowOffset.y ), Vector2( ZERO, ZERO ) },
609 { Vector2( brx + shadowOffset.x, tly + shadowOffset.y ), Vector2( ONE, ZERO ) },
610 { Vector2( tlx + shadowOffset.x, bry + shadowOffset.y ), Vector2( ZERO, ONE ) },
611 { Vector2( brx + shadowOffset.x, bry + shadowOffset.y ), Vector2( ONE, ONE ) } };
613 quadVertices.SetData( vertices );
614 quadIndices.SetData( indices );
616 Geometry quadGeometry = Geometry::New();
617 quadGeometry.AddVertexBuffer( quadVertices );
618 quadGeometry.SetIndexBuffer( quadIndices );
620 Sampler sampler = Sampler::New( meshRecord.mBuffer, "sTexture" );
621 Material material = Material::New( mGlyphManager.GetEffectBufferShader() );
622 material.AddSampler( sampler );
624 Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material );
626 // Ensure shadow is behind the text...
627 renderer.SetDepthIndex( CONTENT_DEPTH_INDEX + mDepth - 1 );
628 Actor actor = Actor::New();
629 actor.AddRenderer( renderer );
630 actor.SetParentOrigin( ParentOrigin::CENTER ); // Keep all of the origins aligned
631 actor.SetSize( actorSize );
633 // Create a sub actor to render the source with normalized vertex positions
634 Vector< AtlasManager::Vertex2D > normVertexList;
635 for ( uint32_t i = 0; i < verts.Size(); ++i )
637 AtlasManager::Vertex2D vertex = verts[ i ];
638 vertex.mPosition.x = ( ( vertex.mPosition.x - tlx ) * divWidth ) - ONE;
639 vertex.mPosition.y = ( ( vertex.mPosition.y - tly ) * divHeight ) - ONE;
640 normVertexList.PushBack( vertex );
643 PropertyBuffer normVertices = PropertyBuffer::New( mQuadVertexFormat, normVertexList.Size() );
644 PropertyBuffer normIndices = PropertyBuffer::New( mQuadIndexFormat, meshRecord.mMesh.mIndices.Size() );
645 normVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &normVertexList[ 0 ] ) );
646 normIndices.SetData( const_cast< unsigned int* >( &meshRecord.mMesh.mIndices[ 0 ] ) );
648 Geometry normGeometry = Geometry::New();
649 normGeometry.AddVertexBuffer( normVertices );
650 normGeometry.SetIndexBuffer( normIndices );
652 Material normMaterial = Material::New( mGlyphManager.GetGlyphShadowShader() );
653 Sampler normSampler = mGlyphManager.GetSampler( meshRecord.mAtlasId );
654 normMaterial.AddSampler( normSampler );
655 Dali::Renderer normRenderer = Dali::Renderer::New( normGeometry, normMaterial );
656 Actor subActor = Actor::New();
657 subActor.AddRenderer( normRenderer );
658 subActor.SetParentOrigin( ParentOrigin::CENTER ); // Keep all of the origins aligned
659 subActor.SetSize( actorSize );
660 subActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
661 subActor.SetColor( shadowColor );
663 // Create a render task to render the effect
664 RenderTask task = Stage::GetCurrent().GetRenderTaskList().CreateTask();
665 task.SetTargetFrameBuffer( meshRecord.mBuffer );
666 task.SetSourceActor( subActor );
667 task.SetClearEnabled( true );
668 task.SetClearColor( Vector4::ZERO );
669 task.SetExclusive( true );
670 task.SetRefreshRate( RenderTask::REFRESH_ONCE );
671 task.FinishedSignal().Connect( this, &AtlasRenderer::Impl::RenderComplete );
672 actor.Add( subActor );
677 void RenderComplete( RenderTask& renderTask )
679 // Disconnect and remove this single shot render task
680 renderTask.FinishedSignal().Disconnect( this, &AtlasRenderer::Impl::RenderComplete );
681 Stage::GetCurrent().GetRenderTaskList().RemoveTask( renderTask );
683 // Get the actor used for render to buffer and remove it from the parent
684 Actor renderActor = renderTask.GetSourceActor();
687 Actor parent = renderActor.GetParent();
690 parent.Remove( renderActor );
695 Actor mActor; ///< The actor parent which renders the text
696 AtlasGlyphManager mGlyphManager; ///< Glyph Manager to handle upload and caching
697 TextAbstraction::FontClient mFontClient; ///> The font client used to supply glyph information
698 std::vector< MaxBlockSize > mBlockSizes; ///> Maximum size needed to contain a glyph in a block within a new atlas
699 std::vector< uint32_t > mFace; ///> Face indices for a quad
700 Vector< TextCacheEntry > mTextCache;
701 Property::Map mQuadVertexFormat;
702 Property::Map mQuadIndexFormat;
706 Text::RendererPtr AtlasRenderer::New()
708 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Text::AtlasRenderer::New()\n" );
710 return Text::RendererPtr( new AtlasRenderer() );
713 Actor AtlasRenderer::Render( Text::ViewInterface& view, int depth )
715 UnparentAndReset( mImpl->mActor );
717 Length numberOfGlyphs = view.GetNumberOfGlyphs();
719 if( numberOfGlyphs > 0u )
721 Vector<GlyphInfo> glyphs;
722 glyphs.Resize( numberOfGlyphs );
724 std::vector<Vector2> positions;
725 positions.resize( numberOfGlyphs );
727 numberOfGlyphs = view.GetGlyphs( glyphs.Begin(),
731 glyphs.Resize( numberOfGlyphs );
732 positions.resize( numberOfGlyphs );
734 mImpl->AddGlyphs( view,
740 return mImpl->mActor;
743 AtlasRenderer::AtlasRenderer()
749 AtlasRenderer::~AtlasRenderer()