[Tizen] Clear previous textures when event triggered 26/304326/1 accepted/tizen/8.0/unified/20240122.175523
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 16 Jan 2024 05:28:25 +0000 (14:28 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 16 Jan 2024 05:28:25 +0000 (14:28 +0900)
Change-Id: Id22e580d540b55cb0f3e03c69bf6a40d0f6d9019
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-extension/vector-animation-renderer/vector-animation-renderer-tizen.cpp
dali-extension/vector-animation-renderer/vector-animation-renderer-tizen.h
dali-extension/vector-animation-renderer/vector-animation-renderer-x.h
dali-extension/vector-animation-renderer/vector-animation-renderer.cpp
dali-extension/vector-animation-renderer/vector-animation-renderer.h

index 3d0b32e..97ed652 100644 (file)
@@ -287,6 +287,12 @@ void VectorAnimationRendererTizen::OnSetSize()
   mPreviousTextures.clear();
 }
 
+void VectorAnimationRendererTizen::OnNotify()
+{
+  // Reset the previous texture to destroy it in the main thread
+  mPreviousTextures.clear();
+}
+
 void VectorAnimationRendererTizen::PrepareTarget()
 {
   mTargetSurface = NativeImageSourceQueue::New(mWidth, mHeight, NativeImageSourceQueue::ColorFormat::RGBA8888);
index 98448b0..97bd1a7 100644 (file)
@@ -84,6 +84,11 @@ private:
   {}
 
   /**
+   * @copydoc VectorAnimationRenderer::OnNotify()
+   */
+  void OnNotify() override;
+
+  /**
    * @copydoc VectorAnimationRenderer::PrepareTarget()
    */
   void PrepareTarget() override;
index 9c5e8b2..842162e 100644 (file)
@@ -84,6 +84,12 @@ private:
   void OnLottieRendered() override;
 
   /**
+   * @copydoc VectorAnimationRenderer::OnNotify()
+   */
+  void OnNotify() override
+  {}
+
+  /**
    * @copydoc VectorAnimationRenderer::PrepareTarget()
    */
   void PrepareTarget() override;
index ff7d94f..2fc1c49 100644 (file)
@@ -455,6 +455,8 @@ void VectorAnimationRenderer::NotifyEvent()
       mResourceReadyTriggered = false;
       emitSignal              = true;
     }
+
+    OnNotify();
   }
   if(emitSignal)
   {
index 0d1c22c..959f8c3 100644 (file)
@@ -154,6 +154,11 @@ protected:
   virtual void OnLottieRendered() = 0;
 
   /**
+   * @brief Notify event thread comes
+   */
+  virtual void OnNotify() = 0;
+
+  /**
    * @brief Prepare target
    */
   virtual void PrepareTarget() = 0;