[Tizen] Fixed Cache for AnimatedVectorImageVisual 19/303619/1
authorseungho baek <sbsh.baek@samsung.com>
Thu, 26 Oct 2023 09:16:32 +0000 (18:16 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 2 Jan 2024 11:32:24 +0000 (20:32 +0900)
Change-Id: I75e21fae0ca9e2561dd08f66e05ff590d2c898fc
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali/devel-api/adaptor-framework/vector-animation-renderer-plugin.h
dali/devel-api/adaptor-framework/vector-animation-renderer.cpp
dali/devel-api/adaptor-framework/vector-animation-renderer.h
dali/internal/vector-animation/common/vector-animation-renderer-impl.cpp
dali/internal/vector-animation/common/vector-animation-renderer-impl.h
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.cpp
dali/internal/vector-animation/common/vector-animation-renderer-plugin-proxy.h

index bbefdab0fd632a7267973990e9ad1c4d878cb3d9..1b561c5ea79fdf285fa9af81be23256af29c0455 100644 (file)
@@ -182,6 +182,8 @@ public:
    */
   virtual void AddPropertyValueCallback(const std::string& keyPath, VectorProperty property, CallbackBase* callback, int32_t id) = 0;
 
+  virtual void KeepRasterizedBuffer() = 0;
+
   /**
    * @brief Connect to this signal to be notified when the texture upload is completed.
    *
index b31ff1903392c1d1615dd7fa3b0d40ee74b45520..ee2651488a6db4fe40d1e73faa9d2b23b76f3061 100644 (file)
@@ -128,6 +128,11 @@ void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPat
   GetImplementation(*this).AddPropertyValueCallback(keyPath, property, callback, id);
 }
 
+void VectorAnimationRenderer::KeepRasterizedBuffer()
+{
+  GetImplementation(*this).KeepRasterizedBuffer();
+}
+
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return GetImplementation(*this).UploadCompletedSignal();
index f3457801534327d9f99db9c06b827c069483b718..cec206fee0f2458d2cb4437794123e3d6c92f992 100644 (file)
@@ -227,6 +227,15 @@ public:
    */
   void AddPropertyValueCallback(const std::string& keyPath, VectorProperty property, CallbackBase* callback, int32_t id);
 
+  /**
+   * @brief Keep the rasterized buffer to use the frame cache.
+   *
+   * By default, only as much as needed is kept in the rasterized buffer and not kept after use.
+   * tis API is efficient in terms of memory, but has the disadvantage of having to load the necessary buffer each time.
+   * therefore, if there are cases in which you want to improve the performance even if the app sacrifices a lot of memory, this API is useful.
+   */
+  void KeepRasterizedBuffer();
+
 public: // Signals
   /**
    * @brief Connect to this signal to be notified when the texture upload is completed.
index 1d4eb34af77d810f73c2cfe7c3afbe149affca93..e1b13c02515da38e1e597c75cdae32aa8469b9bf 100644 (file)
@@ -131,6 +131,11 @@ void VectorAnimationRenderer::AddPropertyValueCallback(const std::string& keyPat
   mPlugin.AddPropertyValueCallback(keyPath, property, callback, id);
 }
 
+void VectorAnimationRenderer::KeepRasterizedBuffer()
+{
+  mPlugin.KeepRasterizedBuffer();
+}
+
 Dali::VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return mPlugin.UploadCompletedSignal();
index 84d423070d69fb0bf94b4d47b3c60f521c10cada..089577fdfad1f974619dc5fc8a1ccec9d3c489fe 100644 (file)
@@ -122,6 +122,11 @@ public:
    */
   void AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id);
 
+  /**
+   * @copydoc Dali::VectorAnimationRenderer::KeepRasterizedBuffer()
+   */
+  void KeepRasterizedBuffer();
+
   /**
    * @copydoc Dali::VectorAnimationRenderer::UploadCompletedSignal()
    */
index eec7646be40abda58ef9eebeebba8bbcca023aa7..6f0fac1647d1adcc37934ecacadd68d9c6e81ffa 100644 (file)
@@ -228,6 +228,14 @@ void VectorAnimationRendererPluginProxy::AddPropertyValueCallback(const std::str
   }
 }
 
+void VectorAnimationRendererPluginProxy::KeepRasterizedBuffer()
+{
+  if(mPlugin)
+  {
+    mPlugin->KeepRasterizedBuffer();
+  }
+}
+
 VectorAnimationRendererPlugin::UploadCompletedSignalType& VectorAnimationRendererPluginProxy::UploadCompletedSignal()
 {
   if(mPlugin)
index 47ddf693a0aaf41fbe75510e7593a05326ab6fe5..76b134a4abe29db7b96e0a79913564e9ced52af7 100644 (file)
@@ -118,6 +118,11 @@ public:
    */
   void AddPropertyValueCallback(const std::string& keyPath, Dali::VectorAnimationRenderer::VectorProperty property, CallbackBase* callback, int32_t id);
 
+  /**
+   * @copydoc Dali::VectorAnimationRendererPlugin::KeepRasterizedBuffer()
+   */
+  void KeepRasterizedBuffer();
+
   /**
    * @copydoc Dali::VectorAnimationRendererPlugin::UploadCompletedSignal()
    */