Merge "Enable -Wnon-virtual-dtor to avoid incorrect C++ code sneaking in" into devel...
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 18 May 2017 10:25:28 +0000 (10:25 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 18 May 2017 10:25:28 +0000 (10:25 +0000)
17 files changed:
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-Constrainer.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
dali/integration-api/gl-defines.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/internal/event/common/object-impl.cpp
dali/internal/event/common/object-impl.h
dali/internal/event/render-tasks/render-task-impl.cpp
dali/internal/event/render-tasks/render-task-impl.h
dali/internal/render/renderers/render-frame-buffer.cpp
dali/internal/render/renderers/render-texture.h
dali/internal/render/shaders/program.cpp
dali/public-api/animation/animation.h

index f4a6071..4794369 100644 (file)
@@ -5960,6 +5960,7 @@ int utcDaliActorPositionUsesAnchorPointOnlyInheritPosition(void)
 
   END_TEST;
 }
+
 int utcDaliActorVisibilityChangeSignalSelf(void)
 {
   TestApplication application;
@@ -6042,4 +6043,43 @@ int utcDaliActorVisibilityChangeSignalChildren(void)
   childData.Check( false /* not called */, TEST_LOCATION );
   grandChildData.Check( false /* not called */, TEST_LOCATION );
 
-  END_TEST;}
+  END_TEST;
+}
+
+int utcDaliActorVisibilityChangeSignalAfterAnimation(void)
+{
+  TestApplication application;
+  tet_infoline( "Check that the visibility change signal is emitted when the visibility changes when an animation starts" );
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  VisibilityChangedFunctorData data;
+  DevelActor::VisibilityChangedSignal( actor ).Connect( &application, VisibilityChangedFunctor( data ) );
+
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateTo( Property( actor, Actor::Property::VISIBLE ), false );
+
+  data.Check( false, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( actor, Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
+  tet_infoline( "Play the animation and check the property value" );
+  animation.Play();
+
+  data.Check( true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+  tet_infoline( "Animation not currently finished, so the current visibility should still be true" );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( actor, Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render( 1100 ); // After the animation
+
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( actor, Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+  END_TEST;
+}
index 36fb592..2a46bf5 100644 (file)
@@ -5781,10 +5781,11 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionTimePeriodP(void)
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
 
-  // We didn't expect the animation to finish yet
+  // We didn't expect the animation to finish yet, but cached value should be the final one
   application.SendNotification();
   finishCheck.CheckSignalNotReceived();
-  DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty<Vector2>( actor, index ), startValue, TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */);
@@ -5801,6 +5802,7 @@ int UtcDaliAnimationAnimateToVector2AlphaFunctionTimePeriodP(void)
   application.SendNotification();
   finishCheck.CheckSignalReceived();
   DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( actor, index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION );
   END_TEST;
 }
 
@@ -6518,9 +6520,21 @@ int UtcDaliAnimationAnimateToActorSizeP(void)
 
   Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), 0.0f, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetSize.width, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetSize.height, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetSize.depth, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -6628,9 +6642,17 @@ int UtcDaliAnimationAnimateToActorSizeWidthP(void)
 
   float fiftyPercentProgress(startValue + (targetWidth - startValue)*0.5f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), startValue, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( targetWidth, 0.0f, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetWidth, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -6672,9 +6694,17 @@ int UtcDaliAnimationAnimateToActorSizeHeightP(void)
 
   float fiftyPercentProgress(startValue + (targetHeight - startValue)*0.5f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), startValue, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 0.0f, targetHeight, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetHeight, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -6716,9 +6746,17 @@ int UtcDaliAnimationAnimateToActorSizeDepthP(void)
 
   float fiftyPercentProgress(startValue + (targetDepth - startValue)*0.5f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), startValue, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 0.0f, 0.0f, targetDepth ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetDepth, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -6868,9 +6906,21 @@ int UtcDaliAnimationAnimateToActorPositionP(void)
 
   Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), 0.0f, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetPosition.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetPosition.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetPosition.z, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -6913,9 +6963,17 @@ int UtcDaliAnimationAnimateToActorPositionXP(void)
 
   float fiftyPercentProgress(startValue + (targetX - startValue)*0.5f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), startValue, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( targetX, 0.0f, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetX, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -6961,9 +7019,17 @@ int UtcDaliAnimationAnimateToActorPositionYP(void)
 
   float fiftyPercentProgress(startValue + (targetY - startValue)*0.5f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), startValue, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, targetY, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetY, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7009,9 +7075,17 @@ int UtcDaliAnimationAnimateToActorPositionZP(void)
 
   float fiftyPercentProgress(startValue + (targetZ - startValue)*0.5f);
 
+  // Should return the initial properties before play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), startValue, TEST_LOCATION );
+
   // Start the animation
   animation.Play();
 
+  // Should return the target property after play
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, targetZ ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetZ, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7210,6 +7284,9 @@ int UtcDaliAnimationAnimateToActorOrientationAngleAxisP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7504,6 +7581,12 @@ int UtcDaliAnimationAnimateToActorScaleP(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 );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetScale.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetScale.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetScale.z, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7619,6 +7702,10 @@ int UtcDaliAnimationAnimateToActorScaleXP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( targetX, startValue, startValue ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetX, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7673,6 +7760,10 @@ int UtcDaliAnimationAnimateToActorScaleYP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( startValue, targetY, startValue ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetY, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7727,6 +7818,10 @@ int UtcDaliAnimationAnimateToActorScaleZP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( startValue, startValue, targetZ ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetZ, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7775,6 +7870,14 @@ int UtcDaliAnimationAnimateToActorColorP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetColor.r, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetColor.g, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetColor.b, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetColor.a, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetColor.a, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7900,6 +8003,10 @@ int UtcDaliAnimationAnimateToActorColorRedP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( targetRed, startValue, startValue, startValue ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetRed, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -7958,6 +8065,10 @@ int UtcDaliAnimationAnimateToActorColorGreenP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, targetGreen, startValue, startValue ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetGreen, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -8016,6 +8127,10 @@ int UtcDaliAnimationAnimateToActorColorBlueP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, targetBlue, startValue ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetBlue, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -8074,6 +8189,11 @@ int UtcDaliAnimationAnimateToActorColorAlphaP(void)
   // Start the animation
   animation.Play();
 
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, startValue, targetAlpha ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetAlpha, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetAlpha, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -10085,10 +10205,11 @@ int UtcDaliAnimationExtendDurationP(void)
   application.SendNotification();
   application.Render(static_cast<unsigned int>(extendedDurationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
 
-  // We didn't expect the animation to finish yet
+  // We didn't expect the animation to finish yet, but cached value should be the final one
   application.SendNotification();
   finishCheck.CheckSignalNotReceived();
-  DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, index ), startValue, TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(extendedDurationSeconds*250.0f)/* 75% animation progress, 50% animator progress */);
@@ -10105,6 +10226,7 @@ int UtcDaliAnimationExtendDurationP(void)
   application.SendNotification();
   finishCheck.CheckSignalReceived();
   DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION );
   END_TEST;
 }
 
@@ -10475,7 +10597,7 @@ int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionCol
   // Build the animation
   Animation animation = Animation::New(2.0f);
 
-  tet_infoline("Set target size in animation without intiating play");
+  tet_infoline("Set target size in animation without initiating 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);
@@ -10484,7 +10606,7 @@ int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionCol
   application.SendNotification();
   application.Render();
 
-  tet_infoline("Ensure position of actor is still at intial size and position");
+  tet_infoline("Ensure position of actor is still at initial size and position");
 
   DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION );
   DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION );
@@ -10496,7 +10618,7 @@ int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionCol
   application.SendNotification();
   application.Render(2000u);
 
-  tet_infoline("Ensure position and size of actor is at target value when aninmation playing");
+  tet_infoline("Ensure position and size of actor is at target value when animation playing");
 
   DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION );
   DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION );
index e212720..33e6ec9 100644 (file)
@@ -189,14 +189,14 @@ int UtcPathConstrainerApplyRange(void)
 
   Vector3 position, tangent;
   float tValue;
-  actor.GetProperty(index).Get(tValue);
+  DevelHandle::GetCurrentProperty( actor, index ).Get(tValue);
   float currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-  actor.GetProperty(index).Get(tValue);
+  DevelHandle::GetCurrentProperty( actor, index ).Get(tValue);
   currentCursor =  ( tValue - range.x ) / (range.y-range.x);
   path.Sample(currentCursor, position, tangent );
   path.Sample(0.5, position, tangent );
@@ -223,6 +223,12 @@ int UtcPathConstrainerApplyRange(void)
   path.Sample(currentCursor, position, tangent );
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
 
+  // Ensure GetProperty also returns the final result
+  actor.GetProperty( index ).Get( tValue );
+  currentCursor =  ( tValue - range.x ) / (range.y-range.x);
+  path.Sample(currentCursor, position, tangent );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
+
   END_TEST;
 }
 
index 061cb62..7e9ad26 100644 (file)
@@ -1431,9 +1431,14 @@ int UtcDaliRenderTaskSetViewportPosition(void)
   animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, AlphaFunction::LINEAR );
   animation.Play();
 
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition2, TEST_LOCATION );
+
   // Perform 1000ms worth of updates at which point animation should have completed.
   Wait(application, 1000);
   DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
   END_TEST;
 }
 
@@ -1483,9 +1488,14 @@ int UtcDaliRenderTaskSetViewportSize(void)
   animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, AlphaFunction::LINEAR );
   animation.Play();
 
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE  ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize2, TEST_LOCATION );
+
   // Perform 1000ms worth of updates at which point animation should have completed.
   Wait(application, 1000);
   DALI_TEST_EQUALS( task.GetCurrentViewportSize(), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE  ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1521,6 +1531,20 @@ int UtcDaliRenderTaskSetClearColorP(void)
   DALI_TEST_EQUALS( task.GetClearColor(), testColor2, TEST_LOCATION );
   DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION );
   DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION );
+
+  Vector4 newColor3(10.0f, 10.0f, 20.0f, 30.0f);
+  Animation animation = Animation::New(1.0f);
+  animation.AnimateTo( Property( task, RenderTask::Property::CLEAR_COLOR ), newColor3, AlphaFunction::LINEAR );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR  ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR  ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
   END_TEST;
 }
 
index eebb484..8a2f740 100644 (file)
 #define GL_TEXTURE_EXTERNAL_OES                                 0x8D65
 #endif
 
+/* GL_SAMPLER_EXTERNAL_OES  */
+#ifndef GL_SAMPLER_EXTERNAL_OES
+#define GL_SAMPLER_EXTERNAL_OES                                 0x8D66
+#endif
 
 #endif // __DALI_INTERNAL_GL_DEFINES_H__
index 6ca8901..8df598e 100644 (file)
@@ -1056,19 +1056,7 @@ Matrix Actor::GetCurrentWorldMatrix() const
 
 void Actor::SetVisible( bool visible )
 {
-  if( mVisible != visible )
-  {
-    if( NULL != mNode )
-    {
-      // mNode is being used in a separate thread; queue a message to set the value & base value
-      SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), mNode, &mNode->mVisible, &AnimatableProperty<bool>::Bake, visible );
-    }
-
-    mVisible = visible;
-
-    // Emit the signal on this actor and all its children
-    EmitVisibilityChangedSignalRecursively( this, visible, DevelActor::VisibilityChange::SELF );
-  }
+  SetVisibleInternal( visible, SendMessage::TRUE );
 }
 
 bool Actor::IsVisible() const
@@ -1290,53 +1278,6 @@ void Actor::SetSizeInternal( const Vector3& size )
   }
 }
 
-void Actor::NotifySizeAnimation( Animation& animation, const Vector3& targetSize )
-{
-  mTargetSize = targetSize;
-
-  // Notify deriving classes
-  OnSizeAnimation( animation, mTargetSize );
-}
-
-void Actor::NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property )
-{
-  if ( Dali::Actor::Property::SIZE_WIDTH == property )
-  {
-    mTargetSize.width = targetSize;
-  }
-  else if ( Dali::Actor::Property::SIZE_HEIGHT == property )
-  {
-    mTargetSize.height = targetSize;
-  }
-  else if ( Dali::Actor::Property::SIZE_DEPTH == property )
-  {
-    mTargetSize.depth = targetSize;
-  }
-  // Notify deriving classes
-  OnSizeAnimation( animation, mTargetSize );
-}
-
-void Actor::NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition )
-{
-  mTargetPosition = targetPosition;
-}
-
-void Actor::NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property )
-{
-  if ( Dali::Actor::Property::POSITION_X == property )
-  {
-    mTargetPosition.x = targetPosition;
-  }
-  else if ( Dali::Actor::Property::POSITION_Y == property )
-  {
-    mTargetPosition.y = targetPosition;
-  }
-  else if ( Dali::Actor::Property::POSITION_Z == property )
-  {
-    mTargetPosition.z = targetPosition;
-  }
-}
-
 void Actor::SetWidth( float width )
 {
   if( IsRelayoutEnabled() && !mRelayoutData->insideRelayout )
@@ -3301,6 +3242,149 @@ Property::Value Actor::GetDefaultPropertyCurrentValue( Property::Index index ) c
   return value;
 }
 
+void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+{
+  switch( index )
+  {
+    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:
+    {
+      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;
+    }
+  }
+}
+
 const SceneGraph::PropertyOwner* Actor::GetPropertyOwner() const
 {
   return mNode;
@@ -4223,6 +4307,12 @@ bool Actor::GetCurrentPropertyValue( Property::Index index, Property::Value& val
       break;
     }
 
+    case Dali::Actor::Property::VISIBLE:
+    {
+      value = IsVisible();
+      break;
+    }
+
     default:
     {
       // Must be an event-side only property
@@ -4979,6 +5069,23 @@ Object* Actor::GetParentObject() const
   return mParent;
 }
 
+void Actor::SetVisibleInternal( bool visible, SendMessage::Type sendMessage )
+{
+  if( mVisible != visible )
+  {
+    if( sendMessage == SendMessage::TRUE && NULL != mNode )
+    {
+      // mNode is being used in a separate thread; queue a message to set the value & base value
+      SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), mNode, &mNode->mVisible, &AnimatableProperty<bool>::Bake, visible );
+    }
+
+    mVisible = visible;
+
+    // Emit the signal on this actor and all its children
+    EmitVisibilityChangedSignalRecursively( this, visible, DevelActor::VisibilityChange::SELF );
+  }
+}
+
 void Actor::SetSiblingOrder( unsigned int order )
 {
   mSiblingOrder = std::min( order, static_cast<unsigned int>( DevelLayer::SIBLING_ORDER_MULTIPLIER ) );
index 6eac5aa..59e23d0 100644 (file)
@@ -619,7 +619,7 @@ public:
 
   /**
    * Sets the visibility flag of an actor.
-   * @param [in] visible The new visibility flag.
+   * @param[in] visible The new visibility flag.
    */
   void SetVisible( bool visible );
 
@@ -1486,23 +1486,6 @@ public:
   // For Animation
 
   /**
-   * This should only be called by Animation, when the actors SIZE property is animated.
-   *
-   * @param[in] animation The animation that resized the actor
-   * @param[in] targetSize The new target size of the actor
-   */
-  void NotifySizeAnimation( Animation& animation, const Vector3& targetSize );
-
-  /**
-   * This should only be called by Animation, when the actors SIZE_WIDTH or SIZE_HEIGHT or SIZE_DEPTH property is animated.
-   *
-   * @param[in] animation The animation that resized the actor
-   * @param[in] targetSize The new target size of the actor
-   * @param[in] property The index of the property being animated
-   */
-  void NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property );
-
-  /**
    * For use in derived classes.
    * This should only be called by Animation, when the actor is resized using Animation::Resize().
    */
@@ -1510,23 +1493,6 @@ public:
   {
   }
 
-  /**
-   * This should only be called by Animation, when the actors POSITION property is animated.
-   *
-   * @param[in] animation The animation that repositioned the actor
-   * @param[in] targetPosition The new target position of the actor
-   */
-  void NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition );
-
-  /**
-   * This should only be called by Animation, when the actors POSITION_X or POSITION_Y or POSITION_Z property is animated.
-   *
-   * @param[in] animation The animation that repositioned the actor
-   * @param[in] targetPosition The new target position of the actor
-   * @param[in] property The index of the property being animated
-   */
-  void NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property );
-
 protected:
 
   enum DerivedType
@@ -1688,6 +1654,11 @@ public:
   virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
 
   /**
+   * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
+   */
+  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+
+  /**
    * @copydoc Dali::Internal::Object::GetPropertyOwner()
    */
   virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
@@ -1744,6 +1715,15 @@ public:
 
 private:
 
+  struct SendMessage
+  {
+    enum Type
+    {
+      FALSE = 0,
+      TRUE  = 1,
+    };
+  };
+
   // Undefined
   Actor();
 
@@ -1922,7 +1902,6 @@ private:
    */
   bool ShiftSiblingsLevels( ActorContainer& siblings, int targetLevelToShiftFrom );
 
-
   /**
    * @brief Get the current position of the actor in screen coordinates.
    *
@@ -1930,6 +1909,13 @@ private:
    */
   const Vector2 GetCurrentScreenPosition() const;
 
+  /**
+   * Sets the visibility flag of an actor.
+   * @param[in] visible The new visibility flag.
+   * @param[in] sendMessage Whether to send a message to the update thread or not.
+   */
+  void SetVisibleInternal( bool visible, SendMessage::Type sendMessage );
+
 protected:
 
   Actor* mParent;                 ///< Each actor (except the root) can have one parent
index c09c4b1..0d70028 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
 // EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
 #include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/radian.h>
-#include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/animation/animation-playlist.h>
 #include <dali/internal/event/animation/animator-connector.h>
 #include <dali/internal/event/common/notification-manager.h>
@@ -114,17 +112,18 @@ AnimationPtr Animation::New(float durationSeconds)
 }
 
 Animation::Animation( EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction disconnectAction, AlphaFunction defaultAlpha )
-: mEventThreadServices( eventThreadServices ),
+: mAnimation( NULL ),
+  mEventThreadServices( eventThreadServices ),
   mPlaylist( playlist ),
-  mAnimation( NULL ),
-  mNotificationCount( 0 ),
-  mFinishedCallback( NULL ),
-  mFinishedCallbackObject( NULL ),
+  mFinishedSignal(),
+  mConnectors(),
+  mConnectorTargetValues(),
+  mPlayRange( Vector2(0.0f,1.0f)),
   mDurationSeconds( durationSeconds ),
   mSpeedFactor(1.0f),
+  mNotificationCount( 0 ),
   mLoopCount(1),
   mCurrentLoop(0),
-  mPlayRange( Vector2(0.0f,1.0f)),
   mEndAction( endAction ),
   mDisconnectAction( disconnectAction ),
   mDefaultAlpha( defaultAlpha ),
@@ -267,71 +266,33 @@ 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 ++)
+  if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
   {
-    // Use index to check if the current connector is next in the mConnectorActorTargetValues container, meaning targetValues have been pushed in AnimateXXFunction
-    if ( connectorTargetValuesIndex < numberOfConnectorTargetValues )
+    unsigned int connectorTargetValuesIndex( 0 );
+    unsigned int numberOfConnectorTargetValues = mConnectorTargetValues.size();
+
+    /*
+     * Loop through all Animator connectors, if connector index matches the current index stored in mConnectorTargetValues container then
+     * should apply target values for this index to the object.
+     */
+    for ( unsigned int connectorIndex = 0; connectorIndex < mConnectors.Count(); connectorIndex ++)
     {
-      ConnectorTargetValues& connectorPair = mConnectorActorTargetValues[ connectorTargetValuesIndex ];
-
-      if ( connectorPair.connectorIndex == connectorIndex )
+      // Use index to check if the current connector is next in the mConnectorTargetValues container, meaning targetValues have been pushed in AnimateXXFunction
+      if ( connectorTargetValuesIndex < numberOfConnectorTargetValues )
       {
-        // 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 ];
+        ConnectorTargetValues& connectorPair = mConnectorTargetValues[ connectorTargetValuesIndex ];
 
-        Actor* maybeActor = static_cast<Actor*>( connector->GetObject() ); // Only Actors would be in mConnectorActorTargetValues container
-
-        if ( maybeActor )
+        if ( connectorPair.connectorIndex == connectorIndex )
         {
-          // Get Stored Target Value and corresponding connector index
-          const Property::Type valueType = connectorPair.targetValue.GetType();
-          Property::Index propertyIndex = connector->GetPropertyIndex();
+          // 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
 
-          if ( valueType == Property::VECTOR3 )
-          {
-            Vector3 targetVector3 = connectorPair.targetValue.Get<Vector3>();
-
-            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<float>();
-
-            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
+          AnimatorConnectorBase* connector = mConnectors[ connectorIndex ];
+
+          Object* object = connector->GetObject();
+          if( object )
           {
-            // Currently only FLOAT and VECTOR3 is supported for Target values in AnimateXXFunctions
-            DALI_LOG_WARNING("Animation::Play Unsupported Value Type provided as TargetValue\n");
+            object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), connectorPair.targetValue );
           }
         }
       }
@@ -384,6 +345,9 @@ void Animation::Clear()
   // Remove all the connectors
   mConnectors.Clear();
 
+  // Reset the connector target values
+  mConnectorTargetValues.clear();
+
   // Replace the old scene-object with a new one
   DestroySceneObject();
   CreateSceneObject();
@@ -546,6 +510,12 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
   ExtendDuration( period );
 
+  // Store data to later notify the object that its property is being animated
+  ConnectorTargetValues connectorPair;
+  connectorPair.targetValue = destinationValue;
+  connectorPair.connectorIndex = mConnectors.Count();
+  mConnectorTargetValues.push_back( connectorPair );
+
   switch ( destinationType )
   {
     case Property::BOOLEAN:
@@ -572,26 +542,6 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::FLOAT:
     {
-      if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex ) ||
-           ( Dali::Actor::Property::SIZE_HEIGHT == 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 ) )
-      {
-
-        Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
-        if ( maybeActor )
-        {
-          // 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 );
-        }
-      }
-
       AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
                                                            targetPropertyIndex,
                                                            componentIndex,
@@ -614,21 +564,6 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR3:
     {
-      if ( Dali::Actor::Property::SIZE == targetPropertyIndex || Dali::Actor::Property::POSITION == targetPropertyIndex )
-      {
-        // Test whether this is actually an Actor
-        Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
-        if ( maybeActor )
-        {
-          // 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 );
-        }
-      }
-
       AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
                                                              targetPropertyIndex,
                                                              componentIndex,
@@ -848,12 +783,6 @@ void Animation::EmitSignalFinish()
     Dali::Animation handle( this );
     mFinishedSignal.Emit( handle );
   }
-
-  // This callback is used internally, to avoid the overhead of using a signal.
-  if ( mFinishedCallback )
-  {
-    mFinishedCallback( mFinishedCallbackObject );
-  }
 }
 
 bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
@@ -874,12 +803,6 @@ bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface*
   return connected;
 }
 
-void Animation::SetFinishedCallback( FinishedCallback callback, Object* object )
-{
-  mFinishedCallback = callback;
-  mFinishedCallbackObject = object;
-}
-
 void Animation::AddAnimatorConnector( AnimatorConnectorBase* connector )
 {
   DALI_ASSERT_DEBUG( NULL != connector );
index 7239ed4..8554ff4 100644 (file)
@@ -62,8 +62,6 @@ public:
   typedef Dali::Animation::EndAction EndAction;
   typedef Dali::Animation::Interpolation Interpolation;
 
-  typedef void (*FinishedCallback)(Object* object);
-
   /**
    * Create a new Animation object.
    * @param[in] durationSeconds The duration of the animation.
@@ -210,13 +208,6 @@ public:
   static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes);
 
   /**
-   * This callback is intended for internal use only, to avoid the overhead of using a signal.
-   * @param[in] callback The callback function to connect.
-   * @param[in] object The internal object requesting the callback, or NULL.
-   */
-  void SetFinishedCallback( FinishedCallback callback, Object* object );
-
-  /**
    * @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue)
    */
   void AnimateBy(Property& target, Property::Value& relativeValue);
@@ -455,33 +446,28 @@ private:
     Property::Value targetValue;
   };
 
-  EventThreadServices& mEventThreadServices;
-  AnimationPlaylist& mPlaylist;
-
   const SceneGraph::Animation* mAnimation;
 
-  int mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
+  EventThreadServices& mEventThreadServices;
+  AnimationPlaylist& mPlaylist;
 
   Dali::Animation::AnimationSignalType mFinishedSignal;
 
-  FinishedCallback mFinishedCallback;
-  Object* mFinishedCallbackObject;
-
   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
+  std::vector< ConnectorTargetValues > mConnectorTargetValues; //< Used to store animating property target value information
+
+  Vector2 mPlayRange;
 
-  // Cached for public getters
   float mDurationSeconds;
   float mSpeedFactor;
+  int mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
   int mLoopCount;
   int mCurrentLoop;
-  Vector2 mPlayRange;
   EndAction mEndAction;
   EndAction mDisconnectAction;
   AlphaFunction mDefaultAlpha;
   Dali::Animation::State mState;
-
 };
 
 } // namespace Internal
index d43ccf7..344e72c 100644 (file)
@@ -924,6 +924,32 @@ void Object::RemovePropertyNotifications()
   }
 }
 
+void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+{
+  if ( index < DEFAULT_PROPERTY_MAX_COUNT )
+  {
+    OnNotifyDefaultPropertyAnimation( animation, index, value );
+  }
+  else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index );
+    if( animatableProperty )
+    {
+      // update the cached property value
+      animatableProperty->SetPropertyValue( value );
+    }
+  }
+  else
+  {
+    CustomPropertyMetadata* custom = FindCustomProperty( index );
+    if( custom && custom->IsAnimatable() )
+    {
+      // update the cached property value
+      custom->SetPropertyValue( value );
+    }
+  }
+}
+
 void Object::EnablePropertyNotifications()
 {
   if( mPropertyNotifications )
index d378674..035e7ee 100644 (file)
@@ -41,6 +41,7 @@ class PropertyNotification;
 
 namespace Internal
 {
+class Animation;
 class ConstraintBase;
 class EventThreadServices;
 class Handle;
@@ -239,6 +240,14 @@ public:
    */
   virtual void RemovePropertyNotifications();
 
+  /**
+   * Notifies that a property is being animated.
+   * @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.
+   */
+  void NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+
   /******************************** Uniform Mappings ********************************/
 
   /**
@@ -479,6 +488,15 @@ private: // Default property extensions for derived classes
   virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const = 0;
 
   /**
+   * Notifies that a default property is being animated so the deriving class should update the cached value.
+   * @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.
+   */
+  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+  { }
+
+  /**
    * @todo this is virtual so that for now actor can override it,
    * it needs to be removed and only have GetSceneObject but that requires changing actor and constraint logic
    * Retrieve the scene-graph object added by this object.
index 04dfbb1..a97069b 100644 (file)
@@ -689,6 +689,34 @@ Property::Value RenderTask::GetDefaultPropertyCurrentValue( Property::Index inde
   return value;
 }
 
+void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+{
+  switch ( index )
+  {
+    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;
+    }
+  }
+}
+
 const SceneGraph::PropertyOwner* RenderTask::GetSceneObject() const
 {
   return mSceneObject;
index b76d0a2..90d5cc3 100644 (file)
@@ -323,6 +323,11 @@ public: // Implementation of Object
   virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
 
   /**
+   * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
+   */
+  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+
+  /**
    * @copydoc Dali::Internal::Object::GetSceneObject()
    */
   virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
index 6281d9b..238a8cf 100644 (file)
@@ -85,7 +85,15 @@ void FrameBuffer::AttachColorTexture( Context& context, Render::Texture* texture
   // Create a color attachment.
   if( texture->GetType() == TextureType::TEXTURE_2D )
   {
-    context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+    if( !texture->IsNativeImage() )
+    {
+      context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+    }
+    else
+    {
+      // If it's a native image we need to use GL_TEXTURE_EXTERNAL_OES as the texture target parameter
+      context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, texture->GetId(), mipmapLevel );
+    }
   }
   else
   {
index db5988b..e50ec3d 100644 (file)
@@ -145,6 +145,15 @@ public:
     return mType;
   }
 
+  /**
+   * Check if the texture is a native image
+   * @return if the texture is a native image
+   */
+  bool IsNativeImage() const
+  {
+    return mNativeImage;
+  }
+
 private:
 
   /**
@@ -161,7 +170,7 @@ private:
   NativeImageInterfacePtr mNativeImage; ///< Pointer to native image
   GLenum mInternalFormat;               ///< The format of the pixel data
   GLenum mPixelDataType;                ///< The data type of the pixel data
-  unsigned int mWidth;                  ///< Widht of the texture
+  unsigned int mWidth;                  ///< Width of the texture
   unsigned int mHeight;                 ///< Height of the texture
   bool mHasAlpha : 1;                   ///< Whether the format has an alpha channel
   bool mIsCompressed : 1;               ///< Whether the format is compressed
index 0f22758..5739f18 100644 (file)
@@ -261,7 +261,7 @@ void Program::GetActiveSamplerUniforms()
       mGlAbstraction.GetActiveUniform( mProgramId, (GLuint)i, uniformMaxNameLength,
                                        &nameLength, &number, &type, name );
 
-      if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE ) /// Is there a native sampler type?
+      if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE || type == GL_SAMPLER_EXTERNAL_OES )
       {
         GLuint location = mGlAbstraction.GetUniformLocation( mProgramId, name );
         samplerNames.push_back(name);
@@ -277,7 +277,9 @@ void Program::GetActiveSamplerUniforms()
   int samplerPosition = 0;
   while( token )
   {
-    if( ( strncmp( token, "sampler2D", 9u ) == 0 ) || ( strncmp( token, "samplerCube", 11u ) == 0 ) )
+    if( ( strncmp( token, "sampler2D", 9u )    == 0 ) ||
+        ( strncmp( token, "samplerCube", 11u ) == 0 ) ||
+        ( strncmp( token, "samplerExternalOES", 18u ) == 0 ) )
     {
       bool found( false );
       token = strtok_r( NULL, " ;\n", &nextPtr );
index 7480ff1..29160c3 100644 (file)
@@ -102,6 +102,8 @@ class Animation;
  *
  * Using AnimateTo and AnimateBy for the same property of the same Actor will yield undefined behaviour especially if the TimePeriod overlaps.
  *
+ * After calling Animation::Play(), Handle::GetProperty will return the target value of the animated property.
+ *
  * Signals
  * | %Signal Name | Method                   |
  * |--------------|--------------------------|