[dali_2.3.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / atlas / atlas-glyph-manager.cpp
index 0c6ab13..a3059fe 100644 (file)
@@ -1,5 +1,5 @@
- /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/common/singleton-service.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/atlas-manager/atlas-manager-impl.h>
 #include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 AtlasGlyphManager::AtlasGlyphManager()
 {
 }
@@ -44,8 +41,8 @@ AtlasGlyphManager AtlasGlyphManager::Get()
   AtlasGlyphManager manager;
 
   // Check whether the AtlasGlyphManager is already created
-  SingletonService singletonService( SingletonService::Get() );
-  if ( singletonService )
+  SingletonService singletonService(SingletonService::Get());
+  if(singletonService)
   {
     Dali::BaseHandle handle = singletonService.GetSingleton(typeid(AtlasGlyphManager));
     if(handle)
@@ -64,68 +61,54 @@ AtlasGlyphManager AtlasGlyphManager::Get()
   return manager;
 }
 
-AtlasGlyphManager::AtlasGlyphManager(Internal::AtlasGlyphManager *impl)
-  : BaseHandle(impl)
+AtlasGlyphManager::AtlasGlyphManager(Internal::AtlasGlyphManagerimpl)
+: BaseHandle(impl)
 {
 }
 
-void AtlasGlyphManager::Add( const Text::GlyphInfo& glyph,
-                             const BufferImage& bitmap,
-                             AtlasManager::AtlasSlot& slot )
+void AtlasGlyphManager::Add(const Text::GlyphInfo&   glyph,
+                            const GlyphStyle&        style,
+                            const PixelData&         bitmap,
+                            AtlasManager::AtlasSlot& slot)
 {
-  GetImplementation(*this).Add( glyph, bitmap, slot );
+  GetImplementation(*this).Add(glyph, style, bitmap, slot);
 }
 
-void AtlasGlyphManager::GenerateMeshData( uint32_t imageId,
-                                          const Vector2& position,
-                                          Toolkit::AtlasManager::Mesh2D& mesh )
+void AtlasGlyphManager::GenerateMeshData(uint32_t                       imageId,
+                                         const Vector2&                 position,
+                                         Toolkit::AtlasManager::Mesh2D& mesh)
 {
-  GetImplementation(*this).GenerateMeshData( imageId,
-                                             position,
-                                             mesh );
+  GetImplementation(*this).GenerateMeshData(imageId,
+                                            position,
+                                            mesh);
 }
 
-void AtlasGlyphManager::StitchMesh( Toolkit::AtlasManager::Mesh2D& first,
-                                    const Toolkit::AtlasManager::Mesh2D& second )
+bool AtlasGlyphManager::IsCached(Text::FontId             fontId,
+                                 Text::GlyphIndex         index,
+                                 const GlyphStyle&        style,
+                                 AtlasManager::AtlasSlot& slot)
 {
-  GetImplementation(*this).StitchMesh( first, second );
+  return GetImplementation(*this).IsCached(fontId, index, style, slot);
 }
 
-void AtlasGlyphManager::Cached( Text::FontId fontId,
-                                Text::GlyphIndex index,
-                                AtlasManager::AtlasSlot& slot )
+void AtlasGlyphManager::SetNewAtlasSize(uint32_t width, uint32_t height, uint32_t blockWidth, uint32_t blockHeight)
 {
-  GetImplementation(*this).Cached( fontId, index, slot );
+  GetImplementation(*this).SetNewAtlasSize(width, height, blockWidth, blockHeight);
 }
 
-void AtlasGlyphManager::SetNewAtlasSize( uint32_t width, uint32_t height, uint32_t blockWidth, uint32_t blockHeight )
+Vector2 AtlasGlyphManager::GetAtlasSize(uint32_t atlasId)
 {
-  GetImplementation(*this).SetNewAtlasSize( width, height, blockWidth, blockHeight );
+  return GetImplementation(*this).GetAtlasSize(atlasId);
 }
 
-Vector2 AtlasGlyphManager::GetAtlasSize( uint32_t atlasId )
+Pixel::Format AtlasGlyphManager::GetPixelFormat(uint32_t atlasId)
 {
-  return GetImplementation(*this).GetAtlasSize( atlasId );
+  return GetImplementation(*this).GetPixelFormat(atlasId);
 }
 
-void AtlasGlyphManager::Remove( uint32_t imageId )
+TextureSet AtlasGlyphManager::GetTextures(uint32_t atlasId) const
 {
-  GetImplementation(*this).Remove( imageId );
-}
-
-Pixel::Format AtlasGlyphManager::GetPixelFormat( uint32_t atlasId )
-{
-  return GetImplementation(*this).GetPixelFormat( atlasId );
-}
-
-Material AtlasGlyphManager::GetMaterial( uint32_t atlasId ) const
-{
-  return GetImplementation(*this).GetMaterial( atlasId );
-}
-
-Sampler AtlasGlyphManager::GetSampler( uint32_t atlasId ) const
-{
-  return GetImplementation(*this).GetSampler( atlasId );
+  return GetImplementation(*this).GetTextures(atlasId);
 }
 
 const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
@@ -133,6 +116,10 @@ const Toolkit::AtlasGlyphManager::Metrics& AtlasGlyphManager::GetMetrics()
   return GetImplementation(*this).GetMetrics();
 }
 
+void AtlasGlyphManager::AdjustReferenceCount(Text::FontId fontId, Text::GlyphIndex index, const GlyphStyle& style, int32_t delta)
+{
+  GetImplementation(*this).AdjustReferenceCount(fontId, index, style, delta);
+}
 
 } // namespace Toolkit