From 232127c0b1287b9373960636ba98d2128fb2b09d Mon Sep 17 00:00:00 2001 From: Kimmo Hoikka Date: Wed, 7 May 2014 14:18:50 +0100 Subject: [PATCH] Fix regression by previous optimization for mDirtyFlags [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 --- dali/internal/update/common/property-vector3.h | 20 ++++++++++++++------ dali/internal/update/nodes/node.cpp | 3 +++ dali/internal/update/nodes/node.h | 4 ++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dali/internal/update/common/property-vector3.h b/dali/internal/update/common/property-vector3.h index 950788c..12a1645 100644 --- a/dali/internal/update/common/property-vector3.h +++ b/dali/internal/update/common/property-vector3.h @@ -38,7 +38,6 @@ namespace SceneGraph /** * A Vector3 non-animatable property. */ -template 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; }; diff --git a/dali/internal/update/nodes/node.cpp b/dali/internal/update/nodes/node.cpp index 69431b7..1710063 100644 --- a/dali/internal/update/nodes/node.cpp +++ b/dali/internal/update/nodes/node.cpp @@ -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 ); diff --git a/dali/internal/update/nodes/node.h b/dali/internal/update/nodes/node.h index c46134d..87ff4bc 100644 --- a/dali/internal/update/nodes/node.h +++ b/dali/internal/update/nodes/node.h @@ -1094,8 +1094,8 @@ private: public: // Default properties - 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 + 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 mSize; ///< Size is provided for layouting AnimatableProperty mPosition; ///< Local transform; distance between parent-origin & anchor-point -- 2.7.4