Calculate VisualRenderer coefficient only if updated.
[platform/core/uifw/dali-core.git] / dali / internal / update / common / animatable-property.h
index ebc2c82..612af3f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_ANIMATABLE_PROPERTY_H
 
 /*
- * Copyright (c) 2021 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 <limits>
 
 // INTERNAL INCLUDES
-#include <dali/internal/common/message.h>
-#include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/common/property-input-impl.h>
+#include <dali/internal/common/matrix-utils.h>
+
 #include <dali/internal/update/common/double-buffered.h>
 #include <dali/internal/update/common/property-base.h>
-#include <dali/internal/update/common/scene-graph-buffers.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/property-types.h>
@@ -81,7 +79,7 @@ protected: // for derived classes
   /**
    * Flag that the property has been Set during the current frame.
    */
-  void OnSet()
+  virtual void OnSet()
   {
     mDirtyFlags = SET_FLAG;
   }
@@ -89,13 +87,12 @@ protected: // for derived classes
   /**
    * Flag that the property has been Baked during the current frame.
    */
-  void OnBake()
+  virtual void OnBake()
   {
     mDirtyFlags = BAKED_FLAG;
   }
 
 public:
-
   /**
    * Mark the property as dirty so that it will be reset to the base value in the next two frames.
    */
@@ -1832,7 +1829,7 @@ public:
   void SetRelative(BufferIndex bufferIndex, const Matrix& delta)
   {
     Matrix temp;
-    Matrix::Multiply(temp, mValue[bufferIndex], delta);
+    MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
     mValue[bufferIndex] = temp;
 
     OnSet();
@@ -1898,7 +1895,7 @@ public:
   void BakeRelative(BufferIndex bufferIndex, const Matrix& delta)
   {
     Matrix temp;
-    Matrix::Multiply(temp, mValue[bufferIndex], delta);
+    MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
     mValue[bufferIndex] = temp;
     mBaseValue          = temp;
 
@@ -1988,7 +1985,7 @@ public:
   void SetRelative(BufferIndex bufferIndex, const Matrix3& delta)
   {
     Matrix3 temp;
-    Matrix3::Multiply(temp, mValue[bufferIndex], delta);
+    MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
     mValue[bufferIndex] = temp;
     OnSet();
   }
@@ -2053,7 +2050,7 @@ public:
   void BakeRelative(BufferIndex bufferIndex, const Matrix3& delta)
   {
     Matrix3 temp;
-    Matrix3::Multiply(temp, mValue[bufferIndex], delta);
+    MatrixUtils::Multiply(temp, mValue[bufferIndex], delta);
     mValue[bufferIndex] = temp;
     mBaseValue          = temp;
 
@@ -2074,104 +2071,6 @@ private:
 
 } // namespace SceneGraph
 
-// Messages for AnimatableProperty<T>
-
-template<class T>
-void BakeMessage(EventThreadServices&                     eventThreadServices,
-                 const SceneGraph::AnimatableProperty<T>& property,
-                 typename ParameterType<T>::PassingType   newValue)
-{
-  using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, T>;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&property,
-                      &SceneGraph::AnimatableProperty<T>::Bake,
-                      newValue);
-}
-
-template<class T>
-void BakeRelativeMessage(EventThreadServices&                     eventThreadServices,
-                         const SceneGraph::AnimatableProperty<T>& property,
-                         const T&                                 delta)
-{
-  using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, const T&>;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&property,
-                      &SceneGraph::AnimatableProperty<T>::BakeRelative,
-                      delta);
-}
-
-template<class T>
-void SetXComponentMessage(EventThreadServices&                       eventThreadServices,
-                          const SceneGraph::AnimatableProperty<T>&   property,
-                          typename ParameterType<float>::PassingType newValue)
-{
-  using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&property,
-                      &SceneGraph::AnimatableProperty<T>::BakeX,
-                      newValue);
-}
-
-template<class T>
-void SetYComponentMessage(EventThreadServices&                       eventThreadServices,
-                          const SceneGraph::AnimatableProperty<T>&   property,
-                          typename ParameterType<float>::PassingType newValue)
-{
-  using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&property,
-                      &SceneGraph::AnimatableProperty<T>::BakeY,
-                      newValue);
-}
-
-template<class T>
-void SetZComponentMessage(EventThreadServices&                       eventThreadServices,
-                          const SceneGraph::AnimatableProperty<T>&   property,
-                          typename ParameterType<float>::PassingType newValue)
-{
-  using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&property,
-                      &SceneGraph::AnimatableProperty<T>::BakeZ,
-                      newValue);
-}
-
-template<class T>
-void SetWComponentMessage(EventThreadServices&                       eventThreadServices,
-                          const SceneGraph::AnimatableProperty<T>&   property,
-                          typename ParameterType<float>::PassingType newValue)
-{
-  using LocalType = MessageDoubleBuffered1<SceneGraph::AnimatableProperty<T>, float>;
-
-  // Reserve some memory inside the message queue
-  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new(slot) LocalType(&property,
-                      &SceneGraph::AnimatableProperty<T>::BakeW,
-                      newValue);
-}
-
 } // namespace Internal
 
 } // namespace Dali