Fixed Cache for AnimatedVectorImageVisual 11/300511/4
authorseungho baek <sbsh.baek@samsung.com>
Thu, 26 Oct 2023 09:16:32 +0000 (18:16 +0900)
committersunghyun kim <scholb.kim@samsung.com>
Fri, 29 Dec 2023 01:51:03 +0000 (10:51 +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 bbefdab..1b561c5 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 b31ff19..ee26514 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 f345780..cec206f 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 1d4eb34..e1b13c0 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 84d4230..089577f 100644 (file)
@@ -123,6 +123,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()
    */
   Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal();
index eec7646..6f0fac1 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 47ddf69..76b134a 100644 (file)
@@ -119,6 +119,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()
    */
   VectorAnimationRendererPlugin::UploadCompletedSignalType& UploadCompletedSignal();