Fix regression by previous optimization for mDirtyFlags 23/20623/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 7 May 2014 13:18:50 +0000 (14:18 +0100)
committerFerran Sole <ferran.sole@samsung.com>
Fri, 9 May 2014 14:01:27 +0000 (15:01 +0100)
[Issue#] N/A
[Problem] TextInput demo working in a funny way
[Cause] regression in flag handling
[Solution] fix it

Change-Id: I4a1b5ddf5cfabdc67d6c2148ad925e7c14be3868
Signed-off-by: Ferran Sole <ferran.sole@samsung.com>
dali/internal/update/common/property-vector3.h
dali/internal/update/nodes/node.cpp
dali/internal/update/nodes/node.h

index 950788c..12a1645 100644 (file)
@@ -38,7 +38,6 @@ namespace SceneGraph
 /**
  * A Vector3 non-animatable property.
  */
-template <int DirtyFlagMask>
 class PropertyVector3 : public PropertyInputImpl
 {
 public:
@@ -48,7 +47,8 @@ public:
    * @param [in] initialValue The initial value of the property.
    */
   PropertyVector3( Vector3 initialValue )
-  : mValue( initialValue )
+  : mValue( initialValue ),
+    mDirtyFlag( true )
   {
   }
 
@@ -60,6 +60,14 @@ public:
   }
 
   /**
+   * Clear the dirty flag
+   */
+  void Clear()
+  {
+    mDirtyFlag = false;
+  }
+
+  /**
    * @copydoc Dali::Internal::PropertyInputImpl::GetType()
    */
   virtual Dali::Property::Type GetType() const
@@ -72,7 +80,7 @@ public:
    */
   virtual bool InputInitialized() const
   {
-    return true; // Animatable properties are always valid
+    return true;
   }
 
   /**
@@ -80,7 +88,7 @@ public:
    */
   virtual bool InputChanged() const
   {
-    return (mDirtyFlags & DirtyFlagMask);
+    return mDirtyFlag;
   }
 
   /**
@@ -96,7 +104,7 @@ public:
    */
   void OnSet()
   {
-    mDirtyFlags |= DirtyFlagMask;
+    mDirtyFlag = true;
   }
 
 private:
@@ -113,7 +121,7 @@ public:
 
 private:
 
-  int mDirtyFlags;
+  bool mDirtyFlag;
 
 };
 
index 69431b7..1710063 100644 (file)
@@ -246,6 +246,9 @@ int Node::GetDirtyFlags() const
 
 void Node::ResetDefaultProperties( BufferIndex updateBufferIndex )
 {
+  // clear dirty flags in parent origin & anchor point
+  mParentOrigin.Clear();
+  mAnchorPoint.Clear();
   // Reset default properties
   mSize.ResetToBaseValue( updateBufferIndex );
   mPosition.ResetToBaseValue( updateBufferIndex );
index c46134d..87ff4bc 100644 (file)
@@ -1094,8 +1094,8 @@ private:
 
 public: // Default properties
 
-  PropertyVector3<TransformFlag> mParentOrigin;  ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
-  PropertyVector3<TransformFlag> mAnchorPoint;   ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
+  PropertyVector3                mParentOrigin;  ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
+  PropertyVector3                mAnchorPoint;   ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
 
   AnimatableProperty<Vector3>    mSize;          ///< Size is provided for layouting
   AnimatableProperty<Vector3>    mPosition;      ///< Local transform; distance between parent-origin & anchor-point