From ed46283c44321b206a1e81fb209da04d48aa4c3f Mon Sep 17 00:00:00 2001 From: "Jinho, Lee" Date: Tue, 30 May 2017 16:15:57 +0900 Subject: [PATCH] Revert "[Tizen] (Animation) Ensure AnimateBy updates the cached event-side properties" This reverts commit 135e1701cb53a90dd229c033f19f8d8b1bbee6ed. Change-Id: I78aed48072c09dacd6a4549c230f00a358e88789 --- automated-tests/src/dali/utc-Dali-Animation.cpp | 27 -- dali/internal/event/actors/actor-impl.cpp | 384 ++++++--------------- dali/internal/event/actors/actor-impl.h | 2 +- dali/internal/event/animation/animation-impl.cpp | 11 +- dali/internal/event/animation/animation-impl.h | 5 +- dali/internal/event/common/object-impl.cpp | 38 +- dali/internal/event/common/object-impl.h | 18 +- dali/internal/event/common/property-metadata.cpp | 158 --------- dali/internal/event/common/property-metadata.h | 6 - .../event/render-tasks/render-task-impl.cpp | 79 +---- .../internal/event/render-tasks/render-task-impl.h | 2 +- 11 files changed, 139 insertions(+), 591 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-Animation.cpp b/automated-tests/src/dali/utc-Dali-Animation.cpp index 3789489..980c108 100644 --- a/automated-tests/src/dali/utc-Dali-Animation.cpp +++ b/automated-tests/src/dali/utc-Dali-Animation.cpp @@ -2806,9 +2806,6 @@ int UtcDaliAnimationAnimateByBooleanP(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< bool >( index ), finalValue, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3102,9 +3099,6 @@ int UtcDaliAnimationAnimateByFloatP(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3339,9 +3333,6 @@ int UtcDaliAnimationAnimateByIntegerP(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< int >( index ), targetValue, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3576,9 +3567,6 @@ int UtcDaliAnimationAnimateByVector2P(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -3814,9 +3802,6 @@ int UtcDaliAnimationAnimateByVector3P(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4053,9 +4038,6 @@ int UtcDaliAnimationAnimateByVector4P(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4292,9 +4274,6 @@ int UtcDaliAnimationAnimateByActorPositionP(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4510,9 +4489,6 @@ int UtcDaliAnimationAnimateByActorOrientationP1(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(relativeRotationRadians, Vector3::YAXIS), TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); @@ -4815,9 +4791,6 @@ int UtcDaliAnimationAnimateByActorScaleP(void) // Start the animation animation.Play(); - // Target value should be retrievable straight away - DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION ); - bool signalReceived(false); AnimationFinishCheck finishCheck(signalReceived); animation.FinishedSignal().Connect(&application, finishCheck); diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index c6a3efe..8df598e 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -416,20 +416,6 @@ void EmitVisibilityChangedSignalRecursively( ActorPtr actor, bool visible, Devel } } -/// Helper to adjust the current value of a variable from the given property-value -/// Returns true if value adjusted, false otherwise -template< typename PropertyType > -inline bool AdjustValue( PropertyType& currentValue, const Property::Value& value ) -{ - PropertyType relativeValue; - if( value.Get( relativeValue ) ) - { - currentValue += relativeValue; - return true; - } - return false; -} - } // unnamed namespace ActorPtr Actor::New() @@ -3256,299 +3242,145 @@ Property::Value Actor::GetDefaultPropertyCurrentValue( Property::Index index ) c return value; } -void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ) +void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ) { - if( propertyChangeType == Object::PropertyChange::SET ) + switch( index ) { - switch( index ) + case Dali::Actor::Property::SIZE: { - case Dali::Actor::Property::SIZE: - { - if( value.Get( mTargetSize ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; - } - - case Dali::Actor::Property::SIZE_WIDTH: - { - if( value.Get( mTargetSize.width ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; - } - - case Dali::Actor::Property::SIZE_HEIGHT: - { - if( value.Get( mTargetSize.height ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; - } - - case Dali::Actor::Property::SIZE_DEPTH: - { - if( value.Get( mTargetSize.depth ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; - } - - case Dali::Actor::Property::POSITION: - { - value.Get( mTargetPosition ); - break; - } - - case Dali::Actor::Property::POSITION_X: - { - value.Get( mTargetPosition.x ); - break; - } - - case Dali::Actor::Property::POSITION_Y: - { - value.Get( mTargetPosition.y ); - break; - } - - case Dali::Actor::Property::POSITION_Z: - { - value.Get( mTargetPosition.z ); - break; - } - - case Dali::Actor::Property::ORIENTATION: - { - value.Get( mTargetOrientation ); - break; - } - - case Dali::Actor::Property::SCALE: - { - value.Get( mTargetScale ); - break; - } - - case Dali::Actor::Property::SCALE_X: - { - value.Get( mTargetScale.x ); - break; - } - - case Dali::Actor::Property::SCALE_Y: - { - value.Get( mTargetScale.y ); - break; - } - - case Dali::Actor::Property::SCALE_Z: - { - value.Get( mTargetScale.z ); - break; - } - - case Dali::Actor::Property::VISIBLE: - { - SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE ); - break; - } - - case Dali::Actor::Property::COLOR: - { - value.Get( mTargetColor ); - break; - } - - case Dali::Actor::Property::COLOR_RED: - { - value.Get( mTargetColor.r ); - break; - } - - case Dali::Actor::Property::COLOR_GREEN: + if( value.Get( mTargetSize ) ) { - value.Get( mTargetColor.g ); - break; - } - - case Dali::Actor::Property::COLOR_BLUE: - { - value.Get( mTargetColor.b ); - break; - } - - case Dali::Actor::Property::COLOR_ALPHA: - case Dali::DevelActor::Property::OPACITY: - { - value.Get( mTargetColor.a ); - break; - } - - default: - { - // Not an animatable property. Do nothing. - break; + // Notify deriving classes + OnSizeAnimation( animation, mTargetSize ); } + break; } - } - else - { - switch( index ) - { - case Dali::Actor::Property::SIZE: - { - if( AdjustValue< Vector3 >( mTargetSize, value ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; - } - case Dali::Actor::Property::SIZE_WIDTH: + case Dali::Actor::Property::SIZE_WIDTH: + { + if( value.Get( mTargetSize.width ) ) { - if( AdjustValue< float >( mTargetSize.width, value ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; + // Notify deriving classes + OnSizeAnimation( animation, mTargetSize ); } + break; + } - case Dali::Actor::Property::SIZE_HEIGHT: + case Dali::Actor::Property::SIZE_HEIGHT: + { + if( value.Get( mTargetSize.height ) ) { - if( AdjustValue< float >( mTargetSize.height, value ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; + // Notify deriving classes + OnSizeAnimation( animation, mTargetSize ); } + break; + } - case Dali::Actor::Property::SIZE_DEPTH: + case Dali::Actor::Property::SIZE_DEPTH: + { + if( value.Get( mTargetSize.depth ) ) { - if( AdjustValue< float >( mTargetSize.depth, value ) ) - { - // Notify deriving classes - OnSizeAnimation( animation, mTargetSize ); - } - break; + // Notify deriving classes + OnSizeAnimation( animation, mTargetSize ); } + break; + } - case Dali::Actor::Property::POSITION: - { - AdjustValue< Vector3 >( mTargetPosition, value ); - break; - } + case Dali::Actor::Property::POSITION: + { + value.Get( mTargetPosition ); + break; + } - case Dali::Actor::Property::POSITION_X: - { - AdjustValue< float >( mTargetPosition.x, value ); - break; - } + case Dali::Actor::Property::POSITION_X: + { + value.Get( mTargetPosition.x ); + break; + } - case Dali::Actor::Property::POSITION_Y: - { - AdjustValue< float >( mTargetPosition.y, value ); - break; - } + case Dali::Actor::Property::POSITION_Y: + { + value.Get( mTargetPosition.y ); + break; + } - case Dali::Actor::Property::POSITION_Z: - { - AdjustValue< float >( mTargetPosition.z, value ); - break; - } + case Dali::Actor::Property::POSITION_Z: + { + value.Get( mTargetPosition.z ); + break; + } - case Dali::Actor::Property::ORIENTATION: - { - Quaternion relativeValue; - if( value.Get( relativeValue ) ) - { - mTargetOrientation *= relativeValue; - } - break; - } + case Dali::Actor::Property::ORIENTATION: + { + value.Get( mTargetOrientation ); + break; + } - case Dali::Actor::Property::SCALE: - { - AdjustValue< Vector3 >( mTargetScale, value ); - break; - } + case Dali::Actor::Property::SCALE: + { + value.Get( mTargetScale ); + break; + } - case Dali::Actor::Property::SCALE_X: - { - AdjustValue< float >( mTargetScale.x, value ); - break; - } + case Dali::Actor::Property::SCALE_X: + { + value.Get( mTargetScale.x ); + break; + } - case Dali::Actor::Property::SCALE_Y: - { - AdjustValue< float >( mTargetScale.y, value ); - break; - } + case Dali::Actor::Property::SCALE_Y: + { + value.Get( mTargetScale.y ); + break; + } - case Dali::Actor::Property::SCALE_Z: - { - AdjustValue< float >( mTargetScale.z, value ); - break; - } + case Dali::Actor::Property::SCALE_Z: + { + value.Get( mTargetScale.z ); + break; + } - case Dali::Actor::Property::VISIBLE: - { - bool relativeValue = false; - if( value.Get( relativeValue ) ) - { - bool visible = mVisible || relativeValue; - SetVisibleInternal( visible, SendMessage::FALSE ); - } - break; - } + case Dali::Actor::Property::VISIBLE: + { + SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE ); + break; + } - case Dali::Actor::Property::COLOR: - { - AdjustValue< Vector4 >( mTargetColor, value ); - break; - } + case Dali::Actor::Property::COLOR: + { + value.Get( mTargetColor ); + break; + } - case Dali::Actor::Property::COLOR_RED: - { - AdjustValue< float >( mTargetColor.r, value ); - break; - } + case Dali::Actor::Property::COLOR_RED: + { + value.Get( mTargetColor.r ); + break; + } - case Dali::Actor::Property::COLOR_GREEN: - { - AdjustValue< float >( mTargetColor.g, value ); - break; - } + case Dali::Actor::Property::COLOR_GREEN: + { + value.Get( mTargetColor.g ); + break; + } - case Dali::Actor::Property::COLOR_BLUE: - { - AdjustValue< float >( mTargetColor.b, value ); - break; - } + case Dali::Actor::Property::COLOR_BLUE: + { + value.Get( mTargetColor.b ); + break; + } - case Dali::Actor::Property::COLOR_ALPHA: - case Dali::DevelActor::Property::OPACITY: - { - AdjustValue< float >( mTargetColor.a, value ); - break; - } + case Dali::Actor::Property::COLOR_ALPHA: + case Dali::DevelActor::Property::OPACITY: + { + value.Get( mTargetColor.a ); + break; + } - default: - { - // Not an animatable property. Do nothing. - break; - } + default: + { + // Not an animatable property. Do nothing. + break; } } } diff --git a/dali/internal/event/actors/actor-impl.h b/dali/internal/event/actors/actor-impl.h index 51906d5..59e23d0 100644 --- a/dali/internal/event/actors/actor-impl.h +++ b/dali/internal/event/actors/actor-impl.h @@ -1656,7 +1656,7 @@ public: /** * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation() */ - virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ); + virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ); /** * @copydoc Dali::Internal::Object::GetPropertyOwner() diff --git a/dali/internal/event/animation/animation-impl.cpp b/dali/internal/event/animation/animation-impl.cpp index 2b0bf2e..2191e2a 100644 --- a/dali/internal/event/animation/animation-impl.cpp +++ b/dali/internal/event/animation/animation-impl.cpp @@ -281,7 +281,7 @@ void Animation::Play() Object* object = connector->GetObject(); if( object ) { - object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue, iter->propertyChangeType ); + object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue ); } } } @@ -370,14 +370,6 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph ExtendDuration( period ); - // Store data to later notify the object that its property is being animated - ConnectorTargetValues connectorPair; - connectorPair.targetValue = relativeValue; - connectorPair.connectorIndex = mConnectors.Count(); - connectorPair.timePeriod = period; - connectorPair.propertyChangeType = Object::PropertyChange::ADJUST_VALUE_BY; - mConnectorTargetValues.push_back( connectorPair ); - switch ( targetType ) { case Property::BOOLEAN: @@ -510,7 +502,6 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn connectorPair.targetValue = destinationValue; connectorPair.connectorIndex = mConnectors.Count(); connectorPair.timePeriod = period; - connectorPair.propertyChangeType = Object::PropertyChange::SET; mConnectorTargetValues.push_back( connectorPair ); switch ( destinationType ) diff --git a/dali/internal/event/animation/animation-impl.h b/dali/internal/event/animation/animation-impl.h index 6a3d6c2..92dff74 100644 --- a/dali/internal/event/animation/animation-impl.h +++ b/dali/internal/event/animation/animation-impl.h @@ -26,7 +26,6 @@ #include #include #include -#include namespace Dali { @@ -446,15 +445,13 @@ private: ConnectorTargetValues() : targetValue(), timePeriod( 0.0f ), - connectorIndex( 0 ), - propertyChangeType( Object::PropertyChange::SET ) + connectorIndex( 0 ) { } Property::Value targetValue; TimePeriod timePeriod; unsigned int connectorIndex; - Object::PropertyChange::Type propertyChangeType; }; private: diff --git a/dali/internal/event/common/object-impl.cpp b/dali/internal/event/common/object-impl.cpp index 0e7b77e..344e72c 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -924,32 +924,19 @@ void Object::RemovePropertyNotifications() } } -void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ) +void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ) { if ( index < DEFAULT_PROPERTY_MAX_COUNT ) { - OnNotifyDefaultPropertyAnimation( animation, index, value, propertyChangeType ); + OnNotifyDefaultPropertyAnimation( animation, index, value ); } else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) ) { AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index ); if( animatableProperty ) { - switch( propertyChangeType ) - { - case PropertyChange::SET: - { - // update the cached property value - animatableProperty->SetPropertyValue( value ); - break; - } - case PropertyChange::ADJUST_VALUE_BY: - { - // adjust the cached property value - animatableProperty->AdjustPropertyValueBy( value ); - break; - } - } + // update the cached property value + animatableProperty->SetPropertyValue( value ); } } else @@ -957,21 +944,8 @@ void Object::NotifyPropertyAnimation( Animation& animation, Property::Index inde CustomPropertyMetadata* custom = FindCustomProperty( index ); if( custom && custom->IsAnimatable() ) { - switch( propertyChangeType ) - { - case PropertyChange::SET: - { - // update the cached property value - custom->SetPropertyValue( value ); - break; - } - case PropertyChange::ADJUST_VALUE_BY: - { - // adjust the cached property value - custom->AdjustPropertyValueBy( value ); - break; - } - } + // update the cached property value + custom->SetPropertyValue( value ); } } } diff --git a/dali/internal/event/common/object-impl.h b/dali/internal/event/common/object-impl.h index f38f03b..035e7ee 100644 --- a/dali/internal/event/common/object-impl.h +++ b/dali/internal/event/common/object-impl.h @@ -81,18 +81,6 @@ class Object : public Dali::BaseObject { public: - /** - * Used by NotifyPropertyAnimation to differentiate between an AnimateTo and AnimateBy call. - */ - struct PropertyChange - { - enum Type - { - SET, ///< Animating to the given value. - ADJUST_VALUE_BY ///< Animating by the given value. - }; - }; - typedef Dali::Handle::Capability Capability; class Observer @@ -257,9 +245,8 @@ public: * @param[in] animation The animation animating the property. * @param[in] index The index of the property. * @param[in] value The value of the property after the animation. - * @param[in] propertyChangeType Whether the property value given should be set or changed by. */ - void NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ); + void NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ); /******************************** Uniform Mappings ********************************/ @@ -505,9 +492,8 @@ private: // Default property extensions for derived classes * @param[in] animation The animation animating the property. * @param[in] index The index of the property. * @param[in] value The value of the property after the animation. - * @param[in] propertyChangeType Whether the property value given should be set or changed by. */ - virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ) + virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ) { } /** diff --git a/dali/internal/event/common/property-metadata.cpp b/dali/internal/event/common/property-metadata.cpp index d233e7e..abbe62e 100644 --- a/dali/internal/event/common/property-metadata.cpp +++ b/dali/internal/event/common/property-metadata.cpp @@ -19,7 +19,6 @@ #include // INTERNAL INCLUDES -#include #include #include #include @@ -31,23 +30,6 @@ namespace Dali namespace Internal { -namespace -{ - -/// Helper to adjust the property value by an amount specified in another property-value -template < typename PropertyType > -inline void AdjustProperty( Property::Value& currentPropertyValue, const Property::Value& relativePropertyValue ) -{ - PropertyType currentValue; - PropertyType relativeValue; - if( currentPropertyValue.Get( currentValue ) && relativePropertyValue.Get( relativeValue ) ) - { - currentPropertyValue = currentValue + relativeValue; - } -} - -} // unnamed namespace - void PropertyMetadata::SetPropertyValue( const Property::Value& propertyValue ) { switch ( GetType() ) @@ -253,146 +235,6 @@ Property::Value PropertyMetadata::GetPropertyValue() const return propertyValue; } -void PropertyMetadata::AdjustPropertyValueBy( const Property::Value& relativePropertyValue ) -{ - switch ( GetType() ) - { - case Property::NONE: - case Property::RECTANGLE: - case Property::STRING: - case Property::ARRAY: - case Property::MAP: - case Property::MATRIX: - case Property::MATRIX3: - { - // Not animated - break; - } - - case Property::BOOLEAN: - { - bool currentValue = false; - bool relativeValue = false; - if( value.Get( currentValue ) && relativePropertyValue.Get( relativeValue ) ) - { - value = currentValue || relativeValue; - } - break; - } - - case Property::INTEGER: - { - AdjustProperty< int >( value, relativePropertyValue ); - break; - } - - case Property::FLOAT: - { - AdjustProperty< float >( value, relativePropertyValue ); - break; - } - - case Property::ROTATION: - { - Quaternion currentValue; - Quaternion relativeValue; - if( value.Get( currentValue ) && relativePropertyValue.Get( relativeValue ) ) - { - value = currentValue * relativeValue; - } - break; - } - - case Property::VECTOR2: - { - if( componentIndex == Property::INVALID_COMPONENT_INDEX ) - { - AdjustProperty< Vector2 >( value, relativePropertyValue ); - } - else - { - Vector2 vector2Value; - value.Get( vector2Value ); - - if( componentIndex == 0 ) - { - vector2Value.x += relativePropertyValue.Get< float >(); - } - else if( componentIndex == 1 ) - { - vector2Value.y += relativePropertyValue.Get< float >(); - } - - value = vector2Value; - } - - break; - } - - case Property::VECTOR3: - { - if( componentIndex == Property::INVALID_COMPONENT_INDEX ) - { - AdjustProperty< Vector3 >( value, relativePropertyValue ); - } - else - { - Vector3 vector3Value; - value.Get( vector3Value ); - - if( componentIndex == 0 ) - { - vector3Value.x += relativePropertyValue.Get< float >(); - } - else if( componentIndex == 1 ) - { - vector3Value.y += relativePropertyValue.Get< float >(); - } - else if( componentIndex == 2 ) - { - vector3Value.z += relativePropertyValue.Get< float >(); - } - - value = vector3Value; - } - break; - } - - case Property::VECTOR4: - { - if( componentIndex == Property::INVALID_COMPONENT_INDEX ) - { - AdjustProperty< Vector4 >( value, relativePropertyValue ); - } - else - { - Vector4 vector4Value; - value.Get( vector4Value ); - - if( componentIndex == 0 ) - { - vector4Value.x = relativePropertyValue.Get< float >(); - } - else if( componentIndex == 1 ) - { - vector4Value.y = relativePropertyValue.Get< float >(); - } - else if( componentIndex == 2 ) - { - vector4Value.z = relativePropertyValue.Get< float >(); - } - else if( componentIndex == 3 ) - { - vector4Value.w = relativePropertyValue.Get< float >(); - } - - value = vector4Value; - } - break; - } - } -} - } // namespace Internal } // namespace Dali diff --git a/dali/internal/event/common/property-metadata.h b/dali/internal/event/common/property-metadata.h index b845eaa..a06f262 100644 --- a/dali/internal/event/common/property-metadata.h +++ b/dali/internal/event/common/property-metadata.h @@ -116,12 +116,6 @@ public: */ Property::Value GetPropertyValue() const; - /** - * Modifies the stored value by the relativeValue. - * @param[in] relativeValue The value to change by. - */ - void AdjustPropertyValueBy( const Property::Value& relativeValue ); - protected: /** diff --git a/dali/internal/event/render-tasks/render-task-impl.cpp b/dali/internal/event/render-tasks/render-task-impl.cpp index 556d994..a97069b 100644 --- a/dali/internal/event/render-tasks/render-task-impl.cpp +++ b/dali/internal/event/render-tasks/render-task-impl.cpp @@ -69,17 +69,6 @@ TypeRegistration mType( typeid( Dali::RenderTask ), typeid( Dali::BaseHandle ), SignalConnectorType signalConnector1( mType, SIGNAL_FINISHED, &RenderTask::DoConnectSignal ); -/// Helper to adjust the current value of a variable from the given property-value -template< typename PropertyType > -inline void AdjustValue( PropertyType& currentValue, const Property::Value& value ) -{ - PropertyType relativeValue; - if( value.Get( relativeValue ) ) - { - currentValue += relativeValue; - } -} - } // Unnamed namespace RenderTask* RenderTask::New( bool isSystemLevel ) @@ -700,60 +689,30 @@ Property::Value RenderTask::GetDefaultPropertyCurrentValue( Property::Index inde return value; } -void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ) +void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ) { - if( propertyChangeType == Object::PropertyChange::SET ) + switch ( index ) { - switch ( index ) + case Dali::RenderTask::Property::VIEWPORT_POSITION: { - case Dali::RenderTask::Property::VIEWPORT_POSITION: - { - value.Get( mViewportPosition ); - break; - } - case Dali::RenderTask::Property::VIEWPORT_SIZE: - { - value.Get( mViewportSize ); - break; - } - case Dali::RenderTask::Property::CLEAR_COLOR: - { - value.Get( mClearColor ); - break; - } - case Dali::RenderTask::Property::REQUIRES_SYNC: - default: - { - // Nothing to do as not animatable - break; - } + value.Get( mViewportPosition ); + break; } - } - else - { - switch ( index ) + case Dali::RenderTask::Property::VIEWPORT_SIZE: { - case Dali::RenderTask::Property::VIEWPORT_POSITION: - { - AdjustValue< Vector2 >( mViewportPosition, value ); - break; - } - case Dali::RenderTask::Property::VIEWPORT_SIZE: - { - AdjustValue< Vector2 >( mViewportSize, value ); - break; - } - case Dali::RenderTask::Property::CLEAR_COLOR: - { - AdjustValue< Vector4 >( mClearColor, value ); - break; - } - case Dali::RenderTask::Property::REQUIRES_SYNC: - default: - { - // Nothing to do as not animatable - break; - } + value.Get( mViewportSize ); + break; + } + case Dali::RenderTask::Property::CLEAR_COLOR: + { + value.Get( mClearColor ); + break; + } + case Dali::RenderTask::Property::REQUIRES_SYNC: + default: + { + // Nothing to do as not animatable + break; } } } diff --git a/dali/internal/event/render-tasks/render-task-impl.h b/dali/internal/event/render-tasks/render-task-impl.h index 13728ed..90d5cc3 100644 --- a/dali/internal/event/render-tasks/render-task-impl.h +++ b/dali/internal/event/render-tasks/render-task-impl.h @@ -325,7 +325,7 @@ public: // Implementation of Object /** * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation() */ - virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, PropertyChange::Type propertyChangeType ); + virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value ); /** * @copydoc Dali::Internal::Object::GetSceneObject() -- 2.7.4