Changed Atlas manager to use Dali::Texture instead of Dali::Atlas
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / atlas / atlas-glyph-manager-impl.cpp
index c8ea1e2..8532b93 100644 (file)
@@ -89,20 +89,18 @@ AtlasGlyphManager::AtlasGlyphManager()
 }
 
 void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
-                             const BufferImage& bitmap,
+                             const PixelData& bitmap,
                              Dali::Toolkit::AtlasManager::AtlasSlot& slot )
 {
   DALI_LOG_INFO( gLogFilter, Debug::General, "Added glyph, font: %d index: %d\n", glyph.fontId, glyph.index );
 
   if ( mAtlasManager.Add( bitmap, slot ) )
   {
-    // A new atlas was created so set the material details for the atlas
-    Dali::Atlas atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
-    Pixel::Format pixelFormat = mAtlasManager.GetPixelFormat( slot.mAtlasId );
-    Material material = Material::New( pixelFormat == Pixel::L8 ? mShaderL8 : mShaderRgba );
-    material.AddTexture( atlas, "sTexture" );
-    material.SetBlendMode( BlendingMode::ON );
-    mAtlasManager.SetMaterial( slot.mAtlasId, material );
+    // A new atlas was created so set the texture set details for the atlas
+    Dali::Texture atlas = mAtlasManager.GetAtlasContainer( slot.mAtlasId );
+    TextureSet textureSet = TextureSet::New();
+    textureSet.SetTexture( 0u, atlas );
+    mAtlasManager.SetTextures( slot.mAtlasId, textureSet );
   }
 
   GlyphRecordEntry record;
@@ -253,9 +251,15 @@ void AtlasGlyphManager::AdjustReferenceCount( Text::FontId fontId, Text::GlyphIn
   }
 }
 
-Material AtlasGlyphManager::GetMaterial( uint32_t atlasId ) const
+TextureSet AtlasGlyphManager::GetTextures( uint32_t atlasId ) const
 {
-  return mAtlasManager.GetMaterial( atlasId );
+  return mAtlasManager.GetTextures( atlasId );
+}
+
+Shader AtlasGlyphManager::GetShader( uint32_t atlasId ) const
+{
+  Pixel::Format pixelFormat = mAtlasManager.GetPixelFormat( atlasId );
+  return pixelFormat == Pixel::L8 ? mShaderL8 : mShaderRgba;
 }
 
 AtlasGlyphManager::~AtlasGlyphManager()