(AnimatedVector) Make API to get marker information 39/301039/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 7 Nov 2023 11:15:26 +0000 (20:15 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 7 Nov 2023 11:15:26 +0000 (20:15 +0900)
Change-Id: I2ed04426323701c96ca4915f016336d67f67fc69
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp
dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.h

index bec6d14..810709a 100644 (file)
@@ -390,6 +390,23 @@ bool TizenVectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint
   return false;
 }
 
+void TizenVectorAnimationRenderer::GetMarkerInfo(Property::Map& map) const
+{
+  Dali::Mutex::ScopedLock lock(mMutex);
+
+  if(mVectorRenderer)
+  {
+    auto markerList = mVectorRenderer->markers();
+    for(auto&& iter : markerList)
+    {
+      Property::Array frames;
+      frames.PushBack(std::get<1>(iter));
+      frames.PushBack(std::get<2>(iter));
+      map.Add(std::get<0>(iter), frames);
+    }
+  }
+}
+
 void TizenVectorAnimationRenderer::InvalidateBuffer()
 {
   Dali::Mutex::ScopedLock lock(mMutex);
index ae7c415..9341d97 100644 (file)
@@ -112,6 +112,11 @@ public:
   bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const override;
 
   /**
+   * @copydoc Dali::VectorAnimationRendererPlugin::GetMarkerInfo()
+   */
+  void GetMarkerInfo(Property::Map& map) const override;
+
+  /**
    * @copydoc Dali::VectorAnimationRendererPlugin::InvalidateBuffer()
    */
   void InvalidateBuffer() override;
@@ -146,8 +151,8 @@ private:
 private:
   using SurfacePair = std::pair<tbm_surface_h, rlottie::Surface>;
 
-  std::string                         mUrl;                    ///< The content file path
-  std::vector<SurfacePair>            mBuffers;                ///< EGL Image vector
+  std::string                                mUrl;               ///< The content file path
+  std::vector<SurfacePair>                   mBuffers;           ///< EGL Image vector
   std::vector<std::unique_ptr<CallbackBase>> mPropertyCallbacks; ///< Property callback list
 
   mutable Dali::Mutex                 mMutex;                  ///< Mutex