Merge "Reverts the previously implemented FeedTouch. The new Logic FeedTouch is comin...
authorjoogab yun <joogab.yun@samsung.com>
Tue, 18 Jun 2024 07:32:41 +0000 (07:32 +0000)
committerGerrit Code Review <gerrit@review>
Tue, 18 Jun 2024 07:32:41 +0000 (07:32 +0000)
dali/internal/update/common/animatable-property.h
dali/internal/update/gestures/scene-graph-pan-gesture.cpp
dali/internal/update/manager/transform-manager.cpp
dali/internal/update/manager/transform-manager.h
dali/internal/update/rendering/scene-graph-visual-renderer-property.h
dali/public-api/dali-core-version.cpp
packaging/dali.spec

index a5471ed..f9bd877 100644 (file)
@@ -81,7 +81,7 @@ protected: // for derived classes
    */
   virtual void OnSet()
   {
-    mDirtyFlags |= SET_FLAG;
+    mDirtyFlags = SET_FLAG;
   }
 
   /**
@@ -89,7 +89,7 @@ protected: // for derived classes
    */
   virtual void OnBake()
   {
-    mDirtyFlags |= BAKED_FLAG;
+    mDirtyFlags = BAKED_FLAG;
   }
 
 public:
@@ -98,7 +98,7 @@ public:
    */
   void MarkAsDirty()
   {
-    mDirtyFlags |= RESET_FLAG;
+    mDirtyFlags = RESET_FLAG;
   }
 
 public: // From PropertyBase
index 622948f..4933d6f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -266,6 +266,11 @@ bool PanGesture::ReadGestures(FrameGestureInfo& info, unsigned int currentTimest
     if(currentGesture.state == GestureState::STARTED)
     {
       info.justStarted = true;
+
+      // Clear pan data.
+      mPanHistory.clear();
+      mPredictionHistory.clear();
+
       // clear just finished as we have started new pan
       info.justFinished = false;
     }
@@ -301,9 +306,14 @@ bool PanGesture::ReadAndResampleGestures(FrameGestureInfo& info, unsigned int cu
 
     if(lastReadGesture.state == GestureState::STARTED)
     {
+      info.justStarted = true;
+
+      // Clear pan data.
+      mPanHistory.clear();
+      mPredictionHistory.clear();
+
       // Clear just finished as we have started new pan.
       info.justFinished = false;
-      info.justStarted  = true;
     }
     else
     {
index f5e3bac..2683f41 100644 (file)
@@ -26,6 +26,7 @@
 //INTERNAL INCLUDES
 #include <dali/internal/common/math.h>
 #include <dali/internal/common/matrix-utils.h>
+#include <dali/internal/update/common/animatable-property.h> ///< for SET_FLAG and BAKE_FLAG
 #include <dali/public-api/common/constants.h>
 
 #include <dali/integration-api/debug.h>
@@ -45,6 +46,8 @@ static const float gDefaultTransformComponentAnimatableData[] = {1.0f, 1.0f, 1.0
 //Default values for anchor point (CENTER) and parent origin (TOP_LEFT)
 static const float gDefaultTransformComponentStaticData[] = {0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f, true};
 
+static const uint32_t STATIC_COMPONENT_FLAG = 0x01; ///< Indicates that the value when we change static transform components, so need to update at least 1 frame.
+
 static_assert(sizeof(gDefaultTransformComponentAnimatableData) == sizeof(TransformComponentAnimatable), "gDefaultTransformComponentAnimatableData should have the same number of floats as specified in TransformComponentAnimatable");
 static_assert(sizeof(gDefaultTransformComponentStaticData) == sizeof(TransformComponentStatic), "gDefaultTransformComponentStaticData should have the same number of floats as specified in TransformComponentStatic");
 
@@ -110,7 +113,7 @@ TransformId TransformManager::CreateTransform()
     mBoundingSpheres.PushBack(Vector4(0.0f, 0.0f, 0.0f, 0.0f));
     mTxComponentAnimatableBaseValue.PushBack(TransformComponentAnimatable());
     mSizeBase.PushBack(Vector3(0.0f, 0.0f, 0.0f));
-    mComponentDirty.PushBack(false);
+    mComponentDirty.PushBack(CLEAN_FLAG);
     mLocalMatrixDirty.PushBack(false);
   }
   else
@@ -127,7 +130,7 @@ TransformId TransformManager::CreateTransform()
     mWorld[mComponentCount].SetIdentity();
     mBoundingSpheres[mComponentCount]  = Vector4(0.0f, 0.0f, 0.0f, 0.0f);
     mSizeBase[mComponentCount]         = Vector3(0.0f, 0.0f, 0.0f);
-    mComponentDirty[mComponentCount]   = false;
+    mComponentDirty[mComponentCount]   = CLEAN_FLAG;
     mLocalMatrixDirty[mComponentCount] = false;
   }
 
@@ -164,10 +167,12 @@ void TransformManager::RemoveTransform(TransformId id)
 void TransformManager::SetParent(TransformId id, TransformId parentId)
 {
   DALI_ASSERT_ALWAYS(id != parentId);
-  TransformId index      = mIds[id];
-  mParent[index]         = parentId;
-  mComponentDirty[index] = true;
-  mReorder               = true;
+
+  TransformId index = mIds[id];
+  mParent[index]    = parentId;
+  mComponentDirty[index] |= STATIC_COMPONENT_FLAG; ///< Need to calculate local matrix, at least 1 frame.
+
+  mReorder = true;
 }
 
 const Matrix& TransformManager::GetWorldMatrix(TransformId id) const
@@ -192,7 +197,7 @@ void TransformManager::SetInheritPosition(TransformId id, bool inherit)
     mInheritanceMode[index] &= ~INHERIT_POSITION;
   }
 
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
 }
 
 void TransformManager::SetInheritScale(TransformId id, bool inherit)
@@ -207,7 +212,7 @@ void TransformManager::SetInheritScale(TransformId id, bool inherit)
     mInheritanceMode[index] &= ~INHERIT_SCALE;
   }
 
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
 }
 
 void TransformManager::SetInheritOrientation(TransformId id, bool inherit)
@@ -222,7 +227,7 @@ void TransformManager::SetInheritOrientation(TransformId id, bool inherit)
     mInheritanceMode[index] &= ~INHERIT_ORIENTATION;
   }
 
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
 }
 
 void TransformManager::ResetToBaseValue()
@@ -362,8 +367,8 @@ bool TransformManager::Update()
     mBoundingSpheres[i]   = mWorld[i].GetTranslation();
     mBoundingSpheres[i].w = Length(centerToEdgeWorldSpace);
 
-    componentsChanged  = componentsChanged || mComponentDirty[i];
-    mComponentDirty[i] = false;
+    componentsChanged = componentsChanged || mComponentDirty[i];
+    mComponentDirty[i] >>= 1u; ///< age down.
   }
 
   DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_TRANSFORM_UPDATE", [&](std::ostringstream& oss) {
@@ -592,33 +597,37 @@ const float& TransformManager::GetVector3PropertyComponentValue(TransformId id,
 void TransformManager::SetVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
 
   switch(property)
   {
     case TRANSFORM_PROPERTY_POSITION:
     {
+      mComponentDirty[index]                  = SET_FLAG;
       mTxComponentAnimatable[index].mPosition = value;
       break;
     }
     case TRANSFORM_PROPERTY_SCALE:
     {
+      mComponentDirty[index]               = SET_FLAG;
       mTxComponentAnimatable[index].mScale = value;
       break;
     }
     case TRANSFORM_PROPERTY_PARENT_ORIGIN:
     {
+      mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
       mTxComponentStatic[index].mParentOrigin = value;
       break;
     }
     case TRANSFORM_PROPERTY_ANCHOR_POINT:
     {
+      mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
       mTxComponentStatic[index].mAnchorPoint = value;
       break;
     }
     case TRANSFORM_PROPERTY_SIZE:
     {
-      mSize[index] = value;
+      mComponentDirty[index] = SET_FLAG;
+      mSize[index]           = value;
       break;
     }
     default:
@@ -631,32 +640,36 @@ void TransformManager::SetVector3PropertyValue(TransformId id, TransformManagerP
 void TransformManager::SetVector3PropertyComponentValue(TransformId id, TransformManagerProperty property, float value, unsigned int component)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
 
   switch(property)
   {
     case TRANSFORM_PROPERTY_POSITION:
     {
+      mComponentDirty[index]                             = SET_FLAG;
       mTxComponentAnimatable[index].mPosition[component] = value;
       break;
     }
     case TRANSFORM_PROPERTY_SCALE:
     {
+      mComponentDirty[index]                          = SET_FLAG;
       mTxComponentAnimatable[index].mScale[component] = value;
       break;
     }
     case TRANSFORM_PROPERTY_PARENT_ORIGIN:
     {
+      mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
       mTxComponentStatic[index].mParentOrigin[component] = value;
       break;
     }
     case TRANSFORM_PROPERTY_ANCHOR_POINT:
     {
+      mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
       mTxComponentStatic[index].mAnchorPoint[component] = value;
       break;
     }
     case TRANSFORM_PROPERTY_SIZE:
     {
+      mComponentDirty[index]  = SET_FLAG;
       mSize[index][component] = value;
       break;
     }
@@ -670,7 +683,7 @@ void TransformManager::SetVector3PropertyComponentValue(TransformId id, Transfor
 void TransformManager::BakeVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -709,7 +722,7 @@ void TransformManager::BakeVector3PropertyValue(TransformId id, TransformManager
 void TransformManager::BakeRelativeVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -748,7 +761,7 @@ void TransformManager::BakeRelativeVector3PropertyValue(TransformId id, Transfor
 void TransformManager::BakeMultiplyVector3PropertyValue(TransformId id, TransformManagerProperty property, const Vector3& value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -787,7 +800,7 @@ void TransformManager::BakeMultiplyVector3PropertyValue(TransformId id, Transfor
 void TransformManager::BakeVector3PropertyComponentValue(TransformId id, TransformManagerProperty property, float value, unsigned int component)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -826,7 +839,7 @@ void TransformManager::BakeVector3PropertyComponentValue(TransformId id, Transfo
 void TransformManager::BakeXVector3PropertyValue(TransformId id, TransformManagerProperty property, float value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -865,7 +878,7 @@ void TransformManager::BakeXVector3PropertyValue(TransformId id, TransformManage
 void TransformManager::BakeYVector3PropertyValue(TransformId id, TransformManagerProperty property, float value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -904,7 +917,7 @@ void TransformManager::BakeYVector3PropertyValue(TransformId id, TransformManage
 void TransformManager::BakeZVector3PropertyValue(TransformId id, TransformManagerProperty property, float value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index] = true;
+  mComponentDirty[index] |= BAKED_FLAG;
 
   switch(property)
   {
@@ -954,22 +967,25 @@ const Quaternion& TransformManager::GetQuaternionPropertyValue(TransformId id) c
 void TransformManager::SetQuaternionPropertyValue(TransformId id, const Quaternion& q)
 {
   TransformId index(mIds[id]);
+  mComponentDirty[index] = SET_FLAG;
+
   mTxComponentAnimatable[index].mOrientation = q;
-  mComponentDirty[index]                     = true;
 }
 
 void TransformManager::BakeQuaternionPropertyValue(TransformId id, const Quaternion& q)
 {
   TransformId index(mIds[id]);
+  mComponentDirty[index] |= BAKED_FLAG;
+
   mTxComponentAnimatable[index].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = q;
-  mComponentDirty[index]                                                                           = true;
 }
 
 void TransformManager::BakeRelativeQuaternionPropertyValue(TransformId id, const Quaternion& q)
 {
   TransformId index(mIds[id]);
+  mComponentDirty[index] |= BAKED_FLAG;
+
   mTxComponentAnimatable[index].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = mTxComponentAnimatable[index].mOrientation * q;
-  mComponentDirty[index]                                                                           = true;
 }
 
 const Vector4& TransformManager::GetBoundingSphere(TransformId id) const
@@ -987,7 +1003,8 @@ void TransformManager::GetWorldMatrixAndSize(TransformId id, Matrix& worldMatrix
 void TransformManager::SetPositionUsesAnchorPoint(TransformId id, bool value)
 {
   TransformId index(mIds[id]);
-  mComponentDirty[index]                             = true;
+  mComponentDirty[index] |= STATIC_COMPONENT_FLAG;
+
   mTxComponentStatic[index].mPositionUsesAnchorPoint = value;
 }
 
index 97294e2..8f28273 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TRANSFORM_MANAGER_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -418,10 +418,14 @@ private:
   Vector<Vector4>                      mBoundingSpheres;                ///< Bounding spheres. xyz is the center and w is the radius
   Vector<TransformComponentAnimatable> mTxComponentAnimatableBaseValue; ///< Base values for the animatable part of the components
   Vector<Vector3>                      mSizeBase;                       ///< Base value for the size of the components
-  Vector<bool>                         mComponentDirty;                 ///< 1u if some of the parts of the component has changed in this frame, 0 otherwise
-  Vector<bool>                         mLocalMatrixDirty;               ///< 1u if the local matrix has been updated in this frame, 0 otherwise
-  Vector<SOrderItem>                   mOrderedComponents;              ///< Used to reorder components when hierarchy changes
-  bool                                 mReorder;                        ///< Flag to determine if the components have to reordered in the next Update
+  Vector<uint8_t>                      mComponentDirty;                 ///< Dirty flags for each component. Follow as animatable property's dirty flag.
+                                                                        ///< Or If we change static component changed, flag become non-zero. Age down at Update time.
+                                                                        ///< Note that we don't replace dirty flag as BAKE even if we call Bake operation.
+                                                                        ///< (Since single dirty flag controls multiple animatable properties ; Position, Size, Scale, Orientation.)
+  Vector<bool>       mLocalMatrixDirty;                                 ///< 1u if the local matrix has been updated in this frame, 0 otherwise
+  Vector<SOrderItem> mOrderedComponents;                                ///< Used to reorder components when hierarchy changes
+
+  bool mReorder : 1; ///< Flag to determine if the components have to reordered in the next Update
 };
 
 } //namespace SceneGraph
index 7fc74a6..d1f8691 100644 (file)
@@ -79,8 +79,8 @@ struct VisualRendererCoefficientCacheBase
    */
   void ResetFlag()
   {
-    mUpdateCurrentFrame    = (mUpdatedFlag != Dali::Internal::SceneGraph::CLEAN_FLAG); ///< Keep the flag whether it was updated or not.
-    mCoefficientCalculated = (!mUpdateCurrentFrame);                                   ///< Re-calculate coefficient only if previous update flag was not clean.
+    mUpdateCurrentFrame = (mUpdatedFlag != Dali::Internal::SceneGraph::CLEAN_FLAG); ///< Keep the flag whether it was updated or not.
+    mCoefficientCalculated &= (!mUpdateCurrentFrame);                               ///< Re-calculate coefficient only if previous update flag was not clean.
 
     mUpdatedFlag >>= 1;
   }
index 86ce6fc..c9c0770 100644 (file)
@@ -27,7 +27,7 @@ namespace Dali
 {
 const uint32_t    CORE_MAJOR_VERSION = 2;
 const uint32_t    CORE_MINOR_VERSION = 3;
-const uint32_t    CORE_MICRO_VERSION = 27;
+const uint32_t    CORE_MICRO_VERSION = 28;
 const char* const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index ab74504..bce6d71 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2
 Summary:    DALi 3D Engine
-Version:    2.3.27
+Version:    2.3.28
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT