Merge branch 'devel/master' into tizen accepted/tizen/unified/20230111.174543
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 10 Jan 2023 06:02:48 +0000 (15:02 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 10 Jan 2023 06:02:48 +0000 (15:02 +0900)
Change-Id: I09451a2667700aca9239847c49dcb6374bd46f4d

18 files changed:
automated-tests/src/dali-scene3d/utc-Dali-Model.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp
dali-scene3d/internal/controls/model/model-impl.cpp
dali-scene3d/public-api/loader/scene-definition.cpp
dali-toolkit/devel-api/controls/web-view/web-view.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp [deleted file]
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h [deleted file]
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 02393e3..db7a5e6 100644 (file)
@@ -51,6 +51,7 @@ const char* TEST_GLTF_FILE_NAME                    = TEST_RESOURCE_DIR "/Animate
 const char* TEST_GLTF_ANIMATION_TEST_FILE_NAME     = TEST_RESOURCE_DIR "/animationTest.gltf";
 const char* TEST_GLTF_MULTIPLE_PRIMITIVE_FILE_NAME = TEST_RESOURCE_DIR "/simpleMultiplePrimitiveTest.gltf";
 const char* TEST_DLI_FILE_NAME                     = TEST_RESOURCE_DIR "/arc.dli";
+const char* TEST_DLI_EXERCISE_FILE_NAME            = TEST_RESOURCE_DIR "/exercise.dli";
 /**
  * For the diffuse and specular cube map texture.
  * These textures are based off version of Wave engine sample
@@ -829,6 +830,31 @@ int UtcDaliModelAnimation02(void)
   END_TEST;
 }
 
+int UtcDaliModelAnimation03(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::Model model = Scene3D::Model::New(TEST_DLI_EXERCISE_FILE_NAME);
+  model.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+
+  application.GetScene().Add(model);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t animationCount = model.GetAnimationCount();
+  DALI_TEST_EQUALS(18, animationCount, TEST_LOCATION);
+
+  Animation animationByIndex = model.GetAnimation(0u);
+  DALI_TEST_CHECK(animationByIndex);
+
+  Animation animationByName = model.GetAnimation("idleClip");
+  DALI_TEST_CHECK(animationByName);
+  DALI_TEST_EQUALS(animationByIndex, animationByName, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliModelMultiplePrimitives(void)
 {
   ToolkitTestApplication application;
index 6003749..3d84173 100755 (executable)
@@ -1229,7 +1229,7 @@ public:
   void EnableVideoHole(bool enabled) override {}
   bool SendHoverEvent(const HoverEvent& event) override { return false; }
   bool SendWheelEvent(const WheelEvent& event) override { return false; }
-  WebEngineFrameRenderedSignalType& FrameRenderedSignal() override { return frameRenderedSignal; }
+  void RegisterFrameRenderedCallback(WebEngineFrameRenderedCallback callback) override {}
   void RegisterPageLoadStartedCallback(WebEnginePageLoadCallback callback) override {}
   void RegisterPageLoadInProgressCallback(WebEnginePageLoadCallback callback) override {}
   void RegisterPageLoadFinishedCallback(WebEnginePageLoadCallback callback) override {}
@@ -1240,6 +1240,7 @@ public:
   void RegisterConsoleMessageReceivedCallback(WebEngineConsoleMessageReceivedCallback callback) override {}
   void RegisterResponsePolicyDecidedCallback(WebEngineResponsePolicyDecidedCallback callback) override {}
   void RegisterNavigationPolicyDecidedCallback(WebEngineNavigationPolicyDecidedCallback callback) override {}
+  void RegisterNewWindowCreatedCallback(WebEngineNewWindowCreatedCallback callback) override {}
   void RegisterCertificateConfirmedCallback(WebEngineCertificateCallback callback) override {}
   void RegisterSslCertificateChangedCallback(WebEngineCertificateCallback callback) override {}
   void RegisterHttpAuthHandlerCallback(WebEngineHttpAuthHandlerCallback callback) override {}
@@ -1249,7 +1250,6 @@ public:
 private:
   MockWebEngineSettings settings;
   MockWebEngineBackForwardList backForwardList;
-  WebEngineFrameRenderedSignalType frameRenderedSignal;
 };
 
 Dali::WebEnginePlugin* GetWebEnginePlugin()
@@ -1614,9 +1614,9 @@ public:
     }
   }
 
-  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal()
+  void RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback)
   {
-    return mFrameRenderedSignal;
+    mFrameRenderedCallback = callback;
   }
 
   void RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
@@ -1669,6 +1669,11 @@ public:
     mNavigationPolicyDecisionCallback = callback;
   }
 
+  void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+  {
+    mNewWindowCreatedCallback = callback;
+  }
+
   void RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
   {
     mCertificateConfirmCallback = callback;
@@ -1708,8 +1713,6 @@ public:
   size_t                   mCurrentPlusOnePos;
   std::string              mUserAgent;
 
-  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType mFrameRenderedSignal;
-
   bool  mEvaluating;
   float mPageZoomFactor;
   float mTextZoomFactor;
@@ -1734,6 +1737,7 @@ public:
   Dali::WebEnginePlugin::WebEngineConsoleMessageReceivedCallback  mConsoleMessageCallback;
   Dali::WebEnginePlugin::WebEngineResponsePolicyDecidedCallback   mResponsePolicyDecisionCallback;
   Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback mNavigationPolicyDecisionCallback;
+  Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback        mNewWindowCreatedCallback;
   Dali::WebEnginePlugin::WebEngineCertificateCallback             mCertificateConfirmCallback;
   Dali::WebEnginePlugin::WebEngineCertificateCallback             mSslCertificateChangedCallback;
   Dali::WebEnginePlugin::WebEngineHttpAuthHandlerCallback         mHttpAuthHandlerCallback;
@@ -1813,7 +1817,6 @@ bool OnLoadUrl()
       std::unique_ptr<Dali::WebEngineFormRepostDecision> repostDecision(new MockWebEngineFormRepostDecision());
       gInstance->mFormRepostDecidedCallback(std::move(repostDecision));
     }
-    gInstance->mFrameRenderedSignal.Emit();
     if (gInstance->mFrameRenderedCallback)
     {
       gInstance->mFrameRenderedCallback();
@@ -1833,6 +1836,11 @@ bool OnLoadUrl()
       std::unique_ptr<Dali::WebEnginePolicyDecision> policyDecision(new MockWebEnginePolicyDecision());
       gInstance->mNavigationPolicyDecisionCallback(std::move(policyDecision));
     }
+    if (gInstance->mNewWindowCreatedCallback)
+    {
+      Dali::WebEnginePlugin* plugin = 0;
+      gInstance->mNewWindowCreatedCallback(plugin);
+    }
     if (gInstance->mCertificateConfirmCallback)
     {
       std::unique_ptr<Dali::WebEngineCertificate> certificate(new MockWebEngineCertificate());
@@ -2507,9 +2515,9 @@ void WebEngine::EnableKeyEvents( bool enabled )
 {
 }
 
-Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
+void WebEngine::RegisterFrameRenderedCallback(Dali::WebEnginePlugin::WebEngineFrameRenderedCallback callback)
 {
-  return Internal::Adaptor::GetImplementation(*this).FrameRenderedSignal();
+  Internal::Adaptor::GetImplementation(*this).RegisterFrameRenderedCallback(callback);
 }
 
 void WebEngine::RegisterPageLoadStartedCallback(Dali::WebEnginePlugin::WebEnginePageLoadCallback callback)
@@ -2562,6 +2570,11 @@ void WebEngine::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::W
   Internal::Adaptor::GetImplementation(*this).RegisterNavigationPolicyDecidedCallback(callback);
 }
 
+void WebEngine::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+  Internal::Adaptor::GetImplementation(*this).RegisterNewWindowCreatedCallback(callback);
+}
+
 void WebEngine::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
 {
   Internal::Adaptor::GetImplementation( *this ).RegisterCertificateConfirmedCallback(callback);
index 107582c..b494a44 100755 (executable)
@@ -79,6 +79,7 @@ static int                                                                gConso
 static std::unique_ptr<Dali::WebEngineConsoleMessage>                     gConsoleMessageInstance                = nullptr;
 static int                                                                gResponsePolicyDecidedCallbackCalled   = 0;
 static int                                                                gNavigationPolicyDecidedCallbackCalled = 0;
+static int                                                                gNewWindowCreatedCallbackCalled        = 0;
 static std::unique_ptr<Dali::WebEnginePolicyDecision>                     gResponsePolicyDecisionInstance        = nullptr;
 static int                                                                gCertificateConfirmCallbackCalled      = 0;
 static std::unique_ptr<Dali::WebEngineCertificate>                        gCertificateConfirmInstance            = nullptr;
@@ -148,6 +149,13 @@ static void OnNavigationPolicyDecided(std::unique_ptr<Dali::WebEnginePolicyDecis
   gNavigationPolicyDecidedCallbackCalled++;
 }
 
+static void OnNewWindowCreated(Dali::WebEnginePlugin*& outPlugin)
+{
+  gNewWindowCreatedCallbackCalled++;
+  WebView newView = WebView::New();
+  outPlugin = newView.GetPlugin();
+}
+
 static void OnUrlChanged(const std::string& url)
 {
   gUrlChangedCallbackCalled++;
@@ -1293,6 +1301,24 @@ int UtcDaliWebViewNavigationPolicyDecisionRequest(void)
   END_TEST;
 }
 
+int UtcDaliWebViewNewWindowCreated(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  DALI_TEST_CHECK(view);
+
+  // load url.
+  view.RegisterNewWindowCreatedCallback(&OnNewWindowCreated);
+  DALI_TEST_EQUALS(gNewWindowCreatedCallbackCalled, 0, TEST_LOCATION);
+
+  view.LoadUrl(TEST_URL1);
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS(gNewWindowCreatedCallbackCalled, 1, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliWebViewHitTest(void)
 {
   ToolkitTestApplication application;
index b552489..bed5f34 100644 (file)
@@ -509,8 +509,22 @@ void Model::LoadModel()
 
   if(!animations.empty())
   {
-    auto getActor = [&](const Scene3D::Loader::AnimatedProperty& property) {
-      return mModelRoot.FindChildById(scene.GetNode(property.mNodeIndex)->mNodeId);
+    auto getActor = [&](const Scene3D::Loader::AnimatedProperty& property)
+    {
+      Dali::Actor actor;
+      if(property.mNodeIndex != Scene3D::Loader::INVALID_INDEX)
+      {
+        auto* node = scene.GetNode(property.mNodeIndex);
+        if(node != nullptr)
+        {
+          actor = mModelRoot.FindChildById(node->mNodeId);
+        }
+      }
+      else
+      {
+        actor = mModelRoot.FindChildByName(property.mNodeName);
+      }
+      return actor;
     };
 
     mAnimations.clear();
index 993fcd1..3241769 100644 (file)
@@ -422,7 +422,11 @@ const NodeDefinition* SceneDefinition::GetNode(Index iNode) const
 
 NodeDefinition* SceneDefinition::GetNode(Index iNode)
 {
-  return mNodes[iNode].get();
+  if(iNode != Scene3D::Loader::INVALID_INDEX && iNode < mNodes.size())
+  {
+    return mNodes[iNode].get();
+  }
+  return nullptr;
 }
 
 void SceneDefinition::Visit(Index iNode, const Customization::Choices& choices, NodeDefinition::IVisitor& v)
index ddc0461..bc08632 100755 (executable)
@@ -94,6 +94,11 @@ Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const
   return Dali::Toolkit::GetImpl(*this).GetBackForwardList();
 }
 
+Dali::WebEnginePlugin* WebView::GetPlugin() const
+{
+  return Dali::Toolkit::GetImpl(*this).GetPlugin();
+}
+
 Dali::Toolkit::ImageView WebView::GetFavicon() const
 {
   return Dali::Toolkit::GetImpl(*this).GetFavicon();
@@ -374,6 +379,11 @@ void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::Web
   Dali::Toolkit::GetImpl(*this).RegisterNavigationPolicyDecidedCallback(callback);
 }
 
+void WebView::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+  Dali::Toolkit::GetImpl(*this).RegisterNewWindowCreatedCallback(callback);
+}
+
 void WebView::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
 {
   Dali::Toolkit::GetImpl(*this).RegisterCertificateConfirmedCallback(callback);
index 1fb893f..066256d 100755 (executable)
 
 namespace Dali
 {
+class WebEngineContext;
+class WebEngineCookieManager;
+
 namespace Toolkit
 {
 class ImageView;
 class WebBackForwardList;
-class WebContext;
-class WebCookieManager;
 class WebSettings;
 
 namespace Internal DALI_INTERNAL
@@ -279,6 +280,11 @@ public:
   Dali::Toolkit::WebBackForwardList* GetBackForwardList() const;
 
   /**
+   * @brief Gets web engine plugin.
+   */
+  Dali::WebEnginePlugin* GetPlugin() const;
+
+  /**
    * @brief Get favicon of web page.
    *
    * @return Handle to a favicon
@@ -704,6 +710,13 @@ public:
   void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
 
   /**
+   * @brief Callback to be called when a new window would be created.
+   *
+   * @param[in] callback
+   */
+  void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback);
+
+  /**
    * @brief Callback to be called when certificate need be confirmed.
    *
    * @param[in] callback
index ded91c5..6321695 100755 (executable)
@@ -19,6 +19,7 @@
 #include "web-view-impl.h"
 
 // EXTERNAL INCLUDES
+#include <cstring>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
 #include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
@@ -38,8 +39,6 @@
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
-#include <cstring>
-#include <memory>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-devel.h>
@@ -50,6 +49,9 @@
 #include <dali-toolkit/public-api/image-loader/image-url.h>
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 
+#include <functional>
+#include <memory>
+
 namespace Dali
 {
 namespace Toolkit
@@ -89,12 +91,6 @@ DALI_TYPE_REGISTRATION_END()
 
 } // namespace
 
-#define GET_ENUM_STRING(structName, inputExp) \
-  Scripting::GetLinearEnumerationName<Toolkit::WebView::structName::Type>(static_cast<Toolkit::WebView::structName::Type>(inputExp), structName##_TABLE, structName##_TABLE_COUNT)
-
-#define GET_ENUM_VALUE(structName, inputExp, outputExp) \
-  Scripting::GetEnumerationProperty<Toolkit::WebView::structName::Type>(inputExp, structName##_TABLE, structName##_TABLE_COUNT, outputExp)
-
 std::unordered_map<Dali::WebEnginePlugin*, Dali::WeakHandle<Toolkit::WebView>> WebView::mPluginWebViewMap;
 
 WebView::WebView(const std::string& locale, const std::string& timezoneId)
@@ -106,7 +102,8 @@ WebView::WebView(const std::string& locale, const std::string& timezoneId)
   mVideoHoleEnabled(false),
   mMouseEventsEnabled(true),
   mKeyEventsEnabled(true),
-  mScreenshotCapturedCallback(nullptr)
+  mScreenshotCapturedCallback{nullptr},
+  mFrameRenderedCallback{nullptr}
 {
   mWebEngine = Dali::WebEngine::New();
 
@@ -126,7 +123,8 @@ WebView::WebView(uint32_t argc, char** argv)
   mVideoHoleEnabled(false),
   mMouseEventsEnabled(true),
   mKeyEventsEnabled(true),
-  mScreenshotCapturedCallback(nullptr)
+  mScreenshotCapturedCallback{nullptr},
+  mFrameRenderedCallback{nullptr}
 {
   mWebEngine = Dali::WebEngine::New();
 
@@ -146,7 +144,6 @@ WebView::~WebView()
 {
   if(mWebEngine)
   {
-    mWebEngine.FrameRenderedSignal().Disconnect(this, &WebView::OnFrameRendered);
     auto iter = mPluginWebViewMap.find(mWebEngine.GetPlugin());
     if (iter != mPluginWebViewMap.end())
     {
@@ -226,13 +223,13 @@ void WebView::OnInitialize()
   mPositionUpdateNotification = self.AddPropertyNotification(Actor::Property::WORLD_POSITION, StepCondition(1.0f, 1.0f));
   mSizeUpdateNotification     = self.AddPropertyNotification(Actor::Property::SIZE, StepCondition(1.0f, 1.0f));
   mScaleUpdateNotification    = self.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f));
-  mPositionUpdateNotification.NotifySignal().Connect(this, &WebView::UpdateDisplayArea);
-  mSizeUpdateNotification.NotifySignal().Connect(this, &WebView::UpdateDisplayArea);
-  mScaleUpdateNotification.NotifySignal().Connect(this, &WebView::UpdateDisplayArea);
+  mPositionUpdateNotification.NotifySignal().Connect(this, &WebView::OnDisplayAreaUpdated);
+  mSizeUpdateNotification.NotifySignal().Connect(this, &WebView::OnDisplayAreaUpdated);
+  mScaleUpdateNotification.NotifySignal().Connect(this, &WebView::OnDisplayAreaUpdated);
 
   if(mWebEngine)
   {
-    mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnFrameRendered);
+    mWebEngine.RegisterFrameRenderedCallback(std::bind(&WebView::OnFrameRendered, this));
     mWebSettings        = std::unique_ptr<Dali::Toolkit::WebSettings>(new WebSettings(mWebEngine.GetSettings()));
     mWebBackForwardList = std::unique_ptr<Dali::Toolkit::WebBackForwardList>(new WebBackForwardList(mWebEngine.GetBackForwardList()));
   }
@@ -240,11 +237,6 @@ void WebView::OnInitialize()
   self.SetProperty(DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::FILLER);
 }
 
-Dali::WebEnginePlugin* WebView::GetPlugin() const
-{
-  return mWebEngine ? mWebEngine.GetPlugin() : nullptr;
-}
-
 DevelControl::ControlAccessible* WebView::CreateAccessibleObject()
 {
   return new WebViewAccessible(Self(), mWebEngine);
@@ -260,6 +252,11 @@ Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const
   return mWebBackForwardList.get();
 }
 
+Dali::WebEnginePlugin* WebView::GetPlugin() const
+{
+  return mWebEngine ? mWebEngine.GetPlugin() : nullptr;
+}
+
 Dali::Toolkit::ImageView WebView::GetFavicon() const
 {
   Dali::Toolkit::ImageView faviconView;
@@ -275,11 +272,6 @@ void WebView::LoadUrl(const std::string& url)
 {
   if(mWebEngine)
   {
-    if(!mVisual)
-    {
-      mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
-    }
-
     mWebEngine.LoadUrl(url);
   }
 }
@@ -288,11 +280,6 @@ void WebView::LoadHtmlString(const std::string& htmlString)
 {
   if(mWebEngine)
   {
-    if(!mVisual)
-    {
-      mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
-    }
-
     mWebEngine.LoadHtmlString(htmlString);
   }
 }
@@ -302,11 +289,6 @@ bool WebView::LoadHtmlStringOverrideCurrentEntry(const std::string& html, const
   if(!mWebEngine)
     return false;
 
-  if(!mVisual)
-  {
-    mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
-  }
-
   return mWebEngine.LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl);
 }
 
@@ -315,11 +297,6 @@ bool WebView::LoadContents(const std::string& contents, uint32_t contentSize, co
   if(!mWebEngine)
     return false;
 
-  if(!mVisual)
-  {
-    mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnInitialFrameRendered);
-  }
-
   return mWebEngine.LoadContents(contents, contentSize, mimeType, encoding, baseUri);
 }
 
@@ -608,37 +585,6 @@ void WebView::SetTtsFocus(bool focused)
   }
 }
 
-void WebView::UpdateDisplayArea(Dali::PropertyNotification& /*source*/)
-{
-  if(!mWebEngine)
-    return;
-
-  Actor self(Self());
-
-  bool    positionUsesAnchorPoint = self.GetProperty<bool>(Actor::Property::POSITION_USES_ANCHOR_POINT);
-  Vector3 actorSize               = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::SCALE);
-  Vector3 anchorPointOffSet       = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
-  Vector2 screenPosition          = self.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
-
-  Dali::Rect<int32_t> displayArea;
-  displayArea.x      = screenPosition.x - anchorPointOffSet.x;
-  displayArea.y      = screenPosition.y - anchorPointOffSet.y;
-  displayArea.width  = actorSize.x;
-  displayArea.height = actorSize.y;
-
-  Size displaySize = Size(displayArea.width, displayArea.height);
-  if(mWebViewSize != displaySize)
-  {
-    mWebViewSize = displaySize;
-  }
-
-  if(mWebViewArea != displayArea)
-  {
-    mWebViewArea = displayArea;
-    mWebEngine.UpdateDisplayArea(mWebViewArea);
-  }
-}
-
 void WebView::EnableVideoHole(bool enabled)
 {
   mVideoHoleEnabled = enabled;
@@ -759,6 +705,14 @@ void WebView::RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::Web
   }
 }
 
+void WebView::RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback)
+{
+  if(mWebEngine)
+  {
+    mWebEngine.RegisterNewWindowCreatedCallback(callback);
+  }
+}
+
 void WebView::RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback)
 {
   if(mWebEngine)
@@ -813,15 +767,13 @@ void WebView::OnFrameRendered()
   {
     mFrameRenderedCallback();
   }
-}
 
-void WebView::OnInitialFrameRendered()
-{
-  mWebEngine.FrameRenderedSignal().Disconnect(this, &WebView::OnInitialFrameRendered);
+  // Make sure that mVisual is created only once.
+  if (mVisual)
+    return;
 
   Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(mWebEngine.GetNativeImageSource());
   mVisual                                = Toolkit::VisualFactory::Get().CreateVisual({{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, {Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()}});
-
   if(mVisual)
   {
     DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual);
@@ -829,6 +781,37 @@ void WebView::OnInitialFrameRendered()
   }
 }
 
+void WebView::OnDisplayAreaUpdated(Dali::PropertyNotification& /*source*/)
+{
+  if(!mWebEngine)
+    return;
+
+  Actor self(Self());
+
+  bool    positionUsesAnchorPoint = self.GetProperty<bool>(Actor::Property::POSITION_USES_ANCHOR_POINT);
+  Vector3 actorSize               = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::SCALE);
+  Vector3 anchorPointOffSet       = actorSize * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
+  Vector2 screenPosition          = self.GetProperty<Vector2>(Actor::Property::SCREEN_POSITION);
+
+  Dali::Rect<int32_t> displayArea;
+  displayArea.x      = screenPosition.x - anchorPointOffSet.x;
+  displayArea.y      = screenPosition.y - anchorPointOffSet.y;
+  displayArea.width  = actorSize.x;
+  displayArea.height = actorSize.y;
+
+  Size displaySize = Size(displayArea.width, displayArea.height);
+  if(mWebViewSize != displaySize)
+  {
+    mWebViewSize = displaySize;
+  }
+
+  if(mWebViewArea != displayArea)
+  {
+    mWebViewArea = displayArea;
+    mWebEngine.UpdateDisplayArea(mWebViewArea);
+  }
+}
+
 void WebView::OnVisibilityChanged(Actor actor, bool isVisible, Dali::DevelActor::VisibilityChange::Type type)
 {
   if(type == Dali::DevelActor::VisibilityChange::Type::SELF)
@@ -1339,9 +1322,6 @@ void WebView::WebViewAccessible::SetRemoteChildAddress(Dali::Accessibility::Addr
   OnChildrenChanged();
 }
 
-#undef GET_ENUM_STRING
-#undef GET_ENUM_VALUE
-
 } // namespace Internal
 
 } // namespace Toolkit
index cfbb31e..fc5d06a 100755 (executable)
@@ -99,6 +99,11 @@ public:
   Dali::Toolkit::WebBackForwardList* GetBackForwardList() const;
 
   /**
+   * @copydoc Dali::Toolkit::WebView::GetPlugin()
+   */
+  Dali::WebEnginePlugin* GetPlugin() const;
+
+  /**
    * @copydoc Dali::Toolkit::WebView::GetFavicon()
    */
   Dali::Toolkit::ImageView GetFavicon() const;
@@ -374,6 +379,11 @@ public:
   void RegisterNavigationPolicyDecidedCallback(Dali::WebEnginePlugin::WebEngineNavigationPolicyDecidedCallback callback);
 
   /**
+   * @copydoc Dali::Toolkit::WebView::RegisterNewWindowCreatedCallback()
+   */
+  void RegisterNewWindowCreatedCallback(Dali::WebEnginePlugin::WebEngineNewWindowCreatedCallback callback);
+
+  /**
    * @copydoc Dali::Toolkit::WebView::RegisterCertificateConfirmedCallback()
    */
   void RegisterCertificateConfirmedCallback(Dali::WebEnginePlugin::WebEngineCertificateCallback callback);
@@ -465,11 +475,6 @@ private:
   WebView& operator=(const WebView& webView);
 
   /**
-   * @brief Gets web engine plugin.
-   */
-  Dali::WebEnginePlugin* GetPlugin() const;
-
-  /**
    * @brief Set an absolute scroll of the given view.
    * @param[in] x The coordinate x of scroll
    * @param[in] y The coordinate y of scroll
@@ -593,12 +598,6 @@ private:
   bool SetVisibility(bool visible);
 
   /**
-   * @brief Update display area of web view.
-   * @param[in] source The soource triggers Notification.
-   */
-  void UpdateDisplayArea(Dali::PropertyNotification& source);
-
-  /**
    * @brief Enable/Disable video hole for video playing.
    * @param[in] enabled True if video hole is enabled, false otherwise.
    */
@@ -661,9 +660,10 @@ private:
   void OnFrameRendered();
 
   /**
-   * @brief Callback function to be called when frame is rendered. This is to check initial buffer is ready.
+   * @brief Callback for updating display area of web view.
+   * @param[in] source The soource triggers Notification.
    */
-  void OnInitialFrameRendered();
+  void OnDisplayAreaUpdated(Dali::PropertyNotification& source);
 
   /**
    * @brief Callback function to be called when visibility is changed.
index a7f5397..b859b39 100644 (file)
@@ -26,7 +26,6 @@ SET( toolkit_src_files
    ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-manager.cpp
    ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-task.cpp
    ${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-thread.cpp
-   ${toolkit_src_dir}/visuals/animated-vector-image/vector-rasterize-thread.cpp
    ${toolkit_src_dir}/visuals/arc/arc-visual.cpp
    ${toolkit_src_dir}/visuals/border/border-visual.cpp
    ${toolkit_src_dir}/visuals/color/color-visual.cpp
index 45d3484..158ef83 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,7 +46,8 @@ Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(Debug::NoLogging,
 } // unnamed namespace
 
 VectorAnimationTask::VectorAnimationTask(VisualFactoryCache& factoryCache)
-: mUrl(),
+: AsyncTask(MakeCallback(this, &VectorAnimationTask::TaskCompleted), AsyncTask::ThreadType::WORKER_THREAD),
+  mUrl(),
   mVectorRenderer(VectorAnimationRenderer::New()),
   mAnimationData(),
   mVectorAnimationThread(factoryCache.GetVectorAnimationManager().GetVectorAnimationThread()),
@@ -76,7 +77,9 @@ VectorAnimationTask::VectorAnimationTask(VisualFactoryCache& factoryCache)
   mAnimationDataUpdated(false),
   mDestroyTask(false),
   mLoadRequest(false),
-  mLoadFailed(false)
+  mLoadFailed(false),
+  mRasterized(false),
+  mKeepAnimation(false)
 {
   mVectorRenderer.UploadCompletedSignal().Connect(this, &VectorAnimationTask::OnUploadCompleted);
 }
@@ -86,6 +89,16 @@ VectorAnimationTask::~VectorAnimationTask()
   DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::~VectorAnimationTask: destructor [%p]\n", this);
 }
 
+void VectorAnimationTask::Process()
+{
+  mRasterized = Rasterize();
+}
+
+bool VectorAnimationTask::IsReady()
+{
+  return true;
+}
+
 void VectorAnimationTask::Finalize()
 {
   ConditionalWait::ScopedLock lock(mConditionalWait);
@@ -105,6 +118,21 @@ void VectorAnimationTask::Finalize()
   mDestroyTask = true;
 }
 
+void VectorAnimationTask::TaskCompleted(VectorAnimationTaskPtr task)
+{
+  mVectorAnimationThread.OnTaskCompleted(task, task->IsRasterized(), task->IsAnimating());
+}
+
+bool VectorAnimationTask::IsRasterized()
+{
+  return mRasterized;
+}
+
+bool VectorAnimationTask::IsAnimating()
+{
+  return mKeepAnimation;
+}
+
 bool VectorAnimationTask::Load(bool synchronousLoading)
 {
   if(!mVectorRenderer.Load(mUrl))
@@ -401,11 +429,11 @@ VectorAnimationTask::ResourceReadySignalType& VectorAnimationTask::ResourceReady
   return mResourceReadySignal;
 }
 
-bool VectorAnimationTask::Rasterize(bool& keepAnimation)
+bool VectorAnimationTask::Rasterize()
 {
   bool     stopped = false;
   uint32_t currentFrame;
-  keepAnimation = false;
+  mKeepAnimation = false;
 
   {
     ConditionalWait::ScopedLock lock(mConditionalWait);
@@ -530,7 +558,7 @@ bool VectorAnimationTask::Rasterize(bool& keepAnimation)
 
   if(mPlayState != PlayState::PAUSED && mPlayState != PlayState::STOPPED)
   {
-    keepAnimation = true;
+    mKeepAnimation = true;
   }
 
   return true;
index 4a0c497..0b2c43e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VECTOR_ANIMATION_TASK_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 #include <dali/devel-api/adaptor-framework/event-thread-callback.h>
 #include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
 #include <dali/devel-api/threading/conditional-wait.h>
+#include <dali/public-api/adaptor-framework/async-task-manager.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/property-array.h>
 #include <chrono>
@@ -44,7 +45,7 @@ typedef IntrusivePtr<VectorAnimationTask> VectorAnimationTaskPtr;
 /**
  * The task of the vector animation.
  */
-class VectorAnimationTask : public RefObject, public ConnectionTracker
+class VectorAnimationTask : public AsyncTask, public ConnectionTracker
 {
 public:
   enum class ResourceStatus
@@ -134,6 +135,17 @@ public:
   ~VectorAnimationTask() override;
 
   /**
+   * Process the task accodring to the type
+   */
+  void Process() override;
+
+  /**
+   * Whether the task is ready to process.
+   * @return True if the task is ready to process.
+   */
+  bool IsReady() override;
+
+  /**
    * @brief Finalizes the task.
    */
   void Finalize();
@@ -210,10 +222,9 @@ public:
 
   /**
    * @brief Rasterizes the current frame.
-   * @param[out] keepAnimation true if the animation is running, false otherwise.
    * @return true if the rasterization succeeded, false otherwise.
    */
-  bool Rasterize(bool& keepAnimation);
+  bool Rasterize();
 
   /**
    * @brief Calculates the time for the next frame rasterization.
@@ -227,6 +238,24 @@ public:
    */
   TimePoint GetNextFrameTime();
 
+  /**
+   * @brief Called when the rasterization is completed from the asyncTaskManager
+   * @param[in] task The completed task
+   */
+  void TaskCompleted(VectorAnimationTaskPtr task);
+
+  /**
+   * @brief Check the rasterization succeeded
+   * @return true if the rasterization succeeded, false otherwise.
+   */
+  bool IsRasterized();
+
+  /**
+   * @brief Check the animation is running
+   * @return true if the animation is running, false otherwise.
+   */
+  bool IsAnimating();
+
 private:
   /**
    * @brief Loads the animation file.
@@ -357,6 +386,8 @@ private:
   bool                                 mDestroyTask;
   bool                                 mLoadRequest;
   bool                                 mLoadFailed;
+  bool                                 mRasterized;
+  bool                                 mKeepAnimation;
 };
 
 } // namespace Internal
index c6dbdb6..02198f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,19 +33,6 @@ namespace Internal
 {
 namespace
 {
-constexpr auto DEFAULT_NUMBER_OF_RASTERIZE_THREADS = size_t{4u};
-constexpr auto NUMBER_OF_RASTERIZE_THREADS_ENV     = "DALI_VECTOR_RASTERIZE_THREADS";
-
-size_t GetNumberOfThreads(const char* environmentVariable, size_t defaultValue)
-{
-  using Dali::EnvironmentVariable::GetEnvironmentVariable;
-  auto           numberString          = GetEnvironmentVariable(environmentVariable);
-  auto           numberOfThreads       = numberString ? std::strtoul(numberString, nullptr, 10) : 0;
-  constexpr auto MAX_NUMBER_OF_THREADS = 100u;
-  DALI_ASSERT_DEBUG(numberOfThreads < MAX_NUMBER_OF_THREADS);
-  return (numberOfThreads > 0 && numberOfThreads < MAX_NUMBER_OF_THREADS) ? numberOfThreads : defaultValue;
-}
-
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VECTOR_ANIMATION");
 #endif
@@ -56,13 +43,13 @@ VectorAnimationThread::VectorAnimationThread()
 : mAnimationTasks(),
   mCompletedTasks(),
   mWorkingTasks(),
-  mRasterizers(GetNumberOfThreads(NUMBER_OF_RASTERIZE_THREADS_ENV, DEFAULT_NUMBER_OF_RASTERIZE_THREADS), [&]() { return RasterizeHelper(*this); }),
   mSleepThread(MakeCallback(this, &VectorAnimationThread::OnAwakeFromSleep)),
   mConditionalWait(),
   mNeedToSleep(false),
   mDestroyThread(false),
   mLogFactory(Dali::Adaptor::Get().GetLogFactory())
 {
+  mAsyncTaskManager = Dali::AsyncTaskManager::Get();
   mSleepThread.Start();
 }
 
@@ -226,7 +213,6 @@ void VectorAnimationThread::Rasterize()
 
 //    DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationThread::Rasterize: [next time = %lld]\n", duration.count());
 #endif
-
     if(nextFrameTime <= currentTime)
     {
       // If the task is not in the working list
@@ -236,11 +222,7 @@ void VectorAnimationThread::Rasterize()
 
         // Add it to the working list
         mWorkingTasks.push_back(nextTask);
-
-        auto rasterizerHelperIt = mRasterizers.GetNext();
-        DALI_ASSERT_ALWAYS(rasterizerHelperIt != mRasterizers.End());
-
-        rasterizerHelperIt->Rasterize(nextTask);
+        mAsyncTaskManager.AddTask(nextTask);
       }
       else
       {
@@ -255,31 +237,6 @@ void VectorAnimationThread::Rasterize()
   }
 }
 
-VectorAnimationThread::RasterizeHelper::RasterizeHelper(VectorAnimationThread& animationThread)
-: RasterizeHelper(std::unique_ptr<VectorRasterizeThread>(new VectorRasterizeThread()), animationThread)
-{
-}
-
-VectorAnimationThread::RasterizeHelper::RasterizeHelper(RasterizeHelper&& rhs)
-: RasterizeHelper(std::move(rhs.mRasterizer), rhs.mAnimationThread)
-{
-}
-
-VectorAnimationThread::RasterizeHelper::RasterizeHelper(std::unique_ptr<VectorRasterizeThread> rasterizer, VectorAnimationThread& animationThread)
-: mRasterizer(std::move(rasterizer)),
-  mAnimationThread(animationThread)
-{
-  mRasterizer->SetCompletedCallback(MakeCallback(&mAnimationThread, &VectorAnimationThread::OnTaskCompleted));
-}
-
-void VectorAnimationThread::RasterizeHelper::Rasterize(VectorAnimationTaskPtr task)
-{
-  if(task)
-  {
-    mRasterizer->AddTask(task);
-  }
-}
-
 VectorAnimationThread::SleepThread::SleepThread(CallbackBase* callback)
 : mConditionalWait(),
   mAwakeCallback(std::unique_ptr<CallbackBase>(callback)),
index 0d2dfb0..0fd37e4 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VECTOR_ANIMATION_THREAD_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/devel-api/threading/conditional-wait.h>
 #include <dali/devel-api/threading/thread.h>
 #include <dali/integration-api/adaptor-framework/log-factory-interface.h>
-#include <dali/public-api/signals/connection-tracker.h>
 #include <dali/public-api/adaptor-framework/round-robin-container-view.h>
+#include <dali/public-api/signals/connection-tracker.h>
 #include <memory>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h>
-#include <dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h>
 
 namespace Dali
 {
@@ -83,45 +82,6 @@ private:
    */
   void Rasterize();
 
-private:
-  /**
-   * @brief Helper class to keep the relation between VectorRasterizeThread and corresponding container
-   */
-  class RasterizeHelper : public ConnectionTracker
-  {
-  public:
-    /**
-     * @brief Create an RasterizeHelper.
-     *
-     * @param[in] animationThread Reference to the VectorAnimationThread
-     */
-    RasterizeHelper(VectorAnimationThread& animationThread);
-
-    /**
-     * @brief Rasterizes the task.
-     *
-     * @param[in] task The task to rasterize.
-     */
-    void Rasterize(VectorAnimationTaskPtr task);
-
-  public:
-    RasterizeHelper(const RasterizeHelper&) = delete;
-    RasterizeHelper& operator=(const RasterizeHelper&) = delete;
-
-    RasterizeHelper(RasterizeHelper&& rhs);
-    RasterizeHelper& operator=(RasterizeHelper&& rhs) = delete;
-
-  private:
-    /**
-     * @brief Main constructor that used by all other constructors
-     */
-    RasterizeHelper(std::unique_ptr<VectorRasterizeThread> rasterizer, VectorAnimationThread& animationThread);
-
-  private:
-    std::unique_ptr<VectorRasterizeThread> mRasterizer;
-    VectorAnimationThread&                 mAnimationThread;
-  };
-
   /**
    * @brief The thread to sleep until the next frame time.
    */
@@ -170,15 +130,15 @@ private:
   VectorAnimationThread& operator=(const VectorAnimationThread& thread) = delete;
 
 private:
-  std::vector<VectorAnimationTaskPtr>      mAnimationTasks;
-  std::vector<VectorAnimationTaskPtr>      mCompletedTasks;
-  std::vector<VectorAnimationTaskPtr>      mWorkingTasks;
-  RoundRobinContainerView<RasterizeHelper> mRasterizers;
-  SleepThread                              mSleepThread;
-  ConditionalWait                          mConditionalWait;
-  bool                                     mNeedToSleep;
-  bool                                     mDestroyThread;
-  const Dali::LogFactoryInterface&         mLogFactory;
+  std::vector<VectorAnimationTaskPtr> mAnimationTasks;
+  std::vector<VectorAnimationTaskPtr> mCompletedTasks;
+  std::vector<VectorAnimationTaskPtr> mWorkingTasks;
+  SleepThread                         mSleepThread;
+  ConditionalWait                     mConditionalWait;
+  bool                                mNeedToSleep;
+  bool                                mDestroyThread;
+  const Dali::LogFactoryInterface&    mLogFactory;
+  Dali::AsyncTaskManager              mAsyncTaskManager;
 };
 
 } // namespace Internal
diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
deleted file mode 100644 (file)
index 0ba9f52..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h>
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/thread-settings.h>
-#include <dali/integration-api/adaptor-framework/adaptor.h>
-#include <dali/integration-api/debug.h>
-#include <chrono>
-#include <thread>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal
-{
-namespace
-{
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VECTOR_ANIMATION");
-#endif
-
-} // unnamed namespace
-
-VectorRasterizeThread::VectorRasterizeThread()
-: mRasterizeTasks(),
-  mConditionalWait(),
-  mCompletedCallback(),
-  mDestroyThread(false),
-  mIsThreadStarted(false),
-  mLogFactory(Dali::Adaptor::Get().GetLogFactory())
-{
-}
-
-VectorRasterizeThread::~VectorRasterizeThread()
-{
-  // Stop the thread
-  {
-    ConditionalWait::ScopedLock lock(mConditionalWait);
-    mDestroyThread = true;
-    mConditionalWait.Notify(lock);
-  }
-
-  DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::~VectorRasterizeThread: Join [%p]\n", this);
-
-  Join();
-}
-
-void VectorRasterizeThread::SetCompletedCallback(CallbackBase* callback)
-{
-  ConditionalWait::ScopedLock lock(mConditionalWait);
-
-  mCompletedCallback = std::unique_ptr<CallbackBase>(callback);
-}
-
-void VectorRasterizeThread::AddTask(VectorAnimationTaskPtr task)
-{
-  // Lock while adding task to the queue
-  ConditionalWait::ScopedLock lock(mConditionalWait);
-
-  if(!mIsThreadStarted)
-  {
-    Start();
-    mIsThreadStarted = true;
-  }
-
-  if(mRasterizeTasks.end() == std::find(mRasterizeTasks.begin(), mRasterizeTasks.end(), task))
-  {
-    mRasterizeTasks.push_back(task);
-
-    // wake up the animation thread
-    mConditionalWait.Notify(lock);
-  }
-}
-
-void VectorRasterizeThread::Run()
-{
-  SetThreadName("VectorRasterizeThread");
-  mLogFactory.InstallLogFunction();
-
-  while(!mDestroyThread)
-  {
-    Rasterize();
-  }
-}
-
-void VectorRasterizeThread::Rasterize()
-{
-  VectorAnimationTaskPtr nextTask;
-  {
-    // Lock while popping task out from the queue
-    ConditionalWait::ScopedLock lock(mConditionalWait);
-
-    // conditional wait
-    if(mRasterizeTasks.empty())
-    {
-      mConditionalWait.Wait(lock);
-    }
-
-    // pop out the next task from the queue
-    if(!mRasterizeTasks.empty())
-    {
-      std::vector<VectorAnimationTaskPtr>::iterator next = mRasterizeTasks.begin();
-      nextTask                                           = *next;
-      mRasterizeTasks.erase(next);
-    }
-  }
-
-  if(nextTask)
-  {
-    bool keepAnimation;
-    bool success = nextTask->Rasterize(keepAnimation);
-
-    if(mCompletedCallback)
-    {
-      CallbackBase::Execute(*mCompletedCallback, nextTask, success, keepAnimation);
-    }
-  }
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h b/dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h
deleted file mode 100644 (file)
index 25bd4e5..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef DALI_TOOLKIT_VECTOR_IMAGE_RASTERIZE_THREAD_H
-#define DALI_TOOLKIT_VECTOR_IMAGE_RASTERIZE_THREAD_H
-
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/threading/conditional-wait.h>
-#include <dali/devel-api/threading/thread.h>
-#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
-#include <memory>
-#include <vector>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-namespace Internal
-{
-/**
- * The worker thread for vector image rasterization.
- */
-class VectorRasterizeThread : public Thread
-{
-public:
-  /**
-   * @brief Constructor.
-   */
-  VectorRasterizeThread();
-
-  /**
-   * @brief Destructor.
-   */
-  ~VectorRasterizeThread() override;
-
-  /**
-   * The callback is called from the rasterize thread after the rasterization is completed.
-   * @param[in] callBack  The function to call.
-   */
-  void SetCompletedCallback(CallbackBase* callback);
-
-  /**
-   * Add a task to rasterize.
-   *
-   * @param[in] task The task to rasterize
-   */
-  void AddTask(VectorAnimationTaskPtr task);
-
-protected:
-  /**
-   * @brief The entry function of the worker thread.
-   *        It rasterizes the vector image.
-   */
-  void Run() override;
-
-private:
-  /**
-   * Rasterizes the tasks.
-   */
-  void Rasterize();
-
-private:
-  // Undefined
-  VectorRasterizeThread(const VectorRasterizeThread& thread) = delete;
-
-  // Undefined
-  VectorRasterizeThread& operator=(const VectorRasterizeThread& thread) = delete;
-
-private:
-  std::vector<VectorAnimationTaskPtr> mRasterizeTasks;
-  ConditionalWait                     mConditionalWait;
-  std::unique_ptr<CallbackBase>       mCompletedCallback;
-  bool                                mDestroyThread; ///< Whether the thread be destroyed
-  bool                                mIsThreadStarted;
-  const Dali::LogFactoryInterface&    mLogFactory; ///< The log factory
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // DALI_TOOLKIT_VECTOR_IMAGE_RASTERIZE_THREAD_H
index 88e8de6..1144ebe 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 7;
+const unsigned int TOOLKIT_MICRO_VERSION = 8;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index d5f5a6c..be65997 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.2.7
+Version:    2.2.8
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT