[dali_1.2.42] Merge branch 'devel/master' 61/132361/1
authorNick Holland <nick.holland@partner.samsung.com>
Fri, 2 Jun 2017 11:56:12 +0000 (12:56 +0100)
committerNick Holland <nick.holland@partner.samsung.com>
Fri, 2 Jun 2017 11:56:12 +0000 (12:56 +0100)
Change-Id: I7f18c98827816533d93a463b54028147d1b8f271

32 files changed:
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
dali/devel-api/object/property-helper-devel.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/animation/animation-playlist.cpp
dali/internal/event/animation/animator-connector-base.h
dali/internal/event/animation/key-frames-impl.cpp
dali/internal/event/animation/key-frames-impl.h
dali/internal/event/common/object-impl.cpp
dali/internal/event/common/object-impl.h
dali/internal/event/common/property-helper.h
dali/internal/event/common/property-metadata.cpp
dali/internal/event/common/property-metadata.h
dali/internal/event/render-tasks/render-task-impl.cpp
dali/internal/event/render-tasks/render-task-impl.h
dali/internal/update/manager/render-task-processor.cpp
dali/internal/update/manager/update-manager.cpp
dali/internal/update/nodes/node.h
dali/internal/update/render-tasks/scene-graph-render-task.cpp
dali/internal/update/render-tasks/scene-graph-render-task.h
dali/internal/update/rendering/scene-graph-renderer.cpp
dali/internal/update/rendering/scene-graph-renderer.h
dali/public-api/animation/animation.cpp
dali/public-api/dali-core-version.cpp
packaging/dali.spec

index 1463118..758579e 100644 (file)
@@ -245,7 +245,8 @@ TestCustomActor::TestCustomActor()
   mSizeSet( Vector3::ZERO ),
   mTargetSize( Vector3::ZERO ),
   mNego( false ),
-  mDepth(0u)
+  mDepth(0u),
+  develProp6( 10.0f )
 {
 }
 
@@ -254,7 +255,8 @@ TestCustomActor::TestCustomActor(bool nego)
   mDaliProperty( Property::INVALID_INDEX ),
   mSizeSet( Vector3::ZERO ),
   mTargetSize( Vector3::ZERO ),
-  mNego( nego )
+  mNego( nego ),
+  develProp6( 10.0f )
 {
 }
 /**
@@ -500,6 +502,10 @@ Property::Value TestCustomActor::GetProperty( BaseObject* object, Property::Inde
       {
         return Property::Value(actorImpl.develProp5);
       }
+      case Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6:
+      {
+        return Property::Value(actorImpl.develProp6);
+      }
     }
   }
   return Property::Value();
@@ -518,6 +524,7 @@ DALI_PROPERTY_REGISTRATION( Test, TestCustomActor, "testProperty2", VECTOR4, TES
 DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty3", VECTOR4, DEVEL_TEST_PROPERTY3)
 DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty4", INTEGER, DEVEL_TEST_PROPERTY4)
 DALI_DEVEL_PROPERTY_REGISTRATION( Test, TestCustomActor, "develTestProperty5", FLOAT, DEVEL_TEST_PROPERTY5)
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Test, TestCustomActor, "develTestProperty6", FLOAT, DEVEL_TEST_PROPERTY6)
 
 DALI_TYPE_REGISTRATION_END()
 
index c79b4b1..8af0693 100644 (file)
@@ -85,7 +85,8 @@ enum Type
   TEST_PROPERTY2 = Test::TestCustomActor::Property::TEST_PROPERTY2,
   DEVEL_TEST_PROPERTY3 = TEST_PROPERTY2+1,
   DEVEL_TEST_PROPERTY4 = TEST_PROPERTY2+2,
-  DEVEL_TEST_PROPERTY5 = TEST_PROPERTY2+3
+  DEVEL_TEST_PROPERTY5 = TEST_PROPERTY2+3,
+  DEVEL_TEST_PROPERTY6 = TEST_PROPERTY2+4
 };
 
 } // Namespace Property
@@ -154,6 +155,7 @@ public:
   Dali::Vector4 develProp3;
   int           develProp4;
   float         develProp5;
+  float         develProp6;
 };
 
 inline TestCustomActor& GetImpl( Test::TestCustomActor& handle )
index 2ef1975..01180b8 100644 (file)
@@ -2362,6 +2362,8 @@ int UtcDaliAnimationPlayFromP(void)
   Actor actor = Actor::New();
   Stage::GetCurrent().Add(actor);
 
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+
   // Build the animation
   float durationSeconds(1.0f);
   Animation animation = Animation::New(durationSeconds);
@@ -2371,6 +2373,9 @@ int UtcDaliAnimationPlayFromP(void)
   // Start the animation from 40% progress
   animation.PlayFrom( 0.4f );
 
+  // Target value should be updated 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);
@@ -2805,6 +2810,9 @@ 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);
@@ -3098,6 +3106,9 @@ 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);
@@ -3332,6 +3343,9 @@ 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);
@@ -3541,6 +3555,44 @@ int UtcDaliAnimationAnimateByIntegerAlphaFunctionTimePeriodP(void)
   END_TEST;
 }
 
+int UtcDaliAnimationAnimateByQuaternionP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  // Register a quaternion property
+  const Quaternion startValue( Degree( 90 ), Vector3::XAXIS );
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == startValue );
+  DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == startValue );
+
+  // Build the animation
+  float durationSeconds(2.0f);
+  Animation animation = Animation::New(durationSeconds);
+  const Quaternion relativeValue( Degree( 90 ), Vector3::ZAXIS );
+  const Quaternion finalValue( startValue * relativeValue );
+  animation.AnimateBy(Property(actor, index), relativeValue);
+
+  DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == startValue );
+  DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == startValue );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should be retrievable straight away
+  DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == finalValue );
+
+  application.SendNotification();
+  application.Render( 2000 ); // animation complete
+
+  DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == finalValue );
+  DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == finalValue );
+
+  END_TEST;
+}
+
 int UtcDaliAnimationAnimateByVector2P(void)
 {
   TestApplication application;
@@ -3566,6 +3618,9 @@ 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);
@@ -3801,6 +3856,9 @@ 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);
@@ -4037,6 +4095,9 @@ 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);
@@ -4273,6 +4334,9 @@ 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);
@@ -4301,6 +4365,45 @@ int UtcDaliAnimationAnimateByActorPositionP(void)
   END_TEST;
 }
 
+int UtcDaliAnimationAnimateByActorPositionComponentsP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector3 targetPosition(200.0f, 300.0f, 400.0f);
+  Vector3 relativePosition(targetPosition - Vector3::ZERO);
+  animation.AnimateBy( Property( actor, Actor::Property::POSITION_X ), relativePosition.x );
+  animation.AnimateBy( Property( actor, Actor::Property::POSITION_Y ), relativePosition.y );
+  animation.AnimateBy( Property( actor, Actor::Property::POSITION_Z ), relativePosition.z );
+
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should be retrievable straight away
+  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 );
+
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliAnimationAnimateByActorPositionAlphaFunctionP(void)
 {
   TestApplication application;
@@ -4488,6 +4591,9 @@ 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);
@@ -4790,6 +4896,9 @@ 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);
@@ -4879,6 +4988,239 @@ int UtcDaliAnimationAnimateByActorScaleP(void)
   END_TEST;
 }
 
+int UtcDaliAnimationAnimateByActorScaleComponentsP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector3 targetScale(2.0f, 3.0f, 4.0f);
+  Vector3 relativeScale(targetScale - Vector3::ONE);
+  animation.AnimateBy( Property( actor, Actor::Property::SCALE_X ), relativeScale.x );
+  animation.AnimateBy( Property( actor, Actor::Property::SCALE_Y ), relativeScale.y );
+  animation.AnimateBy( Property( actor, Actor::Property::SCALE_Z ), relativeScale.z );
+
+  DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION );
+
+  // 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 );
+
+  DALI_TEST_EQUALS( actor.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.GetCurrentScale(), targetScale, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateByActorColorP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector4 targetColor( 0.5f, 0.75f, 0.8f, 0.1f );
+  Vector4 relativeColor( targetColor - Color::WHITE );
+  animation.AnimateBy( Property( actor, Actor::Property::COLOR ), relativeColor );
+
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
+
+  // 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.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), targetColor, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateByActorColorComponentsP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector4 targetColor( 0.5f, 0.75f, 0.8f, 0.1f );
+  Vector4 relativeColor( targetColor - Color::WHITE );
+  animation.AnimateBy( Property( actor, Actor::Property::COLOR_RED ), relativeColor.r );
+  animation.AnimateBy( Property( actor, Actor::Property::COLOR_GREEN ), relativeColor.g );
+  animation.AnimateBy( Property( actor, Actor::Property::COLOR_BLUE ), relativeColor.b );
+  animation.AnimateBy( Property( actor, Actor::Property::COLOR_ALPHA ), relativeColor.a );
+
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
+
+  // 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.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.GetCurrentColor(), targetColor, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateByActorSizeP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector3 targetSize( 100.0f, 200.0f, 300.0f );
+  Vector3 relativeSize( targetSize - Vector3::ZERO );
+  animation.AnimateBy( Property( actor, Actor::Property::SIZE ), relativeSize );
+
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should be retrievable straight away
+  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 );
+
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateByActorSizeComponentsP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector3 targetSize( 100.0f, 200.0f, 300.0f );
+  Vector3 relativeSize( targetSize - Vector3::ZERO );
+  animation.AnimateBy( Property( actor, Actor::Property::SIZE_WIDTH ), relativeSize.width );
+  animation.AnimateBy( Property( actor, Actor::Property::SIZE_HEIGHT ), relativeSize.height );
+  animation.AnimateBy( Property( actor, Actor::Property::SIZE_DEPTH ), relativeSize.depth );
+
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should be retrievable straight away
+  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 );
+
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateByActorVisibilityP(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( actor.IsVisible(), true, TEST_LOCATION );
+
+  actor.SetVisible( false );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.IsVisible(), false, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  bool targetVisibility( true );
+  bool relativeVisibility( targetVisibility );
+  animation.AnimateBy( Property( actor, Actor::Property::VISIBLE ), relativeVisibility );
+
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), targetVisibility, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.IsVisible(), false, TEST_LOCATION ); // Not changed yet
+
+  application.SendNotification();
+  application.Render( 1000 ); // 1 second progress
+
+  DALI_TEST_EQUALS( actor.IsVisible(), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliAnimationAnimateToBooleanP(void)
 {
   TestApplication application;
@@ -8454,6 +8796,9 @@ int UtcDaliAnimationAnimateBetweenActorColorAlphaP(void)
   // Start the animation
   animation.Play();
 
+  // Final key frame value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), 0.9f, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -8804,6 +9149,9 @@ int UtcDaliAnimationAnimateBetweenActorVisibleP(void)
   // Start the animation
   animation.Play();
 
+  // Final key frame value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -8891,6 +9239,9 @@ int UtcDaliAnimationAnimateBetweenActorOrientation01P(void)
   // Start the animation
   animation.Play();
 
+  // Final key frame value should be retrievable straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Degree( 60 ), Vector3::ZAXIS ), TEST_LOCATION );
+
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
   animation.FinishedSignal().Connect(&application, finishCheck);
@@ -10785,3 +11136,77 @@ int UtcDaliAnimationTimePeriodOrderSeveralAnimateToCalls(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimationAnimateBetweenIntegerP(void)
+{
+  TestApplication application;
+
+  int startValue(1);
+  Actor actor = Actor::New();
+  const Property::Index index = actor.RegisterProperty("customProperty", startValue );
+  Stage::GetCurrent().Add(actor);
+
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS( actor.GetProperty< int >( index ), startValue, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+
+  KeyFrames keyFrames = KeyFrames::New();
+  keyFrames.Add(0.0f, 10);
+  keyFrames.Add(0.2f, 20);
+  keyFrames.Add(0.4f, 30);
+  keyFrames.Add(0.6f, 40);
+  keyFrames.Add(0.8f, 50);
+  keyFrames.Add(1.0f, 60);
+
+  animation.AnimateBetween( Property(actor, index ), keyFrames );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should change to the last key-frame's value straight away
+  DALI_TEST_EQUALS( actor.GetProperty< int >( index ), 60, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenVector2P(void)
+{
+  TestApplication application;
+
+  Vector2 startValue( 10.0f, 20.0f );
+  Actor actor = Actor::New();
+  const Property::Index index = actor.RegisterProperty("customProperty", startValue );
+  Stage::GetCurrent().Add(actor);
+
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION );
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+
+  KeyFrames keyFrames = KeyFrames::New();
+  keyFrames.Add( 0.0f, Vector2( 0.0f, 5.0f ) );
+  keyFrames.Add( 0.2f, Vector2( 30.0f, 25.0f ) );
+  keyFrames.Add( 0.4f, Vector2( 40.0f, 35.0f ) );
+  keyFrames.Add( 0.6f, Vector2( 50.0f, 45.0f ) );
+  keyFrames.Add( 0.8f, Vector2( 60.0f, 55.0f ) );
+  keyFrames.Add( 1.0f, Vector2( 70.0f, 65.0f ) );
+
+  animation.AnimateBetween( Property(actor, index ), keyFrames );
+
+  // Start the animation
+  animation.Play();
+
+  // Target value should change to the last key-frame's value straight away
+  DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), Vector2( 70.0f, 65.0f ), TEST_LOCATION );
+
+  END_TEST;
+}
index db7fca7..0449f34 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.
@@ -1319,5 +1319,13 @@ int UtcDaliCustomActorSetGetProperty(void)
   value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY5 );
   DALI_TEST_EQUALS( value.Get<float>(), 40.0f, 0.001f, TEST_LOCATION );
 
+  // Get read-only property
+  value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6 );
+  DALI_TEST_EQUALS( value.Get<float>(), 10.0f, 0.001f, TEST_LOCATION );
+
+  // Attempt to set read-only property and then ensure value hasn't changed
+  actor.SetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY6, 40.0f );
+  DALI_TEST_EQUALS( value.Get<float>(), 10.0f, 0.001f, TEST_LOCATION );
+
   END_TEST;
 }
index 20b9728..b747b8c 100644 (file)
@@ -1438,6 +1438,23 @@ int UtcDaliRenderTaskSetViewportPosition(void)
   DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
   DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( 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 );
+
+  // Create another animation which animates by a certain value
+  const Vector2 newPosition4( 75.0f, 45.0f );
+  const Vector2 relativePosition( newPosition4 - newPosition3 );
+  animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( task, RenderTask::Property::VIEWPORT_POSITION ), relativePosition );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1496,6 +1513,22 @@ int UtcDaliRenderTaskSetViewportSize(void)
   DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( 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 );
 
+  // Create another animation which animates by a certain value
+  const Vector2 newSize4( 75.0f, 45.0f );
+  const Vector2 relativeSize( newSize4 - newSize3 );
+  animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( task, RenderTask::Property::VIEWPORT_SIZE ), relativeSize );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( task.GetCurrentViewportSize(), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1544,6 +1577,21 @@ int UtcDaliRenderTaskSetClearColorP(void)
   DALI_TEST_EQUALS( task.GetCurrentProperty< Vector4 >( 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 );
 
+  // Create another animation which animates by a certain value
+  const Vector4 newColor4( 0.45f, 0.35f, 0.25f, 0.1f );
+  const Vector4 relativeColor( newColor4 - newColor3 );
+  animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( task, RenderTask::Property::CLEAR_COLOR ), relativeColor );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor4, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor4, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor4, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+
   END_TEST;
 }
 
index b2231d2..42b24c2 100644 (file)
@@ -1432,6 +1432,183 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   END_TEST;
 }
 
+int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector2AnimateByP(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+
+  const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX;
+  const unsigned int xComponentIndex = index + 1;
+  const unsigned int yComponentIndex = index + 2;
+  const Vector2 initialValue( 20.0f, 40.0f );
+
+  // Register animatable property & its components
+  AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", index, initialValue );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, "animatableProp1X", xComponentIndex, index, 0 );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, "animatableProp1Y", yComponentIndex, index, 1 );
+
+  // Check the animatable property value
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( index ), initialValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check the animatable property current value
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector2 >( index ), initialValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION );
+
+  // Do an AnimateBy
+  const Vector2 targetValue( 45.0f, 53.0f );
+  const Vector2 relativeValue( targetValue - initialValue );
+
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( customActor, xComponentIndex ), relativeValue.x );
+  animation.AnimateBy( Property( customActor, yComponentIndex ), relativeValue.y );
+  animation.Play();
+
+  // Target values should change straight away
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), targetValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), targetValue.y, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector3AnimateByP(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+
+  const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX;
+  const unsigned int xComponentIndex = index + 1;
+  const unsigned int yComponentIndex = index + 2;
+  const unsigned int zComponentIndex = index + 3;
+  const Vector3 initialValue( 20.0f, 40.0f, 50.0f );
+
+  // Register animatable property & its components
+  AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", index, initialValue );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, "animatableProp1X", xComponentIndex, index, 0 );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, "animatableProp1Y", yComponentIndex, index, 1 );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent3( customType1, "animatableProp1Z", zComponentIndex, index, 2 );
+
+  // Check the animatable property value
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( index ), initialValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check the animatable property current value
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector3 >( index ), initialValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION );
+
+  // Do an AnimateBy
+  const Vector3 targetValue( 45.0f, 53.0f, 25.0f );
+  const Vector3 relativeValue( targetValue - initialValue );
+
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( customActor, xComponentIndex ), relativeValue.x );
+  animation.AnimateBy( Property( customActor, yComponentIndex ), relativeValue.y );
+  animation.AnimateBy( Property( customActor, zComponentIndex ), relativeValue.z );
+  animation.Play();
+
+  // Target values should change straight away
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), targetValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), targetValue.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), targetValue.z, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector4AnimateByP(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( typeInfo );
+  BaseHandle handle = typeInfo.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  Actor customActor = Actor::DownCast( handle );
+  DALI_TEST_CHECK( customActor );
+
+  const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX;
+  const unsigned int xComponentIndex = index + 1;
+  const unsigned int yComponentIndex = index + 2;
+  const unsigned int zComponentIndex = index + 3;
+  const unsigned int wComponentIndex = index + 4;
+  const Vector4 initialValue( 20.0f, 40.0f, 50.0f, 60.0f );
+
+  // Register animatable property & its components
+  AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", index, initialValue );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, "animatableProp1X", xComponentIndex, index, 0 );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, "animatableProp1Y", yComponentIndex, index, 1 );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent3( customType1, "animatableProp1Z", zComponentIndex, index, 2 );
+  AnimatablePropertyComponentRegistration animatablePropertyComponent4( customType1, "animatableProp1W", wComponentIndex, index, 3 );
+
+  // Check the animatable property value
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( index ), initialValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( wComponentIndex ), initialValue.w, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check the animatable property current value
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector4 >( index ), initialValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( wComponentIndex ), initialValue.w, TEST_LOCATION );
+
+  // Do an AnimateBy
+  const Vector4 targetValue( 45.0f, 53.0f, 25.0f, 13.0f );
+  const Vector4 relativeValue( targetValue - initialValue );
+
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( customActor, xComponentIndex ), relativeValue.x );
+  animation.AnimateBy( Property( customActor, yComponentIndex ), relativeValue.y );
+  animation.AnimateBy( Property( customActor, zComponentIndex ), relativeValue.z );
+  animation.AnimateBy( Property( customActor, wComponentIndex ), relativeValue.w );
+  animation.Play();
+
+  // Target values should change straight away
+  DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( index ), targetValue, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), targetValue.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), targetValue.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), targetValue.z, TEST_LOCATION );
+  DALI_TEST_EQUALS( customActor.GetProperty< float >( wComponentIndex ), targetValue.w, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationN(void)
 {
   TestApplication application;
index 0008960..67a744b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_PROPERTY_HELPER_DEVEL_H__
 
 /*
- * 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.
   DALI_COMPILE_TIME_ASSERT( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count );
 
 /**
+ * @copydoc DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL
+ */
+#define DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL_READ_ONLY( count, typeRegistrationObject, objectNamespace, objectType, develNamespace, text, valueType, enumIndex ) \
+  Dali::PropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace:: develNamespace ::Property::enumIndex, Dali::Property::valueType, NULL, &objectType::GetProperty ); \
+  DALI_COMPILE_TIME_ASSERT( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count );
+
+/**
  * @brief These macros are used to define properties for implementations of CustomActor.
  *
  * These macros should be used when defining devel properties
 #define DALI_DEVEL_PROPERTY_REGISTRATION( objectNamespace, objectType, text, valueType, enumIndex ) \
   DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL( __COUNTER__, typeRegistration, objectNamespace, objectType, DALI_TOKEN_PASTE( Devel, objectType ), text, valueType, enumIndex  )
 
+/**
+ * @copydoc DALI_DEVEL_PROPERTY_REGISTRATION
+ *
+ * @note For Read Only properties
+ */
+#define DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( objectNamespace, objectType, text, valueType, enumIndex ) \
+  DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL_READ_ONLY( __COUNTER__, typeRegistration, objectNamespace, objectType, DALI_TOKEN_PASTE( Devel, objectType ), text, valueType, enumIndex  )
+
 #endif // __DALI_PROPERTY_HELPER_DEVEL_H__
index 8df598e..2ab1558 100644 (file)
@@ -3242,144 +3242,305 @@ Property::Value Actor::GetDefaultPropertyCurrentValue( Property::Index index ) c
   return value;
 }
 
-void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType )
 {
-  switch( index )
+  switch( animationType )
   {
-    case Dali::Actor::Property::SIZE:
+    case Animation::TO:
+    case Animation::BETWEEN:
     {
-      if( value.Get( mTargetSize ) )
+      switch( index )
       {
-        // Notify deriving classes
-        OnSizeAnimation( animation, mTargetSize );
-      }
-      break;
-    }
+        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_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 );
+        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;
+        }
       }
       break;
     }
 
-    case Dali::Actor::Property::SIZE_DEPTH:
+    case Animation::BY:
     {
-      if( value.Get( mTargetSize.depth ) )
+      switch( index )
       {
-        // Notify deriving classes
-        OnSizeAnimation( animation, mTargetSize );
-      }
-      break;
-    }
+        case Dali::Actor::Property::SIZE:
+        {
+          if( AdjustValue< Vector3 >( mTargetSize, value ) )
+          {
+            // Notify deriving classes
+            OnSizeAnimation( animation, mTargetSize );
+          }
+          break;
+        }
 
-    case Dali::Actor::Property::POSITION:
-    {
-      value.Get( mTargetPosition );
-      break;
-    }
+        case Dali::Actor::Property::SIZE_WIDTH:
+        {
+          if( AdjustValue< float >( mTargetSize.width, value ) )
+          {
+            // Notify deriving classes
+            OnSizeAnimation( animation, mTargetSize );
+          }
+          break;
+        }
 
-    case Dali::Actor::Property::POSITION_X:
-    {
-      value.Get( mTargetPosition.x );
-      break;
-    }
+        case Dali::Actor::Property::SIZE_HEIGHT:
+        {
+          if( AdjustValue< float >( mTargetSize.height, value ) )
+          {
+            // Notify deriving classes
+            OnSizeAnimation( animation, mTargetSize );
+          }
+          break;
+        }
 
-    case Dali::Actor::Property::POSITION_Y:
-    {
-      value.Get( mTargetPosition.y );
-      break;
-    }
+        case Dali::Actor::Property::SIZE_DEPTH:
+        {
+          if( AdjustValue< float >( mTargetSize.depth, value ) )
+          {
+            // Notify deriving classes
+            OnSizeAnimation( animation, mTargetSize );
+          }
+          break;
+        }
 
-    case Dali::Actor::Property::POSITION_Z:
-    {
-      value.Get( mTargetPosition.z );
-      break;
-    }
+        case Dali::Actor::Property::POSITION:
+        {
+          AdjustValue< Vector3 >( mTargetPosition, value );
+          break;
+        }
 
-    case Dali::Actor::Property::ORIENTATION:
-    {
-      value.Get( mTargetOrientation );
-      break;
-    }
+        case Dali::Actor::Property::POSITION_X:
+        {
+          AdjustValue< float >( mTargetPosition.x, value );
+          break;
+        }
 
-    case Dali::Actor::Property::SCALE:
-    {
-      value.Get( mTargetScale );
-      break;
-    }
+        case Dali::Actor::Property::POSITION_Y:
+        {
+          AdjustValue< float >( mTargetPosition.y, value );
+          break;
+        }
 
-    case Dali::Actor::Property::SCALE_X:
-    {
-      value.Get( mTargetScale.x );
-      break;
-    }
+        case Dali::Actor::Property::POSITION_Z:
+        {
+          AdjustValue< float >( mTargetPosition.z, value );
+          break;
+        }
 
-    case Dali::Actor::Property::SCALE_Y:
-    {
-      value.Get( mTargetScale.y );
-      break;
-    }
+        case Dali::Actor::Property::ORIENTATION:
+        {
+          Quaternion relativeValue;
+          if( value.Get( relativeValue ) )
+          {
+            mTargetOrientation *= relativeValue;
+          }
+          break;
+        }
 
-    case Dali::Actor::Property::SCALE_Z:
-    {
-      value.Get( mTargetScale.z );
-      break;
-    }
+        case Dali::Actor::Property::SCALE:
+        {
+          AdjustValue< Vector3 >( mTargetScale, value );
+          break;
+        }
 
-    case Dali::Actor::Property::VISIBLE:
-    {
-      SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE );
-      break;
-    }
+        case Dali::Actor::Property::SCALE_X:
+        {
+          AdjustValue< float >( mTargetScale.x, value );
+          break;
+        }
 
-    case Dali::Actor::Property::COLOR:
-    {
-      value.Get( mTargetColor );
-      break;
-    }
+        case Dali::Actor::Property::SCALE_Y:
+        {
+          AdjustValue< float >( mTargetScale.y, value );
+          break;
+        }
 
-    case Dali::Actor::Property::COLOR_RED:
-    {
-      value.Get( mTargetColor.r );
-      break;
-    }
+        case Dali::Actor::Property::SCALE_Z:
+        {
+          AdjustValue< float >( mTargetScale.z, value );
+          break;
+        }
 
-    case Dali::Actor::Property::COLOR_GREEN:
-    {
-      value.Get( mTargetColor.g );
-      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::COLOR_BLUE:
-    {
-      value.Get( mTargetColor.b );
-      break;
-    }
+        case Dali::Actor::Property::COLOR:
+        {
+          AdjustValue< Vector4 >( mTargetColor, value );
+          break;
+        }
 
-    case Dali::Actor::Property::COLOR_ALPHA:
-    case Dali::DevelActor::Property::OPACITY:
-    {
-      value.Get( mTargetColor.a );
-      break;
-    }
+        case Dali::Actor::Property::COLOR_RED:
+        {
+          AdjustValue< float >( mTargetColor.r, value );
+          break;
+        }
 
-    default:
-    {
-      // Not an animatable property. Do nothing.
+        case Dali::Actor::Property::COLOR_GREEN:
+        {
+          AdjustValue< float >( mTargetColor.g, value );
+          break;
+        }
+
+        case Dali::Actor::Property::COLOR_BLUE:
+        {
+          AdjustValue< float >( mTargetColor.b, value );
+          break;
+        }
+
+        case Dali::Actor::Property::COLOR_ALPHA:
+        case Dali::DevelActor::Property::OPACITY:
+        {
+          AdjustValue< float >( mTargetColor.a, value );
+          break;
+        }
+
+        default:
+        {
+          // Not an animatable property. Do nothing.
+          break;
+        }
+      }
       break;
     }
   }
index 59e23d0..b7e177d 100644 (file)
@@ -1656,7 +1656,7 @@ public:
   /**
    * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
    */
-  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
 
   /**
    * @copydoc Dali::Internal::Object::GetPropertyOwner()
index 2191e2a..c87941d 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali/public-api/math/radian.h>
 #include <dali/internal/event/animation/animation-playlist.h>
 #include <dali/internal/event/animation/animator-connector.h>
+#include <dali/internal/event/animation/path-impl.h>
 #include <dali/internal/event/common/notification-manager.h>
 #include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/event/common/stage-impl.h>
@@ -266,25 +267,7 @@ void Animation::Play()
 
   mState = Dali::Animation::PLAYING;
 
-  if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
-  {
-    // Sort according to end time with earlier end times coming first, if the end time is the same, then the connectors are not moved
-    std::stable_sort( mConnectorTargetValues.begin(), mConnectorTargetValues.end(), CompareConnectorEndTimes );
-
-    // Loop through all connector target values sorted by increasing end time
-    ConnectorTargetValuesContainer::const_iterator iter = mConnectorTargetValues.begin();
-    const ConnectorTargetValuesContainer::const_iterator endIter = mConnectorTargetValues.end();
-    for( ; iter != endIter; ++iter )
-    {
-      AnimatorConnectorBase* connector = mConnectors[ iter->connectorIndex ];
-
-      Object* object = connector->GetObject();
-      if( object )
-      {
-        object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue );
-      }
-    }
-  }
+  NotifyObjects();
 
   // mAnimation is being used in a separate thread; queue a Play message
   PlayAnimationMessage( mEventThreadServices, *mAnimation );
@@ -299,6 +282,8 @@ void Animation::PlayFrom( float progress )
 
     mState = Dali::Animation::PLAYING;
 
+    NotifyObjects();
+
     // mAnimation is being used in a separate thread; queue a Play message
     PlayAnimationFromMessage( mEventThreadServices, *mAnimation, progress );
   }
@@ -363,12 +348,28 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Time
 
 void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period)
 {
-  Object& object = GetImplementation( target.object );
-  const Property::Type targetType = object.GetPropertyType( target.propertyIndex );
+  Object& object = GetImplementation(target.object);
+  const Property::Type targetType = object.GetPropertyType(target.propertyIndex);
   const Property::Type destinationType = relativeValue.GetType();
-  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
 
-  ExtendDuration( period );
+  if ( object.GetPropertyComponentIndex( target.propertyIndex ) != Property::INVALID_COMPONENT_INDEX )
+  {
+    DALI_ASSERT_ALWAYS(Property::FLOAT == destinationType && "Animated value and Property type don't match");
+  }
+  else
+  {
+    DALI_ASSERT_ALWAYS(targetType == destinationType && "Animated value and Property type don't match");
+  }
+
+  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.animatorType = Animation::BY;
+  mConnectorTargetValues.push_back( connectorPair );
 
   switch ( targetType )
   {
@@ -502,6 +503,7 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
   connectorPair.targetValue = destinationValue;
   connectorPair.connectorIndex = mConnectors.Count();
   connectorPair.timePeriod = period;
+  connectorPair.animatorType = Animation::TO;
   mConnectorTargetValues.push_back( connectorPair );
 
   switch ( destinationType )
@@ -631,6 +633,14 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 
   ExtendDuration( period );
 
+  // Store data to later notify the object that its property is being animated
+  ConnectorTargetValues connectorPair;
+  connectorPair.targetValue = keyFrames.GetLastKeyFrameValue();
+  connectorPair.connectorIndex = mConnectors.Count();
+  connectorPair.timePeriod = period;
+  connectorPair.animatorType = BETWEEN;
+  mConnectorTargetValues.push_back( connectorPair );
+
   switch(keyFrames.GetType())
   {
     case Dali::Property::BOOLEAN:
@@ -971,6 +981,29 @@ bool Animation::CompareConnectorEndTimes( const Animation::ConnectorTargetValues
   return ( ( lhs.timePeriod.delaySeconds + lhs.timePeriod.durationSeconds ) < ( rhs.timePeriod.delaySeconds + rhs.timePeriod.durationSeconds ) );
 }
 
+void Animation::NotifyObjects()
+{
+  if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
+  {
+    // Sort according to end time with earlier end times coming first, if the end time is the same, then the connectors are not moved
+    std::stable_sort( mConnectorTargetValues.begin(), mConnectorTargetValues.end(), CompareConnectorEndTimes );
+
+    // Loop through all connector target values sorted by increasing end time
+    ConnectorTargetValuesContainer::const_iterator iter = mConnectorTargetValues.begin();
+    const ConnectorTargetValuesContainer::const_iterator endIter = mConnectorTargetValues.end();
+    for( ; iter != endIter; ++iter )
+    {
+      AnimatorConnectorBase* connector = mConnectors[ iter->connectorIndex ];
+
+      Object* object = connector->GetObject();
+      if( object )
+      {
+        object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue, iter->animatorType );
+      }
+    }
+  }
+}
+
 } // namespace Internal
 
 } // namespace Dali
index 92dff74..c329a51 100644 (file)
@@ -23,9 +23,9 @@
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/internal/event/animation/animator-connector-base.h>
+#include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/event/animation/key-frames-impl.h>
-#include <dali/internal/event/animation/path-impl.h>
+#include <dali/internal/event/common/event-thread-services.h>
 
 namespace Dali
 {
@@ -42,7 +42,9 @@ class UpdateManager;
 class Actor;
 class Animation;
 class AnimationPlaylist;
+class AnimatorConnectorBase;
 class Object;
+class Path;
 
 typedef IntrusivePtr<Animation> AnimationPtr;
 typedef std::vector<AnimationPtr> AnimationContainer;
@@ -59,6 +61,13 @@ class Animation : public BaseObject
 {
 public:
 
+  enum Type
+  {
+    TO,      ///< Animating TO the given value
+    BY,      ///< Animating BY the given value
+    BETWEEN  ///< Animating BETWEEN key-frames
+  };
+
   typedef Dali::Animation::EndAction EndAction;
   typedef Dali::Animation::Interpolation Interpolation;
 
@@ -445,13 +454,15 @@ private:
     ConnectorTargetValues()
     : targetValue(),
       timePeriod( 0.0f ),
-      connectorIndex( 0 )
+      connectorIndex( 0 ),
+      animatorType( TO )
     {
     }
 
     Property::Value targetValue;
     TimePeriod timePeriod;
     unsigned int connectorIndex;
+    Animation::Type animatorType;
   };
 
 private:
@@ -464,6 +475,11 @@ private:
    */
   static bool CompareConnectorEndTimes( const ConnectorTargetValues& lhs, const ConnectorTargetValues& rhs );
 
+  /**
+   * Notifies all the objects whose properties are being animated.
+   */
+  void NotifyObjects();
+
 private:
 
   const SceneGraph::Animation* mAnimation;
@@ -473,6 +489,7 @@ private:
 
   Dali::Animation::AnimationSignalType mFinishedSignal;
 
+  typedef OwnerContainer< AnimatorConnectorBase* > AnimatorConnectorContainer;
   AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
 
   typedef std::vector< ConnectorTargetValues > ConnectorTargetValuesContainer;
index 99a61ca..d210a6e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -21,7 +21,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
-#include <dali/devel-api/common/set-wrapper.h>
 #include <dali/internal/event/animation/animation-impl.h>
 
 
index 8ab2a8c..15cee6f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
 
 /*
- * Copyright (c) 2014 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.
@@ -20,8 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/event/common/object-impl.h>
-#include <dali/internal/common/owner-pointer.h>
-#include <dali/devel-api/common/owner-container.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>
@@ -33,14 +31,6 @@ namespace Internal
 {
 
 class Animation;
-class AnimatorConnectorBase;
-
-typedef OwnerPointer<AnimatorConnectorBase> AnimatorConnectorPtr;
-
-typedef OwnerContainer< AnimatorConnectorBase* > AnimatorConnectorContainer;
-
-typedef AnimatorConnectorContainer::Iterator AnimatorConnectorIter;
-typedef AnimatorConnectorContainer::ConstIterator AnimatorConnectorConstIter;
 
 /**
  * An abstract base class for animator connectors.
index 031495e..a111c17 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -160,5 +160,18 @@ KeyFrameSpec* KeyFrames::GetKeyFramesBase() const
   return mKeyFrames.Get();
 }
 
+Property::Value KeyFrames::GetLastKeyFrameValue() const
+{
+  Property::Value value;
+
+  unsigned int noOfKeyFrames = mKeyFrames->GetNumberOfKeyFrames();
+  if( noOfKeyFrames )
+  {
+    mKeyFrames->GetKeyFrameAsValue( noOfKeyFrames - 1, value );
+  }
+
+  return value;
+}
+
 } // Internal
 } // Dali
index 433d2bc..7146a2a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_KEY_FRAMES_H__
 
 /*
- * 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.
@@ -95,6 +95,11 @@ public:
    */
   KeyFrameSpec* GetKeyFramesBase() const;
 
+  /**
+   * Return the value of the last key frame.
+   */
+  Dali::Property::Value GetLastKeyFrameValue() const;
+
 private:
   Dali::Property::Type mType; // Type of the specialization
   IntrusivePtr<KeyFrameSpec> mKeyFrames;   // Pointer to the specialized key frame object
@@ -116,6 +121,13 @@ public:
 
   virtual unsigned int GetNumberOfKeyFrames() const = 0;
 
+  /**
+   * Get the key frame value as a Property::Value.
+   * @param[in] index The index of the key frame to fetch
+   * @param[out] value The value of the given key frame
+   */
+  virtual void GetKeyFrameAsValue( unsigned int index, Property::Value& value ) = 0;
+
 protected:
 
   /**
@@ -227,6 +239,14 @@ public:
   }
 
   /**
+   * @copydoc KeyFrameSpec::GetKeyFrameAsValue()
+   */
+  virtual void GetKeyFrameAsValue( unsigned int index, Property::Value& value )
+  {
+    value = mPVs[index].mValue;
+  }
+
+  /**
    * Return whether the progress is valid for the range of keyframes. (The first
    * keyframe doesn't have to start at 0, and the last doesn't have to end at 1.0)
    * @param[in] progress The progress to test
index da2f58d..fb2d388 100644 (file)
@@ -924,28 +924,46 @@ void Object::RemovePropertyNotifications()
   }
 }
 
-void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType )
 {
   if ( index < DEFAULT_PROPERTY_MAX_COUNT )
   {
-    OnNotifyDefaultPropertyAnimation( animation, index, value );
+    OnNotifyDefaultPropertyAnimation( animation, index, value, animationType );
   }
-  else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  else
   {
-    AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index );
-    if( animatableProperty )
+    PropertyMetadata* propertyMetadata = NULL;
+    if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
     {
-      // update the cached property value
-      animatableProperty->SetPropertyValue( value );
+      propertyMetadata = FindAnimatableProperty( index );
     }
-  }
-  else
-  {
-    CustomPropertyMetadata* custom = FindCustomProperty( index );
-    if( custom && custom->IsAnimatable() )
+    else
     {
-      // update the cached property value
-      custom->SetPropertyValue( value );
+      CustomPropertyMetadata* custom = FindCustomProperty( index );
+      if( custom && custom->IsAnimatable() )
+      {
+        propertyMetadata = custom;
+      }
+    }
+
+    if( propertyMetadata )
+    {
+      switch( animationType )
+      {
+        case Animation::TO:
+        case Animation::BETWEEN:
+        {
+          // Update the cached property value
+          propertyMetadata->SetPropertyValue( value );
+          break;
+        }
+        case Animation::BY:
+        {
+          // Adjust the cached property value
+          propertyMetadata->AdjustPropertyValueBy( value );
+          break;
+        }
+      }
     }
   }
 }
index 035e7ee..89fc73f 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/property-notification.h>
 #include <dali/devel-api/common/owner-container.h>
+#include <dali/internal/event/animation/animation-impl.h>
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/common/property-input-impl.h>
 #include <dali/internal/event/common/property-metadata.h>
@@ -41,7 +42,6 @@ class PropertyNotification;
 
 namespace Internal
 {
-class Animation;
 class ConstraintBase;
 class EventThreadServices;
 class Handle;
@@ -245,8 +245,9 @@ 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] animationType Whether the property value given is the target or a relative value.
    */
-  void NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+  void NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
 
   /******************************** Uniform Mappings ********************************/
 
@@ -492,8 +493,9 @@ 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] animationType Whether the property value given is the target or a relative value.
    */
-  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type propertyChangeType )
   { }
 
   /**
index 0fa0a47..e66a524 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PROPERTY_HELPER_H
 
 /*
- * 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.
@@ -90,6 +90,25 @@ struct PropertyDetails
  */
 bool CompareTokens( const char * first, const char * second, size_t& size );
 
+
+/**
+ * @brief Helper to adjust the current value of a variable from the given property-value
+ * @param[in] currentValue The current value of the property
+ * @param[in] value The relative value as a Property::Value
+ * @return true if value adjusted, false otherwise
+ */
+template< typename PropertyType >
+bool AdjustValue( PropertyType& currentValue, const Property::Value& value )
+{
+  PropertyType relativeValue;
+  if( value.Get( relativeValue ) )
+  {
+    currentValue += relativeValue;
+    return true;
+  }
+  return false;
+}
+
 } // namespace Internal
 
 } // namespace Dali
index abbe62e..41e0848 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali/internal/event/common/property-metadata.h>
 
 // INTERNAL INCLUDES
+#include <dali/public-api/math/quaternion.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/vector4.h>
@@ -30,6 +31,23 @@ 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() )
@@ -235,6 +253,146 @@ 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
index a06f262..b845eaa 100644 (file)
@@ -116,6 +116,12 @@ 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:
 
   /**
index a97069b..8da4425 100644 (file)
@@ -689,29 +689,66 @@ Property::Value RenderTask::GetDefaultPropertyCurrentValue( Property::Index inde
   return value;
 }
 
-void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType )
 {
-  switch ( index )
+  switch( animationType )
   {
-    case Dali::RenderTask::Property::VIEWPORT_POSITION:
+    case Animation::TO:
+    case Animation::BETWEEN:
     {
-      value.Get( mViewportPosition );
-      break;
-    }
-    case Dali::RenderTask::Property::VIEWPORT_SIZE:
-    {
-      value.Get( mViewportSize );
-      break;
-    }
-    case Dali::RenderTask::Property::CLEAR_COLOR:
-    {
-      value.Get( mClearColor );
+      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;
+        }
+      }
       break;
     }
-    case Dali::RenderTask::Property::REQUIRES_SYNC:
-    default:
+
+    case Animation::BY:
     {
-      // Nothing to do as not animatable
+      switch ( index )
+      {
+        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;
+        }
+      }
       break;
     }
   }
index 90d5cc3..1639b35 100644 (file)
@@ -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 );
+  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
 
   /**
    * @copydoc Dali::Internal::Object::GetSceneObject()
index 7e3447f..18cb3ee 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.
@@ -86,7 +86,6 @@ Layer* FindLayer( Node& node )
 /**
  * Rebuild the Layer::colorRenderables and overlayRenderables members,
  * including only renderers which are included in the current render-task.
- * Returns true if all renderers have finished acquiring resources.
  *
  * @param[in] updateBufferIndex The current update buffer index.
  * @param[in] node The current node of the scene-graph.
@@ -98,7 +97,7 @@ Layer* FindLayer( Node& node )
  *              Note: ClippingId is passed by reference, so it is permanently modified when traversing back up the tree for uniqueness.
  * @param[in] clippingDepth The current clipping depth
  */
-bool AddRenderablesForTask( BufferIndex updateBufferIndex,
+void AddRenderablesForTask( BufferIndex updateBufferIndex,
                             Node& node,
                             Layer& currentLayer,
                             RenderTask& renderTask,
@@ -106,19 +105,17 @@ bool AddRenderablesForTask( BufferIndex updateBufferIndex,
                             uint32_t& currentClippingId,
                             uint32_t clippingDepth )
 {
-  bool resourcesFinished = true;
-
   // Short-circuit for invisible nodes
   if( !node.IsVisible( updateBufferIndex ) )
   {
-    return resourcesFinished;
+    return;
   }
 
   // Check whether node is exclusive to a different render-task
   const RenderTask* exclusiveTo = node.GetExclusiveRenderTask();
   if( exclusiveTo && ( exclusiveTo != &renderTask ) )
   {
-    return resourcesFinished;
+    return;
   }
 
   // Assume all children go to this layer (if this node is a layer).
@@ -150,25 +147,15 @@ bool AddRenderablesForTask( BufferIndex updateBufferIndex,
   for( unsigned int i = 0; i < count; ++i )
   {
     SceneGraph::Renderer* renderer = node.GetRendererAt( i );
-    bool ready = false;
-    bool complete = false;
-    renderer->GetReadyAndComplete( ready, complete );
-
-    DALI_LOG_INFO( gRenderTaskLogFilter, Debug::General, "Testing renderable:%p ready:%s complete:%s\n", renderer, ready ? "T" : "F", complete ? "T" : "F" );
-
-    resourcesFinished &= complete;
 
-    if( ready ) // IE. should be rendered (all resources are available)
+    // Normal is the more-likely draw mode to occur.
+    if( DALI_LIKELY( inheritedDrawMode == DrawMode::NORMAL ) )
     {
-      // Normal is the more-likely draw mode to occur.
-      if( DALI_LIKELY( inheritedDrawMode == DrawMode::NORMAL ) )
-      {
-        layer->colorRenderables.PushBack( Renderable( &node, renderer ) );
-      }
-      else
-      {
-        layer->overlayRenderables.PushBack( Renderable( &node, renderer ) );
-      }
+      layer->colorRenderables.PushBack( Renderable( &node, renderer ) );
+    }
+    else
+    {
+      layer->overlayRenderables.PushBack( Renderable( &node, renderer ) );
     }
   }
 
@@ -178,11 +165,8 @@ bool AddRenderablesForTask( BufferIndex updateBufferIndex,
   for( NodeIter iter = children.Begin(); iter != endIter; ++iter )
   {
     Node& child = **iter;
-    bool childResourcesComplete = AddRenderablesForTask( updateBufferIndex, child, *layer, renderTask, inheritedDrawMode, currentClippingId, clippingDepth );
-    resourcesFinished &= childResourcesComplete;
+    AddRenderablesForTask( updateBufferIndex, child, *layer, renderTask, inheritedDrawMode, currentClippingId, clippingDepth );
   }
-
-  return resourcesFinished;
 }
 
 } // Anonymous namespace.
@@ -250,7 +234,6 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
       continue;
     }
 
-    bool resourcesFinished = false;
     if( renderTask.IsRenderRequired() )
     {
       size_t layerCount( sortedLayers.size() );
@@ -259,15 +242,13 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
         sortedLayers[i]->ClearRenderables();
       }
 
-      resourcesFinished = AddRenderablesForTask( updateBufferIndex,
-                                                 *sourceNode,
-                                                 *layer,
-                                                 renderTask,
-                                                 sourceNode->GetDrawMode(),
-                                                 clippingId,
-                                                 0u );
-
-      renderTask.SetResourcesFinished( resourcesFinished );
+      AddRenderablesForTask( updateBufferIndex,
+                             *sourceNode,
+                             *layer,
+                             renderTask,
+                             sourceNode->GetDrawMode(),
+                             clippingId,
+                             0u );
 
       // If the clipping Id is still 0 after adding all Renderables, there is no clipping required for this RenderTaskList.
       hasClippingNodes = clippingId != 0u;
@@ -279,10 +260,6 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                   hasClippingNodes,
                                   instructions );
     }
-    else
-    {
-      renderTask.SetResourcesFinished( resourcesFinished );
-    }
   }
 
   DALI_LOG_INFO( gRenderTaskLogFilter, Debug::General, "RenderTaskProcessor::Process() Onscreen\n" );
@@ -317,7 +294,6 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
       continue;
     }
 
-    bool resourcesFinished = false;
     if( renderTask.IsRenderRequired() )
     {
       size_t layerCount( sortedLayers.size() );
@@ -326,13 +302,13 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
         sortedLayers[i]->ClearRenderables();
       }
 
-      resourcesFinished = AddRenderablesForTask( updateBufferIndex,
-                                                 *sourceNode,
-                                                 *layer,
-                                                 renderTask,
-                                                 sourceNode->GetDrawMode(),
-                                                 clippingId,
-                                                 0u );
+      AddRenderablesForTask( updateBufferIndex,
+                             *sourceNode,
+                             *layer,
+                             renderTask,
+                             sourceNode->GetDrawMode(),
+                             clippingId,
+                             0u );
 
       // If the clipping Id is still 0 after adding all Renderables, there is no clipping required for this RenderTaskList.
       hasClippingNodes = clippingId != 0;
@@ -344,8 +320,6 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                   hasClippingNodes,
                                   instructions );
     }
-
-    renderTask.SetResourcesFinished( resourcesFinished );
   }
 }
 
index e90123e..344891a 100644 (file)
@@ -20,7 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
-#include <dali/devel-api/common/set-wrapper.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/devel-api/threading/mutex.h>
 
index dd1b79d..d7f25a4 100644 (file)
@@ -21,7 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor-enumerations.h>
 #include <dali/public-api/actors/draw-mode.h>
-#include <dali/devel-api/common/set-wrapper.h>
 #include <dali/public-api/math/quaternion.h>
 #include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/math/vector3.h>
index 96dfbc9..c637d24 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.
@@ -254,17 +254,11 @@ bool RenderTask::IsRenderRequired()
   return required;
 }
 
-void RenderTask::SetResourcesFinished( bool resourcesFinished )
-{
-  // resourcesFinished tells us that this render task will render to its FBO
-  mResourcesFinished = resourcesFinished;
-}
-
 // Called every frame regardless of whether render was required.
 // If render was not required, ignore resourcesFinished.
 void RenderTask::UpdateState()
 {
-  TASK_LOG_FMT( Debug::General, "(mResourcesFinished:%s)  FC:%d State:%s RR:%d\n", mResourcesFinished?"T":"F", mFrameCounter, STATE_STRING(mState), mRefreshRate );
+  TASK_LOG_FMT( Debug::General, "FC:%d State:%s RR:%d\n", mFrameCounter, STATE_STRING(mState), mRefreshRate );
 
   switch( mState )
   {
@@ -274,10 +268,7 @@ void RenderTask::UpdateState()
       {
         if( mFrameCounter == 0 )
         {
-          if( mResourcesFinished )
-          {
-            ++mFrameCounter; // Only start skipping frames when resources are loaded
-          }
+          ++mFrameCounter; // Only start skipping frames when resources are loaded
         }
         else // Continue counting to skip frames
         {
@@ -294,10 +285,7 @@ void RenderTask::UpdateState()
 
     case RENDER_ONCE_WAITING_FOR_RESOURCES:
     {
-      if( mResourcesFinished )
-      {
-        mState = RENDERED_ONCE;
-      }
+      mState = RENDERED_ONCE;
     }
     break;
 
@@ -390,8 +378,7 @@ void RenderTask::PrepareRenderInstruction( RenderInstruction& instruction, Buffe
                      mClearEnabled ? &GetClearColor( updateBufferIndex ) : NULL );
 
   if( mRequiresSync &&
-      mRefreshRate == Dali::RenderTask::REFRESH_ONCE &&
-      mResourcesFinished )
+      mRefreshRate == Dali::RenderTask::REFRESH_ONCE )
   {
     // create tracker if one doesn't yet exist.
     if( !mRenderSyncTracker )
@@ -484,7 +471,6 @@ RenderTask::RenderTask()
   mCameraNode( NULL ),
   mCamera( NULL ),
   mFrameBuffer(0),
-  mResourcesFinished( false ),
   mWaitingToRender( false ),
   mNotifyTrigger( false ),
   mExclusive( Dali::RenderTask::DEFAULT_EXCLUSIVE ),
index 516d993..643dd4e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_H__
 
 /*
- * 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.
@@ -269,12 +269,6 @@ public:
   bool IsRenderRequired();
 
   /**
-   * Set whether all resources were available when the render-task was processed
-   * @param[in] resourcesComplete True if the resources of the source tree are completely loaded.
-   */
-  void SetResourcesFinished( bool resourcesFinished );
-
-  /**
    * Process a frame. This method is called each frame for every ready render task, regardless
    * of whether it needs to render (so that the frame counter can be updated).
    */
@@ -376,7 +370,6 @@ private:
   SceneGraph::Camera* mCamera;
   Render::FrameBuffer* mFrameBuffer;
 
-  bool mResourcesFinished:1; ///< True if all resources were available when the render-task was processed
   bool mWaitingToRender:1; ///< True when an render once to FBO is waiting
   bool mNotifyTrigger:1; ///< True if a render once render task has finished renderering
   bool mExclusive: 1; ///< Whether the render task has exclusive access to the source actor (node in the scene graph implementation).
index 732ca23..9718893 100644 (file)
@@ -142,8 +142,6 @@ Renderer::Renderer()
   mBlendMode( BlendMode::AUTO ),
   mDepthWriteMode( DepthWriteMode::AUTO ),
   mDepthTestMode( DepthTestMode::AUTO ),
-  mResourcesReady( false ),
-  mFinishedResourceAcquisition( false ),
   mPremultipledAlphaEnabled( false ),
   mDepthIndex( 0 )
 {
@@ -176,21 +174,8 @@ void Renderer::operator delete( void* ptr )
 
 void Renderer::PrepareRender( BufferIndex updateBufferIndex )
 {
-  mResourcesReady = false;
-  mFinishedResourceAcquisition = false;
-
-  // Can only be considered ready when all the scene graph objects are connected to the renderer
-  if( mGeometry && mShader )
-  {
-    mResourcesReady = true;
-    mFinishedResourceAcquisition = true;
-  }
-
   if( mRegenerateUniformMap > UNIFORM_MAP_READY )
   {
-    DALI_ASSERT_DEBUG( mGeometry != NULL && "No geometry available in PrepareRender()" );
-    DALI_ASSERT_DEBUG( mShader != NULL && "No shader available in PrepareRender()" );
-
     if( mRegenerateUniformMap == REGENERATE_UNIFORM_MAP)
     {
       CollectedUniformMap& localMap = mCollectedUniformMap[ updateBufferIndex ];
@@ -238,7 +223,6 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex )
     {
       typedef MessageValue1< Render::Renderer, Render::Geometry* > DerivedType;
       unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
-
       new (slot) DerivedType( mRenderer, &Render::Renderer::SetGeometry, mGeometry );
     }
 
@@ -602,12 +586,6 @@ const CollectedUniformMap& Renderer::GetUniformMap( BufferIndex bufferIndex ) co
   return mCollectedUniformMap[bufferIndex];
 }
 
-void Renderer::GetReadyAndComplete( bool& ready, bool& complete ) const
-{
-  ready = mResourcesReady;
-  complete = mFinishedResourceAcquisition;
-}
-
 Renderer::Opacity Renderer::GetOpacity( BufferIndex updateBufferIndex, const Node& node ) const
 {
   Renderer::Opacity opacity = Renderer::OPAQUE;
index b150ee3..ee6762d 100644 (file)
@@ -255,17 +255,6 @@ public:
   Render::Renderer& GetRenderer();
 
   /**
-   * Check whether the renderer has been marked as ready to render
-   * ready means that renderer has all resources and should produce correct result
-   * complete means all resources have finished loading
-   * It's possible that renderer is complete but not ready,
-   * for example in case of resource load failed
-   * @param[out] ready TRUE if the renderer has resources to render
-   * @param[out] complete TRUE if the renderer resources are complete
-   */
-  void GetReadyAndComplete( bool& ready, bool& complete ) const;
-
-  /**
    * Query whether the renderer is fully opaque, fully transparent or transparent.
    * @param[in] updateBufferIndex The current update buffer index.
    * @return OPAQUE if fully opaque, TRANSPARENT if fully transparent and TRANSLUCENT if in between
@@ -393,13 +382,12 @@ private:
   DepthTestMode::Type          mDepthTestMode:2;                  ///< Local copy of the depth test mode
 
   bool                         mUniformMapChanged[2];             ///< Records if the uniform map has been altered this frame
-  bool                         mResourcesReady;                   ///< Set during the Update algorithm; true if the renderer has resources ready for the current frame.
-  bool                         mFinishedResourceAcquisition;      ///< Set during DoPrepareResources; true if ready & all resource acquisition has finished (successfully or otherwise)
   bool                         mPremultipledAlphaEnabled:1;       ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
 
 public:
 
   int                          mDepthIndex;                       ///< Used only in PrepareRenderInstructions
+
 };
 
 
index 0afc168..0e14bdb 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.
@@ -23,6 +23,7 @@
 #include <dali/public-api/animation/time-period.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/animation/animation-impl.h>
+#include <dali/internal/event/animation/path-impl.h>
 
 namespace Dali
 {
index 03458d1..9b1d6d1 100644 (file)
@@ -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 = 41;
+const unsigned int CORE_MICRO_VERSION = 42;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifndef EMSCRIPTEN
index 8412478..9a4b3da 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    The OpenGLES Canvas Core Library
-Version:    1.2.41
+Version:    1.2.42
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT