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
62 : mColor( Color::BLACK ),
69 AtlasManager::Mesh2D mMesh;
70 FrameBufferImage mBuffer;
79 mUnderlinePosition( 0.0f ),
80 mUnderlineThickness( 0.0f ),
88 float mUnderlinePosition;
89 float mUnderlineThickness;
90 uint32_t mMeshRecordIndex;
97 mNeededBlockWidth( 0 ),
98 mNeededBlockHeight( 0 )
103 uint32_t mNeededBlockWidth;
104 uint32_t mNeededBlockHeight;
116 Text::GlyphIndex mIndex;
119 struct TextCacheEntry
129 Text::GlyphIndex mIndex;
136 mGlyphManager = AtlasGlyphManager::Get();
137 mFontClient = TextAbstraction::FontClient::Get();
139 mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
140 mQuadVertexFormat[ "aTexCoord" ] = Property::VECTOR2;
141 mQuadIndexFormat[ "indices" ] = Property::INTEGER;
144 void AddGlyphs( Text::ViewInterface& view,
145 const std::vector<Vector2>& positions,
146 const Vector<GlyphInfo>& glyphs,
149 AtlasManager::AtlasSlot slot;
150 std::vector< MeshRecord > meshContainer;
151 Vector< Extent > extents;
152 TextCacheEntry textCacheEntry;
155 const Vector2& actorSize( view.GetControlSize() );
156 Vector2 halfActorSize( actorSize * 0.5f );
157 const Vector4& textColor( view.GetTextColor() );
158 const Vector2& shadowOffset( view.GetShadowOffset() );
159 const Vector4& shadowColor( view.GetShadowColor() );
160 bool underlineEnabled( view.IsUnderlineEnabled() );
161 const Vector4& underlineColor( view.GetUnderlineColor() );
162 float underlineHeight( view.GetUnderlineHeight() );
164 float currentUnderlinePosition = ZERO;
165 float currentUnderlineThickness = underlineHeight;
166 uint32_t currentBlockSize = 0;
167 FontId lastFontId = 0;
168 Style style = STYLE_NORMAL;
170 if ( fabsf( shadowOffset.x ) > Math::MACHINE_EPSILON_1 || fabsf( shadowOffset.y ) > Math::MACHINE_EPSILON_1 )
172 style = STYLE_DROP_SHADOW;
175 CalculateBlocksSize( glyphs );
177 // Avoid emptying mTextCache (& removing references) until after incremented references for the new text
178 Vector< TextCacheEntry > newTextCache;
180 for( uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i )
182 const GlyphInfo& glyph = glyphs[ i ];
184 // No operation for white space
185 if ( glyph.width && glyph.height )
187 // Are we still using the same fontId as previous
188 if ( glyph.fontId != lastFontId )
190 // We need to fetch fresh font underline metrics
191 FontMetrics fontMetrics;
192 mFontClient.GetFontMetrics( glyph.fontId, fontMetrics );
193 currentUnderlinePosition = ceil( fabsf( fontMetrics.underlinePosition ) );
194 float descender = ceil( fabsf( fontMetrics.descender ) );
196 if ( underlineHeight == ZERO )
198 currentUnderlineThickness = fontMetrics.underlineThickness;
200 // Ensure underline will be at least a pixel high
201 if ( currentUnderlineThickness < ONE )
203 currentUnderlineThickness = ONE;
207 currentUnderlineThickness = ceil( currentUnderlineThickness );
211 // Clamp the underline position at the font descender and check for ( as EFL describes it ) a broken font
212 if ( currentUnderlinePosition > descender )
214 currentUnderlinePosition = descender;
216 if ( ZERO == currentUnderlinePosition )
218 // Move offset down by one ( EFL behavior )
219 currentUnderlinePosition = ONE;
223 if ( !mGlyphManager.Cached( glyph.fontId, glyph.index, slot ) )
225 // Select correct size for new atlas if needed....?
226 if ( lastFontId != glyph.fontId )
228 for ( uint32_t j = 0; j < mBlockSizes.size(); ++j )
230 if ( mBlockSizes[ j ].mFontId == glyph.fontId )
232 currentBlockSize = j;
233 mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
234 DEFAULT_ATLAS_HEIGHT,
235 mBlockSizes[ j ].mNeededBlockWidth,
236 mBlockSizes[ j ].mNeededBlockHeight );
241 // Create a new image for the glyph
242 BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
245 // Ensure that the next image will fit into the current block size
246 bool setSize = false;
247 if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
250 mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
252 if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
255 mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
260 mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
261 DEFAULT_ATLAS_HEIGHT,
262 mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
263 mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
266 // Locate a new slot for our glyph
267 mGlyphManager.Add( glyph, bitmap, slot );
272 // We have 2+ copies of the same glyph
273 mGlyphManager.AdjustReferenceCount( glyph.fontId, glyph.index, 1/*increment*/ );
276 // Move the origin (0,0) of the mesh to the center of the actor
277 Vector2 position = positions[ i ] - halfActorSize;
279 // Generate mesh data for this quad, plugging in our supplied position
280 AtlasManager::Mesh2D newMesh;
281 mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
282 textCacheEntry.mFontId = glyph.fontId;
283 textCacheEntry.mImageId = slot.mImageId;
284 textCacheEntry.mIndex = glyph.index;
285 newTextCache.PushBack( textCacheEntry );
287 // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
288 StitchTextMesh( meshContainer,
292 position.y + glyph.yBearing,
293 currentUnderlinePosition,
294 currentUnderlineThickness,
296 lastFontId = glyph.fontId;
300 // Now remove references for the old text
302 mTextCache.Swap( newTextCache );
304 if ( underlineEnabled )
306 // Check to see if any of the text needs an underline
307 GenerateUnderlines( meshContainer, extents, underlineColor, textColor );
310 // For each MeshData object, create a mesh actor and add to the renderable actor
311 if ( meshContainer.size() )
313 for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(); mIt != meshContainer.end(); ++mIt )
315 Actor actor = CreateMeshActor( *mIt, actorSize );
317 // Create an effect if necessary
318 if ( style == STYLE_DROP_SHADOW )
320 actor.Add( GenerateShadow( *mIt, actorSize, shadowOffset, shadowColor ) );
333 #if defined(DEBUG_ENABLED)
334 Toolkit::AtlasGlyphManager::Metrics metrics = mGlyphManager.GetMetrics();
335 DALI_LOG_INFO( gLogFilter, Debug::General, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
337 metrics.mAtlasMetrics.mAtlasCount,
338 metrics.mAtlasMetrics.mTextureMemoryUsed / 1024 );
340 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str() );
342 for ( uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i )
344 DALI_LOG_INFO( gLogFilter, Debug::Verbose, " Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n",
345 i + 1, i > 8 ? "" : " ",
346 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mPixelFormat == Pixel::L8 ? "L8 " : "BGRA",
347 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mWidth,
348 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mHeight,
349 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockWidth,
350 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockHeight,
351 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mBlocksUsed,
352 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mTotalBlocks );
359 for ( Vector< TextCacheEntry >::Iterator oldTextIter = mTextCache.Begin(); oldTextIter != mTextCache.End(); ++oldTextIter )
361 mGlyphManager.AdjustReferenceCount( oldTextIter->mFontId, oldTextIter->mIndex, -1/*decrement*/ );
363 mTextCache.Resize( 0 );
366 Actor CreateMeshActor( const MeshRecord& meshRecord, const Vector2& actorSize )
368 PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat, meshRecord.mMesh.mVertices.Size() );
369 PropertyBuffer quadIndices = PropertyBuffer::New( mQuadIndexFormat, meshRecord.mMesh.mIndices.Size() );
370 quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ) );
371 quadIndices.SetData( const_cast< unsigned int* >( &meshRecord.mMesh.mIndices[ 0 ] ) );
373 Geometry quadGeometry = Geometry::New();
374 quadGeometry.AddVertexBuffer( quadVertices );
375 quadGeometry.SetIndexBuffer( quadIndices );
377 Material material = mGlyphManager.GetMaterial( meshRecord.mAtlasId );
378 Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material );
379 renderer.SetDepthIndex( CONTENT_DEPTH_INDEX + mDepth );
380 Actor actor = Actor::New();
381 #if defined(DEBUG_ENABLED)
382 actor.SetName( "Text renderable actor" );
384 actor.AddRenderer( renderer );
385 actor.SetParentOrigin( ParentOrigin::CENTER ); // Keep all of the origins aligned
386 actor.SetSize( actorSize );
387 actor.SetColor( meshRecord.mColor );
391 void StitchTextMesh( std::vector< MeshRecord >& meshContainer,
392 AtlasManager::Mesh2D& newMesh,
393 Vector< Extent >& extents,
394 const Vector4& color,
396 float underlinePosition,
397 float underlineThickness,
398 AtlasManager::AtlasSlot& slot )
402 float left = newMesh.mVertices[ 0 ].mPosition.x;
403 float right = newMesh.mVertices[ 1 ].mPosition.x;
405 // Check to see if there's a mesh data object that references the same atlas ?
407 for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(); mIt != meshContainer.end(); ++mIt, ++index )
409 if ( slot.mAtlasId == mIt->mAtlasId && color == mIt->mColor )
411 // Stitch the mesh to the existing mesh and adjust any extents
412 mGlyphManager.StitchMesh( mIt->mMesh, newMesh );
413 AdjustExtents( extents,
420 underlineThickness );
425 // No mesh data object currently exists that references this atlas, so create a new one
426 MeshRecord meshRecord;
427 meshRecord.mAtlasId = slot.mAtlasId;
428 meshRecord.mMesh = newMesh;
429 meshRecord.mColor = color;
430 meshContainer.push_back( meshRecord );
432 // Adjust extents for this new meshrecord
433 AdjustExtents( extents,
435 meshContainer.size() - 1u,
440 underlineThickness );
445 void AdjustExtents( Vector< Extent >& extents,
446 std::vector< MeshRecord>& meshRecords,
451 float underlinePosition,
452 float underlineThickness )
454 bool foundExtent = false;
455 for ( Vector< Extent >::Iterator eIt = extents.Begin(); eIt != extents.End(); ++eIt )
457 if ( Equals( baseLine, eIt->mBaseLine ) )
460 if ( left < eIt->mLeft )
464 if ( right > eIt->mRight )
469 if ( underlinePosition > eIt->mUnderlinePosition )
471 eIt->mUnderlinePosition = underlinePosition;
473 if ( underlineThickness > eIt->mUnderlineThickness )
475 eIt->mUnderlineThickness = underlineThickness;
483 extent.mRight = right;
484 extent.mBaseLine = baseLine;
485 extent.mUnderlinePosition = underlinePosition;
486 extent.mUnderlineThickness = underlineThickness;
487 extent.mMeshRecordIndex = index;
488 extents.PushBack( extent );
492 void CalculateBlocksSize( const Vector<GlyphInfo>& glyphs )
494 MaxBlockSize maxBlockSize;
495 for ( uint32_t i = 0; i < glyphs.Size(); ++i )
497 FontId fontId = glyphs[ i ].fontId;
498 bool foundFont = false;
499 for ( uint32_t j = 0; j < mBlockSizes.size(); ++j )
501 if ( mBlockSizes[ j ].mFontId == fontId )
508 FontMetrics fontMetrics;
509 mFontClient.GetFontMetrics( fontId, fontMetrics );
510 maxBlockSize.mNeededBlockWidth = static_cast< uint32_t >( fontMetrics.height );
511 maxBlockSize.mNeededBlockHeight = static_cast< uint32_t >( fontMetrics.height );
512 maxBlockSize.mFontId = fontId;
513 mBlockSizes.push_back( maxBlockSize );
518 void GenerateUnderlines( std::vector< MeshRecord>& meshRecords,
519 Vector< Extent >& extents,
520 const Vector4& underlineColor,
521 const Vector4& textColor )
523 AtlasManager::Mesh2D newMesh;
524 unsigned short faceIndex = 0;
525 for ( Vector< Extent >::ConstIterator eIt = extents.Begin(); eIt != extents.End(); ++eIt )
527 AtlasManager::Vertex2D vert;
528 uint32_t index = eIt->mMeshRecordIndex;
529 Vector2 uv = mGlyphManager.GetAtlasSize( meshRecords[ index ].mAtlasId );
531 // Make sure we don't hit texture edge for single pixel texture ( filled pixel is in top left of every atlas )
532 float u = HALF / uv.x;
533 float v = HALF / uv.y;
534 float thickness = eIt->mUnderlineThickness;
535 float baseLine = eIt->mBaseLine + eIt->mUnderlinePosition - ( thickness * HALF );
536 float tlx = eIt->mLeft;
537 float brx = eIt->mRight;
539 vert.mPosition.x = tlx;
540 vert.mPosition.y = baseLine;
541 vert.mTexCoords.x = ZERO;
542 vert.mTexCoords.y = ZERO;
543 newMesh.mVertices.PushBack( vert );
545 vert.mPosition.x = brx;
546 vert.mPosition.y = baseLine;
547 vert.mTexCoords.x = u;
548 newMesh.mVertices.PushBack( vert );
550 vert.mPosition.x = tlx;
551 vert.mPosition.y = baseLine + thickness;
552 vert.mTexCoords.x = ZERO;
553 vert.mTexCoords.y = v;
554 newMesh.mVertices.PushBack( vert );
556 vert.mPosition.x = brx;
557 vert.mPosition.y = baseLine + thickness;
558 vert.mTexCoords.x = u;
559 newMesh.mVertices.PushBack( vert );
561 // Six indices in counter clockwise winding
562 newMesh.mIndices.PushBack( faceIndex + 1u );
563 newMesh.mIndices.PushBack( faceIndex );
564 newMesh.mIndices.PushBack( faceIndex + 2u );
565 newMesh.mIndices.PushBack( faceIndex + 2u );
566 newMesh.mIndices.PushBack( faceIndex + 3u );
567 newMesh.mIndices.PushBack( faceIndex + 1u );
570 if ( underlineColor == textColor )
572 mGlyphManager.StitchMesh( meshRecords[ index ].mMesh, newMesh );
577 record.mMesh = newMesh;
578 record.mAtlasId = meshRecords[ index ].mAtlasId;
579 record.mColor = underlineColor;
580 meshRecords.push_back( record );
585 Actor GenerateShadow( MeshRecord& meshRecord,
586 const Vector2& actorSize,
587 const Vector2& shadowOffset,
588 const Vector4& shadowColor )
590 // Scan vertex buffer to determine width and height of effect buffer needed
591 const Vector< AtlasManager::Vertex2D >& verts = meshRecord.mMesh.mVertices;
592 float tlx = verts[ 0 ].mPosition.x;
593 float tly = verts[ 0 ].mPosition.y;
597 for ( uint32_t i = 0; i < verts.Size(); ++i )
599 if ( verts[ i ].mPosition.x < tlx )
601 tlx = verts[ i ].mPosition.x;
603 if ( verts[ i ].mPosition.y < tly )
605 tly = verts[ i ].mPosition.y;
607 if ( verts[ i ].mPosition.x > brx )
609 brx = verts[ i ].mPosition.x;
611 if ( verts[ i ].mPosition.y > bry )
613 bry = verts[ i ].mPosition.y;
617 float width = brx - tlx;
618 float height = bry - tly;
619 float divWidth = TWO / width;
620 float divHeight = TWO / height;
622 // Create a buffer to render to
623 meshRecord.mBuffer = FrameBufferImage::New( width, height );
625 // We will render a quad into this buffer
626 unsigned int indices[ 6 ] = { 1, 0, 2, 2, 3, 1 };
627 PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat, 4u );
628 PropertyBuffer quadIndices = PropertyBuffer::New( mQuadIndexFormat, sizeof(indices)/sizeof(indices[0]) );
630 AtlasManager::Vertex2D vertices[ 4 ] = {
631 { Vector2( tlx + shadowOffset.x, tly + shadowOffset.y ), Vector2( ZERO, ZERO ) },
632 { Vector2( brx + shadowOffset.x, tly + shadowOffset.y ), Vector2( ONE, ZERO ) },
633 { Vector2( tlx + shadowOffset.x, bry + shadowOffset.y ), Vector2( ZERO, ONE ) },
634 { Vector2( brx + shadowOffset.x, bry + shadowOffset.y ), Vector2( ONE, ONE ) } };
636 quadVertices.SetData( vertices );
637 quadIndices.SetData( indices );
639 Geometry quadGeometry = Geometry::New();
640 quadGeometry.AddVertexBuffer( quadVertices );
641 quadGeometry.SetIndexBuffer( quadIndices );
643 Sampler sampler = Sampler::New( meshRecord.mBuffer, "sTexture" );
644 Material material = Material::New( mGlyphManager.GetEffectBufferShader() );
645 material.AddSampler( sampler );
647 Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material );
649 // Ensure shadow is behind the text...
650 renderer.SetDepthIndex( CONTENT_DEPTH_INDEX + mDepth - 1 );
651 Actor actor = Actor::New();
652 actor.AddRenderer( renderer );
653 actor.SetParentOrigin( ParentOrigin::CENTER ); // Keep all of the origins aligned
654 actor.SetSize( actorSize );
656 // Create a sub actor to render the source with normalized vertex positions
657 Vector< AtlasManager::Vertex2D > normVertexList;
658 for ( uint32_t i = 0; i < verts.Size(); ++i )
660 AtlasManager::Vertex2D vertex = verts[ i ];
661 vertex.mPosition.x = ( ( vertex.mPosition.x - tlx ) * divWidth ) - ONE;
662 vertex.mPosition.y = ( ( vertex.mPosition.y - tly ) * divHeight ) - ONE;
663 normVertexList.PushBack( vertex );
666 PropertyBuffer normVertices = PropertyBuffer::New( mQuadVertexFormat, normVertexList.Size() );
667 PropertyBuffer normIndices = PropertyBuffer::New( mQuadIndexFormat, meshRecord.mMesh.mIndices.Size() );
668 normVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &normVertexList[ 0 ] ) );
669 normIndices.SetData( const_cast< unsigned int* >( &meshRecord.mMesh.mIndices[ 0 ] ) );
671 Geometry normGeometry = Geometry::New();
672 normGeometry.AddVertexBuffer( normVertices );
673 normGeometry.SetIndexBuffer( normIndices );
675 Material normMaterial = Material::New( mGlyphManager.GetGlyphShadowShader() );
676 Sampler normSampler = mGlyphManager.GetSampler( meshRecord.mAtlasId );
677 normMaterial.AddSampler( normSampler );
678 Dali::Renderer normRenderer = Dali::Renderer::New( normGeometry, normMaterial );
679 Actor subActor = Actor::New();
680 subActor.AddRenderer( normRenderer );
681 subActor.SetParentOrigin( ParentOrigin::CENTER ); // Keep all of the origins aligned
682 subActor.SetSize( actorSize );
683 subActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
684 subActor.SetColor( shadowColor );
686 // Create a render task to render the effect
687 RenderTask task = Stage::GetCurrent().GetRenderTaskList().CreateTask();
688 task.SetTargetFrameBuffer( meshRecord.mBuffer );
689 task.SetSourceActor( subActor );
690 task.SetClearEnabled( true );
691 task.SetClearColor( Vector4::ZERO );
692 task.SetExclusive( true );
693 task.SetRefreshRate( RenderTask::REFRESH_ONCE );
694 task.FinishedSignal().Connect( this, &AtlasRenderer::Impl::RenderComplete );
695 actor.Add( subActor );
700 void RenderComplete( RenderTask& renderTask )
702 // Disconnect and remove this single shot render task
703 renderTask.FinishedSignal().Disconnect( this, &AtlasRenderer::Impl::RenderComplete );
704 Stage::GetCurrent().GetRenderTaskList().RemoveTask( renderTask );
706 // Get the actor used for render to buffer and remove it from the parent
707 Actor renderActor = renderTask.GetSourceActor();
710 Actor parent = renderActor.GetParent();
713 parent.Remove( renderActor );
718 Actor mActor; ///< The actor parent which renders the text
719 AtlasGlyphManager mGlyphManager; ///< Glyph Manager to handle upload and caching
720 TextAbstraction::FontClient mFontClient; ///> The font client used to supply glyph information
721 std::vector< MaxBlockSize > mBlockSizes; ///> Maximum size needed to contain a glyph in a block within a new atlas
722 std::vector< uint32_t > mFace; ///> Face indices for a quad
723 Vector< TextCacheEntry > mTextCache;
724 Property::Map mQuadVertexFormat;
725 Property::Map mQuadIndexFormat;
729 Text::RendererPtr AtlasRenderer::New()
731 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Text::AtlasRenderer::New()\n" );
733 return Text::RendererPtr( new AtlasRenderer() );
736 Actor AtlasRenderer::Render( Text::ViewInterface& view, int depth )
738 UnparentAndReset( mImpl->mActor );
740 Length numberOfGlyphs = view.GetNumberOfGlyphs();
742 if( numberOfGlyphs > 0u )
744 Vector<GlyphInfo> glyphs;
745 glyphs.Resize( numberOfGlyphs );
747 std::vector<Vector2> positions;
748 positions.resize( numberOfGlyphs );
750 numberOfGlyphs = view.GetGlyphs( glyphs.Begin(),
754 glyphs.Resize( numberOfGlyphs );
755 positions.resize( numberOfGlyphs );
757 mImpl->AddGlyphs( view,
763 return mImpl->mActor;
766 AtlasRenderer::AtlasRenderer()
772 AtlasRenderer::~AtlasRenderer()