// EXTERNAL INCLUDES
#include <dali/dali.h>
#include <dali/integration-api/debug.h>
+#include <dali/public-api/text-abstraction/text-abstraction.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/atlas-manager/atlas-manager.h>
// Create a new image for the glyph
BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
-
- // Ensure that the next image will fit into the current block size
- bool setSize = false;
- if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
- {
- setSize = true;
- mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
- }
- if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
+ if ( bitmap )
{
- setSize = true;
- mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
- }
+ // Ensure that the next image will fit into the current block size
+ bool setSize = false;
+ if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
+ {
+ setSize = true;
+ mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
+ }
+ if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
+ {
+ setSize = true;
+ mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
+ }
- if ( setSize )
- {
- mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
- DEFAULT_ATLAS_HEIGHT,
- mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
- mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
- }
+ if ( setSize )
+ {
+ mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
+ DEFAULT_ATLAS_HEIGHT,
+ mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
+ mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
+ }
- // Locate a new slot for our glyph
- mGlyphManager.Add( glyph, bitmap, slot );
+ // Locate a new slot for our glyph
+ mGlyphManager.Add( glyph, bitmap, slot );
- // Generate mesh data for this quad, plugging in our supplied position
- if ( slot.mImageId )
- {
- mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData );
- mImageIds.PushBack( slot.mImageId );
+ // Generate mesh data for this quad, plugging in our supplied position
+ if ( slot.mImageId )
+ {
+ mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData );
+ mImageIds.PushBack( slot.mImageId );
+ }
}
}
// Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
currentUnderlinePosition,
currentUnderlineThickness,
slot );
- lastFontId = glyph.fontId;
+ lastFontId = glyph.fontId;
}
}
}
#if defined(DEBUG_ENABLED)
Toolkit::AtlasGlyphManager::Metrics metrics = mGlyphManager.GetMetrics();
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
metrics.mGlyphCount,
metrics.mAtlasMetrics.mAtlasCount,
metrics.mAtlasMetrics.mTextureMemoryUsed / 1024 );
AtlasRenderer::~AtlasRenderer()
{
delete mImpl;
-}
\ No newline at end of file
+}