From: Seoyeon Kim Date: Mon, 27 Mar 2017 01:38:36 +0000 (+0900) Subject: Merge branch 'devel/master' into tizen X-Git-Tag: accepted/tizen/common/20170327.143307^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5423c4b15c35798056e3f6a3af8d0275105e9517;hp=a604fd9e2f91864cce97555051c9b500b2a09344;p=platform%2Fcore%2Fuifw%2Fdali-core.git Merge branch 'devel/master' into tizen Change-Id: I1f8e678f96f49ddde05e85cdbad1a357ef8ef100 --- diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index bcc2aca..9599c0c 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -979,6 +979,37 @@ int UtcDaliActorSetSizeIndividual(void) END_TEST; } +int UtcDaliActorSetSizeIndividual02(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); + Stage::GetCurrent().Add( actor ); + + Vector3 vector( 100.0f, 200.0f, 400.0f ); + DALI_TEST_CHECK( vector != actor.GetCurrentSize() ); + + actor.SetProperty( Actor::Property::SIZE_WIDTH, vector.width ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(), vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + actor.SetProperty( Actor::Property::SIZE_HEIGHT, vector.height ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(), vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + actor.SetProperty( Actor::Property::SIZE_DEPTH, vector.depth ); + DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(), vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + // flush the queue and render once + application.SendNotification(); + application.Render(); + + // Check the width in the new frame + DALI_TEST_EQUALS( vector.width, actor.GetCurrentSize().width, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.height, actor.GetCurrentSize().height, TEST_LOCATION ); + + END_TEST; +} + int UtcDaliActorGetCurrentSize(void) { @@ -1040,7 +1071,7 @@ int UtcDaliActorGetCurrentSizeImmediate(void) const Vector3 targetValue( 10.0f, 20.0f, 30.0f ); animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetValue ); - DALI_TEST_CHECK( actor.GetTargetSize() == targetValue ); + DALI_TEST_CHECK( actor.GetTargetSize() == vector ); // Start the animation animation.Play(); diff --git a/automated-tests/src/dali/utc-Dali-Animation.cpp b/automated-tests/src/dali/utc-Dali-Animation.cpp index 8e617de..0f35aa8 100644 --- a/automated-tests/src/dali/utc-Dali-Animation.cpp +++ b/automated-tests/src/dali/utc-Dali-Animation.cpp @@ -10141,3 +10141,251 @@ int UtcDaliAnimationAnimateBetweenNonAnimateableTypeN(void) END_TEST; } + +int UtcDaliAnimationSetAndGetTargetBeforePlayP(void) +{ + tet_infoline("Setting up an animation should not effect it's position property until the animation plays"); + + TestApplication application; + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialPosition(0.0f, 0.0f, 0.0f); + actor.SetProperty( Actor::Property::POSITION, initialPosition ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + //Test GetCurrentProgress return 0.0 as the duration is 0.0 + DALI_TEST_EQUALS( 0.0f, animation.GetCurrentProgress(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.0f, 0.0f, 0.0f ), actor.GetCurrentPosition(), TEST_LOCATION ); + + tet_infoline("Set target position in animation without intiating play"); + + Vector3 targetPosition(100.0f, 100.0f, 100.0f); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR); + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial value"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), initialPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), initialPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), initialPosition.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position is now target"); + + animation.Play(); + application.SendNotification(); + application.Render(1000u); + + tet_infoline("Ensure position of actor is at target value when aninmation half way"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPosition.z, TEST_LOCATION ); + + tet_printf( "x position at half way point(%f)\n", actor.GetCurrentPosition().x ); + + application.Render(2000u); + + tet_infoline("Ensure position of actor is still at target value when aninmation complete"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPosition.z, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsPositionP(void) +{ + tet_infoline("Setting up an animation should not effect it's position property until the animation plays even with mulitple animators"); + + TestApplication application; + + std::vector targetPositions; + + targetPositions.push_back( Vector3( 100.0f, 100.0f, 100.0f ) ); + targetPositions.push_back( Vector3( 200.0f, 1.0f, 100.0f ) ); + targetPositions.push_back( Vector3( 50.0f, 10.0f, 100.0f ) ); + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialPosition(0.0f, 0.0f, 0.0f); + actor.SetProperty( Actor::Property::POSITION, initialPosition ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + //Test GetCurrentProgress return 0.0 as the duration is 0.0 + DALI_TEST_EQUALS( 0.0f, animation.GetCurrentProgress(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.0f, 0.0f, 0.0f ), actor.GetCurrentPosition(), TEST_LOCATION ); + + tet_infoline("Set target position in animation without intiating play"); + + for ( unsigned int i = 0; i < targetPositions.size(); i++ ) + { + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPositions[i], AlphaFunction::LINEAR); + } + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial value"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), initialPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), initialPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), initialPosition.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position is now target"); + + animation.Play(); + application.SendNotification(); + application.Render(1000u); + + tet_infoline("Ensure position of actor is at target value when aninmation half way"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPositions[2].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPositions[2].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPositions[2].z, TEST_LOCATION ); + + tet_printf( "x position at half way point(%f)\n", actor.GetCurrentPosition().x ); + + application.Render(2000u); + + tet_infoline("Ensure position of actor is still at target value when aninmation complete"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPositions[2].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPositions[2].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPositions[2].z, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionP(void) +{ + tet_infoline("Setting up an animation should not effect it's size property until the animation plays even with mulitple animators of different Property Indexes"); + + TestApplication application; + + std::vector targetSizes; + std::vector targetPositions; + + targetSizes.push_back( Vector3( 100.0f, 100.0f, 100.0f ) ); + targetSizes.push_back( Vector3( 50.0f, 10.0f, 100.0f ) ); + + targetPositions.push_back( Vector3( 200.0f, 1.0f, 100.0f ) ); + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialSize( 10.0f, 10.0f, 10.0f); + Vector3 initialPosition(10.0f, 10.0f, 10.0f); + + actor.SetProperty( Actor::Property::SIZE, initialSize ); + actor.SetProperty( Actor::Property::POSITION, initialPosition ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + tet_infoline("Set target size in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR); + tet_infoline("Set target position in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPositions[0], AlphaFunction::LINEAR); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[1], AlphaFunction::LINEAR); + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial size and position"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), initialSize.z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), initialPosition.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), initialPosition.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), initialPosition.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position and size is now matches targets"); + + animation.Play(); + application.SendNotification(); + application.Render(2000u); + + tet_infoline("Ensure position and size of actor is at target value when aninmation playing"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), targetSizes[1].z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_X), targetPositions[0].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Y), targetPositions[0].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::POSITION_Z), targetPositions[0].z, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionColourP(void) +{ + tet_infoline("Setting up an animation should not effect it's size property until the animation plays even if other Properties animated"); + + TestApplication application; + + std::vector targetSizes; + std::vector targetColors; + + targetSizes.push_back( Vector3( 100.0f, 100.0f, 100.0f ) ); + targetSizes.push_back( Vector3( 50.0f, 10.0f, 150.0f ) ); + + targetColors.push_back( 1.0f ); + + tet_infoline("Set initial position and set up animation to re-position actor"); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add(actor); + Vector3 initialSize( 10.0f, 5.0f, 10.0f); + + actor.SetProperty( Actor::Property::SIZE, initialSize ); + + // Build the animation + Animation animation = Animation::New(2.0f); + + tet_infoline("Set target size in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR); + tet_infoline("Set target position in animation without intiating play"); + animation.AnimateTo(Property(actor, Actor::Property::COLOR_RED), targetColors[0], AlphaFunction::LINEAR); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[1], AlphaFunction::LINEAR); + + application.SendNotification(); + application.Render(); + + tet_infoline("Ensure position of actor is still at intial size and position"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), initialSize.z, TEST_LOCATION ); + + tet_infoline("Play animation and ensure actor position and size is now matches targets"); + + animation.Play(); + application.SendNotification(); + application.Render(2000u); + + tet_infoline("Ensure position and size of actor is at target value when aninmation playing"); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::SIZE_DEPTH), targetSizes[1].z, TEST_LOCATION ); + + DALI_TEST_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), targetColors[0], TEST_LOCATION ); + + END_TEST; +} diff --git a/automated-tests/src/dali/utc-Dali-CustomActor.cpp b/automated-tests/src/dali/utc-Dali-CustomActor.cpp index c8dbb97..db7fca7 100644 --- a/automated-tests/src/dali/utc-Dali-CustomActor.cpp +++ b/automated-tests/src/dali/utc-Dali-CustomActor.cpp @@ -876,6 +876,11 @@ int UtcDaliCustomActorOnSizeAnimation(void) Animation anim = Animation::New( 1.0f ); anim.AnimateTo( Property( custom, Actor::Property::SIZE ), Vector3( 8.0f, 9.0f, 10.0f ) ); + anim.Play(); + + application.SendNotification(); + application.Render( static_cast( 1000.0f ) ); + DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION ); DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION ); DALI_TEST_EQUALS( 8.0f, custom.GetTargetSize().width, TEST_LOCATION ); @@ -884,6 +889,38 @@ int UtcDaliCustomActorOnSizeAnimation(void) END_TEST; } +int UtcDaliCustomActorSizeComponentAnimation(void) +{ + TestApplication application; + tet_infoline("Testing Size component animation"); + + Test::TestCustomActor custom = Test::TestCustomActor::New(); + float intialWidth( 10.0f ); + + DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION ); + custom.SetSize( intialWidth, 10.0f); // First method + + Animation anim = Animation::New( 1.0f ); + + DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION ); + + anim.AnimateTo( Property( custom, Actor::Property::SIZE_WIDTH ), 20.0f ); + + DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION ); + + anim.Play(); // Triggers second method ( OnSizeAnimation ) + + application.SendNotification(); + application.Render( static_cast( 1000.0f ) ); + + DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION ); + + DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION ); + + END_TEST; + +} + int UtcDaliCustomActorOnTouchEvent(void) { TestApplication application; diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index a9eddf4..9a3d3d7 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -1286,24 +1286,44 @@ void Actor::NotifyPositionAnimation( Animation& animation, float targetPosition, void Actor::SetWidth( float width ) { - mTargetSize.width = width; - - if( NULL != mNode ) + if( IsRelayoutEnabled() && !mRelayoutData->insideRelayout ) { - // mNode is being used in a separate thread; queue a message to set the value & base value - SceneGraph::NodeTransformComponentMessage::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler::BakeX, width ); + SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH ); + mRelayoutData->preferredSize.width = width; + } + else + { + mTargetSize.width = width; + + if( NULL != mNode ) + { + // mNode is being used in a separate thread; queue a message to set the value & base value + SceneGraph::NodeTransformComponentMessage::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler::BakeX, width ); + } } + + RelayoutRequest(); } void Actor::SetHeight( float height ) { - mTargetSize.height = height; - - if( NULL != mNode ) + if( IsRelayoutEnabled() && !mRelayoutData->insideRelayout ) { - // mNode is being used in a separate thread; queue a message to set the value & base value - SceneGraph::NodeTransformComponentMessage::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler::BakeY, height ); + SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT ); + mRelayoutData->preferredSize.height = height; + } + else + { + mTargetSize.height = height; + + if( NULL != mNode ) + { + // mNode is being used in a separate thread; queue a message to set the value & base value + SceneGraph::NodeTransformComponentMessage::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler::BakeY, height ); + } } + + RelayoutRequest(); } void Actor::SetDepth( float depth ) diff --git a/dali/internal/event/animation/animation-impl.cpp b/dali/internal/event/animation/animation-impl.cpp index ec1a6ca..c09c4b1 100644 --- a/dali/internal/event/animation/animation-impl.cpp +++ b/dali/internal/event/animation/animation-impl.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include using Dali::Internal::SceneGraph::UpdateManager; @@ -266,6 +267,77 @@ void Animation::Play() mState = Dali::Animation::PLAYING; + unsigned int connectorTargetValuesIndex( 0 ); + unsigned int numberOfConnectorTargetValues = mConnectorActorTargetValues.size(); + + /* + * Loop through all Animator connectors, if connector index matches the current index stored in mConnectorActorTargetValues container then + * should apply target values for this index to the Actor. + * Confirm object is an actor and it is a POSITION or SIZE Property Index before sending Notify message to Actor. + */ + for ( unsigned int connectorIndex = 0; connectorIndex < mConnectors.Count(); connectorIndex ++) + { + // Use index to check if the current connector is next in the mConnectorActorTargetValues container, meaning targetValues have been pushed in AnimateXXFunction + if ( connectorTargetValuesIndex < numberOfConnectorTargetValues ) + { + ConnectorTargetValues& connectorPair = mConnectorActorTargetValues[ connectorTargetValuesIndex ]; + + if ( connectorPair.connectorIndex == connectorIndex ) + { + // Current connector index matches next in the stored connectors with target values so apply target value. + connectorTargetValuesIndex++; // Found a match for connector so increment index to next one + + AnimatorConnectorBase* connector = mConnectors[ connectorIndex ]; + + Actor* maybeActor = static_cast( connector->GetObject() ); // Only Actors would be in mConnectorActorTargetValues container + + if ( maybeActor ) + { + // Get Stored Target Value and corresponding connector index + const Property::Type valueType = connectorPair.targetValue.GetType(); + Property::Index propertyIndex = connector->GetPropertyIndex(); + + if ( valueType == Property::VECTOR3 ) + { + Vector3 targetVector3 = connectorPair.targetValue.Get(); + + if ( propertyIndex == Dali::Actor::Property::POSITION ) + { + maybeActor->NotifyPositionAnimation( *this, targetVector3 ); + } + else if ( propertyIndex == Dali::Actor::Property::SIZE ) + { + maybeActor->NotifySizeAnimation( *this, targetVector3 ); + } + } + else if ( valueType == Property::FLOAT ) + { + float targetFloat = connectorPair.targetValue.Get(); + + if ( ( Dali::Actor::Property::POSITION_X == propertyIndex ) || + ( Dali::Actor::Property::POSITION_Y == propertyIndex ) || + ( Dali::Actor::Property::POSITION_Z == propertyIndex ) ) + { + maybeActor->NotifyPositionAnimation( *this, targetFloat, propertyIndex ); + } + else if ( ( Dali::Actor::Property::SIZE_WIDTH == propertyIndex ) || + ( Dali::Actor::Property::SIZE_HEIGHT == propertyIndex ) || + ( Dali::Actor::Property::SIZE_DEPTH == propertyIndex ) ) + + { + maybeActor->NotifySizeAnimation( *this, targetFloat, propertyIndex ); + } + } + else + { + // Currently only FLOAT and VECTOR3 is supported for Target values in AnimateXXFunctions + DALI_LOG_WARNING("Animation::Play Unsupported Value Type provided as TargetValue\n"); + } + } + } + } + } + // mAnimation is being used in a separate thread; queue a Play message PlayAnimationMessage( mEventThreadServices, *mAnimation ); } @@ -502,26 +574,21 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn { if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex ) || ( Dali::Actor::Property::SIZE_HEIGHT == targetPropertyIndex ) || - ( Dali::Actor::Property::SIZE_DEPTH == targetPropertyIndex ) ) + ( Dali::Actor::Property::SIZE_DEPTH == targetPropertyIndex ) || + ( Dali::Actor::Property::POSITION_X == targetPropertyIndex ) || + ( Dali::Actor::Property::POSITION_Y == targetPropertyIndex ) || + ( Dali::Actor::Property::POSITION_Z == targetPropertyIndex ) ) { - // Test whether this is actually an Actor - Actor* maybeActor = dynamic_cast( &targetObject ); - if ( maybeActor ) - { - // Notify the actor that its size is being animated - maybeActor->NotifySizeAnimation( *this, destinationValue.Get(), targetPropertyIndex ); - } - } - else if ( ( Dali::Actor::Property::POSITION_X == targetPropertyIndex ) || - ( Dali::Actor::Property::POSITION_Y == targetPropertyIndex ) || - ( Dali::Actor::Property::POSITION_Z == targetPropertyIndex ) ) - { - // Test whether this is actually an Actor + Actor* maybeActor = dynamic_cast( &targetObject ); if ( maybeActor ) { - // Notify the actor that its position is being animated - maybeActor->NotifyPositionAnimation( *this, destinationValue.Get(), targetPropertyIndex ); + // Store data to later notify the actor that its size or position is being animated + ConnectorTargetValues connectorPair; + connectorPair.targetValue = destinationValue; + connectorPair.connectorIndex = mConnectors.Count(); + + mConnectorActorTargetValues.push_back( connectorPair ); } } @@ -547,24 +614,18 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn case Property::VECTOR3: { - if ( Dali::Actor::Property::SIZE == targetPropertyIndex ) + if ( Dali::Actor::Property::SIZE == targetPropertyIndex || Dali::Actor::Property::POSITION == targetPropertyIndex ) { // Test whether this is actually an Actor Actor* maybeActor = dynamic_cast( &targetObject ); if ( maybeActor ) { - // Notify the actor that its size is being animated - maybeActor->NotifySizeAnimation( *this, destinationValue.Get() ); - } - } - else if ( Dali::Actor::Property::POSITION == targetPropertyIndex ) - { - // Test whether this is actually an Actor - Actor* maybeActor = dynamic_cast( &targetObject ); - if ( maybeActor ) - { - // Notify the actor that its position is being animated - maybeActor->NotifyPositionAnimation( *this, destinationValue.Get() ); + // Store data to later notify the actor that its size or position is being animated + ConnectorTargetValues connectorPair; + connectorPair.targetValue = destinationValue; + connectorPair.connectorIndex = mConnectors.Count(); + + mConnectorActorTargetValues.push_back( connectorPair ); } } diff --git a/dali/internal/event/animation/animation-impl.h b/dali/internal/event/animation/animation-impl.h index 24dc3ff..7239ed4 100644 --- a/dali/internal/event/animation/animation-impl.h +++ b/dali/internal/event/animation/animation-impl.h @@ -448,6 +448,13 @@ private: Animation& operator=(const Animation& rhs); private: + + struct ConnectorTargetValues + { + unsigned int connectorIndex; + Property::Value targetValue; + }; + EventThreadServices& mEventThreadServices; AnimationPlaylist& mPlaylist; @@ -462,6 +469,8 @@ private: AnimatorConnectorContainer mConnectors; ///< Owned by the Animation + std::vector< ConnectorTargetValues > mConnectorActorTargetValues; //< Store Actor target values and matchinf connector index that need to set value on Animation::Play + // Cached for public getters float mDurationSeconds; float mSpeedFactor; diff --git a/dali/internal/event/animation/animator-connector-base.h b/dali/internal/event/animation/animator-connector-base.h index 5a54bc8..8ab2a8c 100644 --- a/dali/internal/event/animation/animator-connector-base.h +++ b/dali/internal/event/animation/animator-connector-base.h @@ -89,7 +89,7 @@ public: * Retrieve the parent of the AnimatorConnector. * @return The parent object, or NULL. */ - Animation* GetParent() + Animation* GetParent() const { return mParent; } diff --git a/dali/public-api/dali-core-version.cpp b/dali/public-api/dali-core-version.cpp index 33988a2..5a26bb3 100644 --- a/dali/public-api/dali-core-version.cpp +++ b/dali/public-api/dali-core-version.cpp @@ -28,7 +28,7 @@ namespace Dali const unsigned int CORE_MAJOR_VERSION = 1; const unsigned int CORE_MINOR_VERSION = 2; -const unsigned int CORE_MICRO_VERSION = 31; +const unsigned int CORE_MICRO_VERSION = 32; const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__; #ifndef EMSCRIPTEN diff --git a/packaging/dali.spec b/packaging/dali.spec index 197abca..1b5bb1c 100644 --- a/packaging/dali.spec +++ b/packaging/dali.spec @@ -1,6 +1,6 @@ Name: dali Summary: The OpenGLES Canvas Core Library -Version: 1.2.31 +Version: 1.2.32 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-2-Clause and MIT