Fix clear cache bug in face manager 32/323732/1
authorBowon Ryu <bowon.ryu@samsung.com>
Wed, 7 May 2025 01:16:28 +0000 (10:16 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Wed, 7 May 2025 01:16:28 +0000 (10:16 +0900)
If we want to use remain count in ClearCache,
we should also properly clear face, size, and index.
But it is difficult to support it now.
And since there is no use for remain count, we will remove this feature for now.

Change-Id: I67bddd7ec695b5b724d45c1e6886492c3cd4eb7d
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali/internal/text/text-abstraction/plugin/font-face-manager.cpp
dali/internal/text/text-abstraction/plugin/font-face-manager.h

index 36e10b4b08c367028be0e877b8fce62e144bfc9c..1b08bebdb66ebaaf71b0c1afb62801e8a09c359b 100644 (file)
@@ -328,22 +328,9 @@ FT_Error FontFaceManager::SelectFixedSize(FT_Face ftFace, const PointSize26Dot6
   return error;
 }
 
-void FontFaceManager::ClearCache(const std::size_t remainCount)
+void FontFaceManager::ClearCache()
 {
-  if(remainCount == 0u)
-  {
-    // Clear all cache.
-    mLRUFaceSizeCache.Clear();
-  }
-  else
-  {
-    // While the cache count is bigger than remainCount, remove oldest glyph.
-    while(mLRUFaceSizeCache.Count() > remainCount)
-    {
-      auto removedData = mLRUFaceSizeCache.Pop();
-      DALI_LOG_INFO(gFontClientLogFilter, Debug::Verbose, "FontClient::Plugin::FontFaceManager::ClearCache[%zu / %zu]. Remove oldest face size : %p\n", mLRUFaceSizeCache.Count(), remainCount, removedData->mFreeTypeSize);
-    }
-  }
+  mLRUFaceSizeCache.Clear();
 
   for(auto& item : mFreeTypeFaces)
   {
index d2ae14777d7bf7bb536e4374a755d14f59ee468c..f6859acc7297431ef7dc317888a837c39b5c19d3 100644 (file)
@@ -282,10 +282,8 @@ public:
 
   /**
    * @brief Clear all cached face size informations.
-   *
-   * @param[in] remainCount The number of remained cache items after call this API. Default is 0, clear all items.
    */
-  void ClearCache(const std::size_t remainCount = 0u);
+  void ClearCache();
 
 private:
   TextAbstraction::FontFileManager               mFontFileManager; ///< Handle to the font file manager.