[Tizen] Use Dali::KeyFrames during AnimateBetween 16/296916/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 9 Jun 2023 02:19:29 +0000 (11:19 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Wed, 23 Aug 2023 04:46:20 +0000 (13:46 +0900)
Since KeyFrames is already BaseHandle, we don't need to use
reference of BaseHandle. So let we make BaseHandle instead of
Internal::KeyFrames.

Change-Id: I32d79aa382dde45af07bb3ded376c37fcdbfe629
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/public-api/animation/animation.cpp
dali/public-api/animation/animation.h

index 59a77db..7ef3323 100644 (file)
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/event/animation/animation-playlist.h>
 #include <dali/internal/event/animation/animator-connector.h>
+#include <dali/internal/event/animation/key-frames-impl.h>
 #include <dali/internal/event/animation/path-impl.h>
 #include <dali/internal/event/common/notification-manager.h>
 #include <dali/internal/event/common/property-helper.h>
@@ -648,46 +649,48 @@ void Animation::AnimateTo(Property& target, Property::Value destinationValue, Al
   AppendConnectorTargetValues({std::move(destinationValue), period, connectorIndex, Animation::TO});
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames)
 {
   AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, Interpolation interpolation)
 {
   AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), interpolation);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, TimePeriod period)
 {
   AnimateBetween(target, keyFrames, mDefaultAlpha, period, DEFAULT_INTERPOLATION);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, TimePeriod period, Interpolation interpolation)
 {
   AnimateBetween(target, keyFrames, mDefaultAlpha, period, interpolation);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha)
 {
   AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, Interpolation interpolation)
 {
   AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), interpolation);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
 {
   AnimateBetween(target, keyFrames, alpha, period, DEFAULT_INTERPOLATION);
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
 {
-  Object&              object          = GetImplementation(target.object);
+  Object&          object        = GetImplementation(target.object);
+  const KeyFrames& keyFramesImpl = GetImplementation(keyFrames);
+
   const Property::Type propertyType    = object.GetPropertyType(target.propertyIndex);
-  const Property::Type destinationType = keyFrames.GetType();
+  const Property::Type destinationType = keyFramesImpl.GetType();
 
   // validate animation parameters, if component index is set then use float as checked type
   ValidateParameters((target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
@@ -696,14 +699,14 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
   ExtendDuration(period);
 
-  AppendConnectorTargetValues({keyFrames.GetLastKeyFrameValue(), period, mConnectors.Count(), BETWEEN});
+  AppendConnectorTargetValues({keyFramesImpl.GetLastKeyFrameValue(), period, mConnectors.Count(), BETWEEN});
 
   // using destination type so component animation gets correct type
   switch(destinationType)
   {
     case Dali::Property::BOOLEAN:
     {
-      auto kf = GetSpecialization<const KeyFrameBoolean*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameBoolean*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<bool>::New(object,
                                                         target.propertyIndex,
                                                         target.componentIndex,
@@ -715,7 +718,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
     case Dali::Property::INTEGER:
     {
-      auto kf = GetSpecialization<const KeyFrameInteger*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameInteger*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<int32_t>::New(object,
                                                            target.propertyIndex,
                                                            target.componentIndex,
@@ -727,7 +730,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
     case Dali::Property::FLOAT:
     {
-      auto kf = GetSpecialization<const KeyFrameNumber*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameNumber*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<float>::New(object,
                                                          target.propertyIndex,
                                                          target.componentIndex,
@@ -739,7 +742,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
     case Dali::Property::VECTOR2:
     {
-      auto kf = GetSpecialization<const KeyFrameVector2*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameVector2*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<Vector2>::New(object,
                                                            target.propertyIndex,
                                                            target.componentIndex,
@@ -751,7 +754,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
     case Dali::Property::VECTOR3:
     {
-      auto kf = GetSpecialization<const KeyFrameVector3*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameVector3*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<Vector3>::New(object,
                                                            target.propertyIndex,
                                                            target.componentIndex,
@@ -763,7 +766,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
     case Dali::Property::VECTOR4:
     {
-      auto kf = GetSpecialization<const KeyFrameVector4*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameVector4*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<Vector4>::New(object,
                                                            target.propertyIndex,
                                                            target.componentIndex,
@@ -775,7 +778,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
     case Dali::Property::ROTATION:
     {
-      auto kf = GetSpecialization<const KeyFrameQuaternion*>(keyFrames);
+      auto kf = GetSpecialization<const KeyFrameQuaternion*>(keyFramesImpl);
       AddAnimatorConnector(AnimatorConnector<Quaternion>::New(object,
                                                               target.propertyIndex,
                                                               target.componentIndex,
index e2cc571..73972b0 100644 (file)
@@ -21,9 +21,9 @@
 // INTERNAL INCLUDES
 #include <dali/devel-api/animation/animation-devel.h>
 #include <dali/devel-api/common/owner-container.h>
-#include <dali/internal/event/animation/key-frames-impl.h>
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/public-api/animation/animation.h>
+#include <dali/public-api/animation/key-frames.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/ref-object.h>
@@ -280,44 +280,44 @@ public:
   void AnimateTo(Property& target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, Interpolation interpolation)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, Interpolation interpolation);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, Interpolation interpolation);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, TimePeriod period)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, TimePeriod period);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, TimePeriod period, Interpolation interpolation)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, TimePeriod period, Interpolation interpolation);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, Interpolation interpolation)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, Interpolation interpolation);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period);
 
   /**
-   * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation )
+   * @copydoc Dali::Animation::AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation )
    */
-  void AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
+  void AnimateBetween(Property target, Dali::KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
 
   // Actor-specific convenience functions
 
index c95d573..0173fc4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 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.
@@ -211,44 +211,44 @@ void Animation::AnimateTo(Property target, Property::Value destinationValue, Alp
   GetImplementation(*this).AnimateTo(target, std::move(destinationValue), alpha, period);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames));
+  GetImplementation(*this).AnimateBetween(target, keyFrames);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, Interpolation interpolation)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), interpolation);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, interpolation);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), period);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, period);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Interpolation interpolation)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), period, interpolation);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, period, interpolation);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, alpha);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Interpolation interpolation)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, interpolation);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, alpha, interpolation);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, alpha, period);
 }
 
-void Animation::AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
 {
-  GetImplementation(*this).AnimateBetween(target, GetImplementation(keyFrames), alpha, period, interpolation);
+  GetImplementation(*this).AnimateBetween(target, keyFrames, alpha, period, interpolation);
 }
 
 // Actor specific animations
index c1a203f..8e7617b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ANIMATION_H
 
 /*
- * Copyright (c) 2020 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.
@@ -125,7 +125,7 @@ class DALI_CORE_API Animation : public BaseHandle
 public:
   using AnimationSignalType = Signal<void(Animation&)>; ///< Animation finished signal type @SINCE_1_0.0
 
-  using AnyFunction = Any;                              ///< Interpolation function @SINCE_1_0.0
+  using AnyFunction = Any; ///< Interpolation function @SINCE_1_0.0
 
   /**
    * @brief Enumeration for what to do when the animation ends, is stopped, or is destroyed.
@@ -625,7 +625,7 @@ public:
    * @param[in] target The target object property to animate
    * @param[in] keyFrames The set of time/value pairs between which to animate
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames);
+  void AnimateBetween(Property target, KeyFrames keyFrames);
 
   /**
    * @brief Animates a property between keyframes.
@@ -635,7 +635,7 @@ public:
    * @param[in] keyFrames The set of time/value pairs between which to animate
    * @param[in] interpolation The method used to interpolate between values
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation);
+  void AnimateBetween(Property target, KeyFrames keyFrames, Interpolation interpolation);
 
   /**
    * @brief Animates a property between keyframes.
@@ -645,7 +645,7 @@ public:
    * @param[in] keyFrames The set of time/value pairs between which to animate
    * @param[in] alpha The alpha function to apply
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha);
+  void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha);
 
   /**
    * @brief Animates a property between keyframes.
@@ -656,7 +656,7 @@ public:
    * @param[in] alpha The alpha function to apply
    * @param[in] interpolation The method used to interpolate between values
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation);
+  void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Interpolation interpolation);
 
   /**
    * @brief Animates a property between keyframes.
@@ -666,7 +666,7 @@ public:
    * @param[in] keyFrames The set of time/value pairs between which to animate
    * @param[in] period The effect will occur during this time period
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period);
+  void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period);
 
   /**
    * @brief Animates a property between keyframes.
@@ -677,7 +677,7 @@ public:
    * @param[in] period The effect will occur during this time period
    * @param[in] interpolation The method used to interpolate between values
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation);
+  void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Interpolation interpolation);
 
   /**
    * @brief Animates a property between keyframes.
@@ -688,7 +688,7 @@ public:
    * @param[in] alpha The alpha function to apply
    * @param[in] period The effect will occur during this time period
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period);
+  void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period);
 
   /**
    * @brief Animates a property between keyframes.
@@ -700,7 +700,7 @@ public:
    * @param[in] period The effect will occur during this time period
    * @param[in] interpolation The method used to interpolate between values
    */
-  void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
+  void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
 
   // Actor-specific convenience methods