END_TEST;
}
+
int utcDaliActorVisibilityChangeSignalSelf(void)
{
TestApplication application;
childData.Check( false /* not called */, TEST_LOCATION );
grandChildData.Check( false /* not called */, TEST_LOCATION );
- END_TEST;}
+ END_TEST;
+}
+
+int utcDaliActorVisibilityChangeSignalAfterAnimation(void)
+{
+ TestApplication application;
+ tet_infoline( "Check that the visibility change signal is emitted when the visibility changes when an animation starts" );
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ VisibilityChangedFunctorData data;
+ DevelActor::VisibilityChangedSignal( actor ).Connect( &application, VisibilityChangedFunctor( data ) );
+
+ Animation animation = Animation::New( 1.0f );
+ animation.AnimateTo( Property( actor, Actor::Property::VISIBLE ), false );
+
+ data.Check( false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( actor, Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
+ tet_infoline( "Play the animation and check the property value" );
+ animation.Play();
+
+ data.Check( true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+ tet_infoline( "Animation not currently finished, so the current visibility should still be true" );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( actor, Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render( 1100 ); // After the animation
+
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( actor, Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+ END_TEST;
+}
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
- // We didn't expect the animation to finish yet
+ // We didn't expect the animation to finish yet, but cached value should be the final one
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty<Vector2>( actor, index ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% animation progress, 50% animator progress */);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( actor, index ), targetValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION );
END_TEST;
}
Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), 0.0f, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), targetSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetSize.width, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetSize.height, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetSize.depth, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
float fiftyPercentProgress(startValue + (targetWidth - startValue)*0.5f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), startValue, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( targetWidth, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), targetWidth, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
float fiftyPercentProgress(startValue + (targetHeight - startValue)*0.5f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), startValue, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 0.0f, targetHeight, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), targetHeight, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
float fiftyPercentProgress(startValue + (targetDepth - startValue)*0.5f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), startValue, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 0.0f, 0.0f, targetDepth ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), targetDepth, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), 0.0f, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetPosition.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetPosition.y, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetPosition.z, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
float fiftyPercentProgress(startValue + (targetX - startValue)*0.5f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), startValue, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( targetX, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), targetX, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
float fiftyPercentProgress(startValue + (targetY - startValue)*0.5f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), startValue, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, targetY, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Y ), targetY, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
float fiftyPercentProgress(startValue + (targetZ - startValue)*0.5f);
+ // Should return the initial properties before play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), startValue, TEST_LOCATION );
+
// Start the animation
animation.Play();
+ // Should return the target property after play
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, targetZ ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_Z ), targetZ, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), targetScale, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetScale.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetScale.y, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetScale.z, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( targetX, startValue, startValue ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_X ), targetX, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( startValue, targetY, startValue ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Y ), targetY, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SCALE ), Vector3( startValue, startValue, targetZ ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::SCALE_Z ), targetZ, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), targetColor, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetColor.r, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetColor.g, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetColor.b, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetColor.a, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetColor.a, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( targetRed, startValue, startValue, startValue ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_RED ), targetRed, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, targetGreen, startValue, startValue ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), targetGreen, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, targetBlue, startValue ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), targetBlue, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( Actor::Property::COLOR ), Vector4( startValue, startValue, startValue, targetAlpha ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), targetAlpha, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( DevelActor::Property::OPACITY ), targetAlpha, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
application.Render(static_cast<unsigned int>(extendedDurationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
- // We didn't expect the animation to finish yet
+ // We didn't expect the animation to finish yet, but cached value should be the final one
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, index ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(extendedDurationSeconds*250.0f)/* 75% animation progress, 50% animator progress */);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, index ), targetValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( index ), targetValue, TEST_LOCATION );
END_TEST;
}
Property::Index index = actor.RegisterProperty("anIndex", startValue);
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< int >( actor, index ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< int >( index ), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
// Start the animation
animation.Play();
+ // Target value should be retrievable straight away
+ DALI_TEST_EQUALS( actor.GetProperty< int >( index ), 20, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
finishCheck.CheckSignalReceived();
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< int >( actor, index ), 20, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< int >( index ), 20, TEST_LOCATION );
END_TEST;
}
// Build the animation
Animation animation = Animation::New(2.0f);
- tet_infoline("Set target size in animation without intiating play");
+ tet_infoline("Set target size in animation without initiating play");
animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR);
tet_infoline("Set target position in animation without intiating play");
animation.AnimateTo(Property(actor, Actor::Property::COLOR_RED), targetColors[0], AlphaFunction::LINEAR);
application.SendNotification();
application.Render();
- tet_infoline("Ensure position of actor is still at intial size and position");
+ tet_infoline("Ensure position of actor is still at initial size and position");
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION );
application.SendNotification();
application.Render(2000u);
- tet_infoline("Ensure position and size of actor is at target value when aninmation playing");
+ tet_infoline("Ensure position and size of actor is at target value when animation playing");
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliAnimationTimePeriodOrder(void)
+{
+ tet_infoline("Animate the same property with different time periods and ensure it runs correctly and ends up in the right place" );
+
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+
+ //////////////////////////////////////////////////////////////////////////////////
+
+ tet_infoline( "With two AnimateTo calls" );
+
+ Animation animation = Animation::New( 0.0f );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f, TimePeriod( 3.0f, 1.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 1.0f, 1.0f ) );
+ animation.Play();
+
+ tet_infoline( "The target position should change instantly" );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(5000); // After the animation is complete
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION );
+
+ //////////////////////////////////////////////////////////////////////////////////
+
+ tet_infoline( "Same animation again but in a different order - should yield the same result" );
+
+ actor.SetX( 0.0f );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+
+ animation = Animation::New( 0.0f );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 1.0f, 1.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f, TimePeriod( 3.0f, 1.0f ) );
+ animation.Play();
+
+ tet_infoline( "The target position should change instantly" );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(5000); // After the animation is complete
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3( 100.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 100.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliAnimationTimePeriodOrderSeveralAnimateToCalls(void)
+{
+ tet_infoline("Animate the same property with different time periods and ensure it runs correctly and ends up in the right place with several AnimateTo calls" );
+
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+
+ //////////////////////////////////////////////////////////////////////////////////
+
+ tet_infoline( "" );
+
+ Animation animation = Animation::New( 0.0f );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1000.0f, TimePeriod( 4.0f, 2.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 145.0f, TimePeriod( 3.0f, 10.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 109.0f, TimePeriod( 1.0f, 1.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1.0f, TimePeriod( 3.0f, 4.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 200.0f, TimePeriod( 2.0f, 5.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 10.0f, 2.0f ) );
+ animation.Play();
+
+ tet_infoline( "The target position should change instantly" );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(14000); // After the animation is complete
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION );
+
+ //////////////////////////////////////////////////////////////////////////////////
+
+ tet_infoline( "Same animation again but in a different order - should end up at the same point" );
+
+ actor.SetX( 0.0f );
+
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 0.0f, TEST_LOCATION );
+
+ animation = Animation::New( 0.0f );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 200.0f, TimePeriod( 2.0f, 5.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 10.0f, TimePeriod( 10.0f, 2.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 145.0f, TimePeriod( 3.0f, 10.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1000.0f, TimePeriod( 4.0f, 2.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 1.0f, TimePeriod( 3.0f, 4.0f ) );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 109.0f, TimePeriod( 1.0f, 1.0f ) );
+ animation.Play();
+
+ tet_infoline( "The target position should change instantly" );
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(14000); // After the animation is complete
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector3 >( actor, Actor::Property::POSITION ), Vector3( 145.0f, 0.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( actor, Actor::Property::POSITION_X ), 145.0f, TEST_LOCATION );
+
+ END_TEST;
+}
Vector3 position, tangent;
float tValue;
- actor.GetProperty(index).Get(tValue);
+ DevelHandle::GetCurrentProperty( actor, index ).Get(tValue);
float currentCursor = ( tValue - range.x ) / (range.y-range.x);
path.Sample(currentCursor, position, tangent );
DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
- actor.GetProperty(index).Get(tValue);
+ DevelHandle::GetCurrentProperty( actor, index ).Get(tValue);
currentCursor = ( tValue - range.x ) / (range.y-range.x);
path.Sample(currentCursor, position, tangent );
path.Sample(0.5, position, tangent );
path.Sample(currentCursor, position, tangent );
DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
+ // Ensure GetProperty also returns the final result
+ actor.GetProperty( index ).Get( tValue );
+ currentCursor = ( tValue - range.x ) / (range.y-range.x);
+ path.Sample(currentCursor, position, tangent );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), position, TEST_LOCATION );
+
END_TEST;
}
{
TestApplication application;
- Handle handle = WeightObject::New();;
+ Handle handle = WeightObject::New();
DALI_TEST_CHECK( handle.GetProperty<float>(WeightObject::WEIGHT) == 0.0f );
+ // process the message so scene object is added to update manager
+ application.SendNotification();
+ application.Render(0);
+
+ // no message to release scene object in this scenario
+
+ END_TEST;
+}
+
+int UtcDaliHandleWeightNew2(void)
+{
+ TestApplication application;
+
+ // scope for the weight object
+ {
+ Handle handle = WeightObject::New();
+ DALI_TEST_CHECK( handle.GetProperty<float>(WeightObject::WEIGHT) == 0.0f );
+
+ // process the message so scene object is added to update manager
+ application.SendNotification();
+ application.Render(0);
+ }
+ // handle out of scope so object gets destroyed
+ // process the message so update manager destroys the scene object
+ application.SendNotification();
+ application.Render(0);
+
END_TEST;
}
animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, AlphaFunction::LINEAR );
animation.Play();
+ DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition2, TEST_LOCATION );
+
// Perform 1000ms worth of updates at which point animation should have completed.
Wait(application, 1000);
DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
END_TEST;
}
animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, AlphaFunction::LINEAR );
animation.Play();
+ DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize2, TEST_LOCATION );
+
// Perform 1000ms worth of updates at which point animation should have completed.
Wait(application, 1000);
DALI_TEST_EQUALS( task.GetCurrentViewportSize(), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
END_TEST;
}
DALI_TEST_EQUALS( task.GetClearColor(), testColor2, TEST_LOCATION );
DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION );
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION );
+
+ Vector4 newColor3(10.0f, 10.0f, 20.0f, 30.0f);
+ Animation animation = Animation::New(1.0f);
+ animation.AnimateTo( Property( task, RenderTask::Property::CLEAR_COLOR ), newColor3, AlphaFunction::LINEAR );
+ animation.Play();
+
+ DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION );
+
+ // Perform 1000ms worth of updates at which point animation should have completed.
+ Wait(application, 1000);
+ DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+ DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
END_TEST;
}
Animation animation = Animation::New(0.2f);
animation.AnimateTo( Property( customActor, animatablePropertyIndex ), 15.f, AlphaFunction::LINEAR );
animation.Play();
+
+ // Target value should change straight away
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 15.0f, TEST_LOCATION );
+
// Render and notify, animation play for 0.05 seconds
application.SendNotification();
application.Render(50);
DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION );
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 22.5f, TEST_LOCATION );
+
// Render and notify, animation play for another 0.1 seconds
application.SendNotification();
application.Render(100);
Animation animation = Animation::New(0.2f);
animation.AnimateTo( Property( customActor, animatablePropertyIndex ), 20.f, AlphaFunction::LINEAR );
animation.Play();
+
+ // Target value should change straight away
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 20.0f, TEST_LOCATION );
+
// Render and notify, animation play for 0.05 seconds
application.SendNotification();
application.Render(50);
DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION );
DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< float >( customActor, animatablePropertyIndex ), 12.5f, TEST_LOCATION );
+
// Render and notify, animation play for another 0.1 seconds
application.SendNotification();
application.Render(100);
DALI_CFLAGS=-DPLATFORM_TIZEN
+# Use C++ 11
+DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast"
+
AC_ARG_ENABLE(exportall,
[AC_HELP_STRING([--enable-exportall],
[enables the exporting of all the symbols in the library])],
Version: ${apiversion}
Requires:
Libs: -L${libdir} -ldali-core
-Cflags: -I${includedir}
+Cflags: -I${includedir} -std=c++11
#define __DALI_OWNER_CONTAINER_H__
/*
- * Copyright (c) 2015 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.
}
/**
+ * Erase an object from OwnerContainer
+ * @param object to remove
+ */
+ inline void EraseObject( T object )
+ {
+ DALI_ASSERT_DEBUG( object && "NULL object not allowed" );
+
+ Iterator iter = Vector< T >::Begin();
+ const ConstIterator endIter = Vector< T >::End();
+ for ( ; iter != endIter; ++iter )
+ {
+ if ( *iter == object )
+ {
+ Erase( iter );
+ return;
+ }
+ }
+ }
+
+ /**
* Release the ownership of an object, without deleting it.
* @param[in] position A dereferencable iterator to an element in mContainer.
* @post iterators are invalidated by this method.
/*
- * 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.
{
for ( int x = 0; x < paddedWidth; ++x)
{
- if( y < (int)fieldBorder || y >= (paddedHeight - (int)fieldBorder) ||
- x < (int)fieldBorder || x >= (paddedWidth - (int)fieldBorder) )
+ if( y < static_cast< int >( fieldBorder ) || y >= ( paddedHeight - static_cast< int >( fieldBorder ) ) ||
+ x < static_cast< int >( fieldBorder ) || x >= ( paddedWidth - static_cast< int >( fieldBorder ) ) )
{
outside[ y * paddedWidth + x ] = MAX_DISTANCE;
inside[ y * paddedWidth + x ] = 0.0f;
template< typename T >
const char * GetLinearEnumerationName( T value, const StringEnum* table, unsigned int tableCount )
{
- if ( table && ( value > 0 || value <= (int)tableCount ) )
+ if ( table && ( value > 0 || value <= static_cast<int>( tableCount ) ) )
{
return table[value].string;
}
* This property can then be tested for with IsFullyOpaque().
*/
virtual void TestForTransparency() = 0;
+
+ protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~PackedPixelsProfile() {}
};
/**
const unsigned width,
const unsigned height,
const size_t numBytes ) = 0;
+ protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~CompressedProfile() {}
};
virtual const CompressedProfile* GetCompressedProfile() const { return 0; }
*/
void DeletePixelBuffer();
+protected:
+
/**
* A reference counted object may only be deleted by calling Unreference()
*/
* Multi-threading note: this method should be called from the main thread
*/
virtual void NotifyContextRegained() = 0;
+
+protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~ContextNotifierInterface() {}
+
};
} // namespace Integration
$(platform_abstraction_src_dir)/bitmap.h \
$(platform_abstraction_src_dir)/resource-policies.h \
$(platform_abstraction_src_dir)/resource-types.h \
- $(platform_abstraction_src_dir)/resource-declarations.h \
$(platform_abstraction_src_dir)/gl-abstraction.h \
$(platform_abstraction_src_dir)/gl-defines.h \
$(platform_abstraction_src_dir)/gl-sync-abstraction.h \
*/
virtual void Update(const GestureRequest& request) = 0;
+protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~GestureManager() {}
+
}; // class GestureManager
} // namespace Integration
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
#endif
+/* GL_SAMPLER_EXTERNAL_OES */
+#ifndef GL_SAMPLER_EXTERNAL_OES
+#define GL_SAMPLER_EXTERNAL_OES 0x8D66
+#endif
#endif // __DALI_INTERNAL_GL_DEFINES_H__
namespace Integration
{
-
+typedef unsigned int ResourceId;
typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
/**
+++ /dev/null
-#ifndef __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
-#define __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
-
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-/**
- * @brief Used to identify a resource loading operation.
- *
- * These unique ResourceId values can be used to identify a resource loading
- * transaction in core-adaptor communication.
- * A resource transaction is asynchronous and many can be in-flight
- * concurrently.
- * A ResourceId allows the core to track a resource transaction over its
- * lifetime and match an asynchronous completion notification to the
- * corresponding load request or to cancel the operation early.
- *
- * A resource transaction begins with a call to PlatformAbstraction::LoadResource()
- * Later asynchronous status notifications obtained by polling
- * PlatformAbstraction::GetResources() can be mapped to corresponding
- * LoadResource() invocations using the ResourceId value.
- * It is the core's responsibility to ensure that each invocation of
- * PlatformAbstraction::LoadResource() passes in a Request object with a unique
- * integer ResourceId.
- *
- * @sa Dali::Integration::PlatformAbstraction::LoadResource
- * Dali::Integration::PlatformAbstraction::GetResources
- * Dali::Integration::ResourceCache
- */
-typedef unsigned int ResourceId;
-const ResourceId InvalidResourceId = (ResourceId)-1;
-
-/**
- * Used to inform the current loading status
- */
-enum LoadStatus
-{
- RESOURCE_LOADING, ///< There are missing resources, being loaded
- RESOURCE_PARTIALLY_LOADED, ///< Enough resource has been loaded to start low quality rendering
- RESOURCE_COMPLETELY_LOADED, ///< The resource has been completely loaded
-};
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_RESOURCE_DECLARATIONS_H__
#define __DALI_INTEGRATION_RESOURCE_TYPES_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.
#include <dali/public-api/images/image-operations.h>
#include <dali/public-api/math/uint-16-pair.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/integration-api/resource-declarations.h>
namespace Dali
{
for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
{
resizePolicies[ i ] = ResizePolicy::DEFAULT;
+ useAssignedSize[ i ] = false;
negotiatedDimensions[ i ] = 0.0f;
dimensionNegotiated[ i ] = false;
dimensionDirty[ i ] = false;
}
ResizePolicy::Type resizePolicies[ Dimension::DIMENSION_COUNT ]; ///< Resize policies
+ bool useAssignedSize[ Dimension::DIMENSION_COUNT ]; ///< The flag to specify whether the size should be assigned to the actor
Dimension::Type dimensionDependencies[ Dimension::DIMENSION_COUNT ]; ///< A list of dimension dependencies
void Actor::SetVisible( bool visible )
{
- if( mVisible != visible )
- {
- if( NULL != mNode )
- {
- // mNode is being used in a separate thread; queue a message to set the value & base value
- SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), mNode, &mNode->mVisible, &AnimatableProperty<bool>::Bake, visible );
- }
-
- mVisible = visible;
-
- // Emit the signal on this actor and all its children
- EmitVisibilityChangedSignalRecursively( this, visible, DevelActor::VisibilityChange::SELF );
- }
+ SetVisibleInternal( visible, SendMessage::TRUE );
}
bool Actor::IsVisible() const
}
}
-void Actor::NotifySizeAnimation( Animation& animation, const Vector3& targetSize )
-{
- mTargetSize = targetSize;
-
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
-}
-
-void Actor::NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property )
-{
- if ( Dali::Actor::Property::SIZE_WIDTH == property )
- {
- mTargetSize.width = targetSize;
- }
- else if ( Dali::Actor::Property::SIZE_HEIGHT == property )
- {
- mTargetSize.height = targetSize;
- }
- else if ( Dali::Actor::Property::SIZE_DEPTH == property )
- {
- mTargetSize.depth = targetSize;
- }
- // Notify deriving classes
- OnSizeAnimation( animation, mTargetSize );
-}
-
-void Actor::NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition )
-{
- mTargetPosition = targetPosition;
-}
-
-void Actor::NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property )
-{
- if ( Dali::Actor::Property::POSITION_X == property )
- {
- mTargetPosition.x = targetPosition;
- }
- else if ( Dali::Actor::Property::POSITION_Y == property )
- {
- mTargetPosition.y = targetPosition;
- }
- else if ( Dali::Actor::Property::POSITION_Z == property )
- {
- mTargetPosition.z = targetPosition;
- }
-}
-
void Actor::SetWidth( float width )
{
if( IsRelayoutEnabled() && !mRelayoutData->insideRelayout )
{
if( dimension & ( 1 << i ) )
{
- mRelayoutData->resizePolicies[ i ] = policy;
+ if ( policy == ResizePolicy::USE_ASSIGNED_SIZE )
+ {
+ mRelayoutData->useAssignedSize[ i ] = true;
+ }
+ else
+ {
+ mRelayoutData->resizePolicies[ i ] = policy;
+ mRelayoutData->useAssignedSize[ i ] = false;
+ }
}
}
{
if( ( dimension & ( 1 << i ) ) )
{
- return mRelayoutData->resizePolicies[ i ];
+ if( mRelayoutData->useAssignedSize[ i ] )
+ {
+ return ResizePolicy::USE_ASSIGNED_SIZE;
+ }
+ else
+ {
+ return mRelayoutData->resizePolicies[ i ];
+ }
}
}
}
return value;
}
+void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+{
+ switch( index )
+ {
+ case Dali::Actor::Property::SIZE:
+ {
+ if( value.Get( mTargetSize ) )
+ {
+ // Notify deriving classes
+ OnSizeAnimation( animation, mTargetSize );
+ }
+ break;
+ }
+
+ case Dali::Actor::Property::SIZE_WIDTH:
+ {
+ if( value.Get( mTargetSize.width ) )
+ {
+ // Notify deriving classes
+ OnSizeAnimation( animation, mTargetSize );
+ }
+ break;
+ }
+
+ case Dali::Actor::Property::SIZE_HEIGHT:
+ {
+ if( value.Get( mTargetSize.height ) )
+ {
+ // Notify deriving classes
+ OnSizeAnimation( animation, mTargetSize );
+ }
+ break;
+ }
+
+ case Dali::Actor::Property::SIZE_DEPTH:
+ {
+ if( value.Get( mTargetSize.depth ) )
+ {
+ // Notify deriving classes
+ OnSizeAnimation( animation, mTargetSize );
+ }
+ break;
+ }
+
+ case Dali::Actor::Property::POSITION:
+ {
+ value.Get( mTargetPosition );
+ break;
+ }
+
+ case Dali::Actor::Property::POSITION_X:
+ {
+ value.Get( mTargetPosition.x );
+ break;
+ }
+
+ case Dali::Actor::Property::POSITION_Y:
+ {
+ value.Get( mTargetPosition.y );
+ break;
+ }
+
+ case Dali::Actor::Property::POSITION_Z:
+ {
+ value.Get( mTargetPosition.z );
+ break;
+ }
+
+ case Dali::Actor::Property::ORIENTATION:
+ {
+ value.Get( mTargetOrientation );
+ break;
+ }
+
+ case Dali::Actor::Property::SCALE:
+ {
+ value.Get( mTargetScale );
+ break;
+ }
+
+ case Dali::Actor::Property::SCALE_X:
+ {
+ value.Get( mTargetScale.x );
+ break;
+ }
+
+ case Dali::Actor::Property::SCALE_Y:
+ {
+ value.Get( mTargetScale.y );
+ break;
+ }
+
+ case Dali::Actor::Property::SCALE_Z:
+ {
+ value.Get( mTargetScale.z );
+ break;
+ }
+
+ case Dali::Actor::Property::VISIBLE:
+ {
+ SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE );
+ break;
+ }
+
+ case Dali::Actor::Property::COLOR:
+ {
+ value.Get( mTargetColor );
+ break;
+ }
+
+ case Dali::Actor::Property::COLOR_RED:
+ {
+ value.Get( mTargetColor.r );
+ break;
+ }
+
+ case Dali::Actor::Property::COLOR_GREEN:
+ {
+ value.Get( mTargetColor.g );
+ break;
+ }
+
+ case Dali::Actor::Property::COLOR_BLUE:
+ {
+ value.Get( mTargetColor.b );
+ break;
+ }
+
+ case Dali::Actor::Property::COLOR_ALPHA:
+ case Dali::DevelActor::Property::OPACITY:
+ {
+ value.Get( mTargetColor.a );
+ break;
+ }
+
+ default:
+ {
+ // Not an animatable property. Do nothing.
+ break;
+ }
+ }
+}
+
const SceneGraph::PropertyOwner* Actor::GetPropertyOwner() const
{
return mNode;
break;
}
+ case Dali::Actor::Property::VISIBLE:
+ {
+ value = IsVisible();
+ break;
+ }
+
default:
{
// Must be an event-side only property
// container to be relayed out.
DALI_LOG_TIMER_START( NegSizeTimer1 );
- if(GetResizePolicy(Dimension::WIDTH) == ResizePolicy::USE_ASSIGNED_SIZE)
+ if( GetUseAssignedSize(Dimension::WIDTH ) )
{
- SetLayoutNegotiated(false, Dimension::WIDTH);
+ SetLayoutNegotiated( false, Dimension::WIDTH );
}
- if(GetResizePolicy(Dimension::HEIGHT) == ResizePolicy::USE_ASSIGNED_SIZE)
+ if( GetUseAssignedSize( Dimension::HEIGHT ) )
{
- SetLayoutNegotiated(false, Dimension::HEIGHT);
+ SetLayoutNegotiated( false, Dimension::HEIGHT );
}
// Do the negotiation
// Forces children that have already been laid out to be relayed out
// if they have assigned size during relayout.
- if(child->GetResizePolicy(Dimension::WIDTH) == ResizePolicy::USE_ASSIGNED_SIZE)
+ if( child->GetUseAssignedSize(Dimension::WIDTH) )
{
child->SetLayoutNegotiated(false, Dimension::WIDTH);
child->SetLayoutDirty(true, Dimension::WIDTH);
}
- if(child->GetResizePolicy(Dimension::HEIGHT) == ResizePolicy::USE_ASSIGNED_SIZE)
+
+ if( child->GetUseAssignedSize(Dimension::HEIGHT) )
{
child->SetLayoutNegotiated(false, Dimension::HEIGHT);
child->SetLayoutDirty(true, Dimension::HEIGHT);
DALI_LOG_TIMER_END( NegSizeTimer1, gLogRelayoutFilter, Debug::Concise, "NegotiateSize() took: ");
}
+void Actor::SetUseAssignedSize( bool use, Dimension::Type dimension )
+{
+ if( mRelayoutData )
+ {
+ for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+ {
+ if( dimension & ( 1 << i ) )
+ {
+ mRelayoutData->useAssignedSize[ i ] = use;
+ }
+ }
+ }
+}
+
+bool Actor::GetUseAssignedSize( Dimension::Type dimension ) const
+{
+ if ( mRelayoutData )
+ {
+ // If more than one dimension is requested, just return the first one found
+ for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+ {
+ if( dimension & ( 1 << i ) )
+ {
+ return mRelayoutData->useAssignedSize[ i ];
+ }
+ }
+ }
+
+ return false;
+}
+
void Actor::RelayoutRequest( Dimension::Type dimension )
{
Internal::RelayoutController* relayoutController = Internal::RelayoutController::Get();
return mParent;
}
+void Actor::SetVisibleInternal( bool visible, SendMessage::Type sendMessage )
+{
+ if( mVisible != visible )
+ {
+ if( sendMessage == SendMessage::TRUE && NULL != mNode )
+ {
+ // mNode is being used in a separate thread; queue a message to set the value & base value
+ SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), mNode, &mNode->mVisible, &AnimatableProperty<bool>::Bake, visible );
+ }
+
+ mVisible = visible;
+
+ // Emit the signal on this actor and all its children
+ EmitVisibilityChangedSignalRecursively( this, visible, DevelActor::VisibilityChange::SELF );
+ }
+}
+
void Actor::SetSiblingOrder( unsigned int order )
{
mSiblingOrder = std::min( order, static_cast<unsigned int>( DevelLayer::SIBLING_ORDER_MULTIPLIER ) );
/**
* Sets the visibility flag of an actor.
- * @param [in] visible The new visibility flag.
+ * @param[in] visible The new visibility flag.
*/
void SetVisible( bool visible );
void NegotiateSize( const Vector2& size, RelayoutContainer& container );
/**
+ * @brief Set whether size negotiation should use the assigned size of the actor
+ * during relayout for the given dimension(s)
+ *
+ * @param[in] use Whether the assigned size of the actor should be used
+ * @param[in] dimension The dimension(s) to set. Can be a bitfield of multiple dimensions
+ */
+ void SetUseAssignedSize( bool use, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
+
+ /**
+ * @brief Returns whether size negotiation should use the assigned size of the actor
+ * during relayout for a single dimension
+ *
+ * @param[in] dimension The dimension to get
+ * @return Return whether the assigned size of the actor should be used. If more than one dimension is requested, just return the first one found
+ */
+ bool GetUseAssignedSize( Dimension::Type dimension ) const;
+
+ /**
* @copydoc Dali::Actor::SetResizePolicy()
*/
void SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
// For Animation
/**
- * This should only be called by Animation, when the actors SIZE property is animated.
- *
- * @param[in] animation The animation that resized the actor
- * @param[in] targetSize The new target size of the actor
- */
- void NotifySizeAnimation( Animation& animation, const Vector3& targetSize );
-
- /**
- * This should only be called by Animation, when the actors SIZE_WIDTH or SIZE_HEIGHT or SIZE_DEPTH property is animated.
- *
- * @param[in] animation The animation that resized the actor
- * @param[in] targetSize The new target size of the actor
- * @param[in] property The index of the property being animated
- */
- void NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property );
-
- /**
* For use in derived classes.
* This should only be called by Animation, when the actor is resized using Animation::Resize().
*/
{
}
- /**
- * This should only be called by Animation, when the actors POSITION property is animated.
- *
- * @param[in] animation The animation that repositioned the actor
- * @param[in] targetPosition The new target position of the actor
- */
- void NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition );
-
- /**
- * This should only be called by Animation, when the actors POSITION_X or POSITION_Y or POSITION_Z property is animated.
- *
- * @param[in] animation The animation that repositioned the actor
- * @param[in] targetPosition The new target position of the actor
- * @param[in] property The index of the property being animated
- */
- void NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property );
-
protected:
enum DerivedType
virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
/**
+ * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
+ */
+ virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+
+ /**
* @copydoc Dali::Internal::Object::GetPropertyOwner()
*/
virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
private:
+ struct SendMessage
+ {
+ enum Type
+ {
+ FALSE = 0,
+ TRUE = 1,
+ };
+ };
+
// Undefined
Actor();
*/
bool ShiftSiblingsLevels( ActorContainer& siblings, int targetLevelToShiftFrom );
-
/**
* @brief Get the current position of the actor in screen coordinates.
*
*/
const Vector2 GetCurrentScreenPosition() const;
+ /**
+ * Sets the visibility flag of an actor.
+ * @param[in] visible The new visibility flag.
+ * @param[in] sendMessage Whether to send a message to the update thread or not.
+ */
+ void SetVisibleInternal( bool visible, SendMessage::Type sendMessage );
+
protected:
Actor* mParent; ///< Each actor (except the root) can have one parent
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
// INTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
#include <dali/public-api/animation/alpha-function.h>
#include <dali/public-api/animation/time-period.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/math/radian.h>
-#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/animation/animation-playlist.h>
#include <dali/internal/event/animation/animator-connector.h>
#include <dali/internal/event/common/notification-manager.h>
}
Animation::Animation( EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction disconnectAction, AlphaFunction defaultAlpha )
-: mEventThreadServices( eventThreadServices ),
+: mAnimation( NULL ),
+ mEventThreadServices( eventThreadServices ),
mPlaylist( playlist ),
- mAnimation( NULL ),
- mNotificationCount( 0 ),
- mFinishedCallback( NULL ),
- mFinishedCallbackObject( NULL ),
+ mFinishedSignal(),
+ mConnectors(),
+ mConnectorTargetValues(),
+ mPlayRange( Vector2(0.0f,1.0f)),
mDurationSeconds( durationSeconds ),
mSpeedFactor(1.0f),
+ mNotificationCount( 0 ),
mLoopCount(1),
mCurrentLoop(0),
- mPlayRange( Vector2(0.0f,1.0f)),
mEndAction( endAction ),
mDisconnectAction( disconnectAction ),
mDefaultAlpha( defaultAlpha ),
mState = Dali::Animation::PLAYING;
- unsigned int connectorTargetValuesIndex( 0 );
- unsigned int numberOfConnectorTargetValues = mConnectorActorTargetValues.size();
-
- /*
- * Loop through all Animator connectors, if connector index matches the current index stored in mConnectorActorTargetValues container then
- * should apply target values for this index to the Actor.
- * Confirm object is an actor and it is a POSITION or SIZE Property Index before sending Notify message to Actor.
- */
- for ( unsigned int connectorIndex = 0; connectorIndex < mConnectors.Count(); connectorIndex ++)
+ if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
{
- // Use index to check if the current connector is next in the mConnectorActorTargetValues container, meaning targetValues have been pushed in AnimateXXFunction
- if ( connectorTargetValuesIndex < numberOfConnectorTargetValues )
+ // 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 )
{
- ConnectorTargetValues& connectorPair = mConnectorActorTargetValues[ connectorTargetValuesIndex ];
+ AnimatorConnectorBase* connector = mConnectors[ iter->connectorIndex ];
- if ( connectorPair.connectorIndex == connectorIndex )
+ Object* object = connector->GetObject();
+ if( object )
{
- // Current connector index matches next in the stored connectors with target values so apply target value.
- connectorTargetValuesIndex++; // Found a match for connector so increment index to next one
-
- AnimatorConnectorBase* connector = mConnectors[ connectorIndex ];
-
- Actor* maybeActor = static_cast<Actor*>( connector->GetObject() ); // Only Actors would be in mConnectorActorTargetValues container
-
- if ( maybeActor )
- {
- // Get Stored Target Value and corresponding connector index
- const Property::Type valueType = connectorPair.targetValue.GetType();
- Property::Index propertyIndex = connector->GetPropertyIndex();
-
- if ( valueType == Property::VECTOR3 )
- {
- Vector3 targetVector3 = connectorPair.targetValue.Get<Vector3>();
-
- if ( propertyIndex == Dali::Actor::Property::POSITION )
- {
- maybeActor->NotifyPositionAnimation( *this, targetVector3 );
- }
- else if ( propertyIndex == Dali::Actor::Property::SIZE )
- {
- maybeActor->NotifySizeAnimation( *this, targetVector3 );
- }
- }
- else if ( valueType == Property::FLOAT )
- {
- float targetFloat = connectorPair.targetValue.Get<float>();
-
- if ( ( Dali::Actor::Property::POSITION_X == propertyIndex ) ||
- ( Dali::Actor::Property::POSITION_Y == propertyIndex ) ||
- ( Dali::Actor::Property::POSITION_Z == propertyIndex ) )
- {
- maybeActor->NotifyPositionAnimation( *this, targetFloat, propertyIndex );
- }
- else if ( ( Dali::Actor::Property::SIZE_WIDTH == propertyIndex ) ||
- ( Dali::Actor::Property::SIZE_HEIGHT == propertyIndex ) ||
- ( Dali::Actor::Property::SIZE_DEPTH == propertyIndex ) )
-
- {
- maybeActor->NotifySizeAnimation( *this, targetFloat, propertyIndex );
- }
- }
- else
- {
- // Currently only FLOAT and VECTOR3 is supported for Target values in AnimateXXFunctions
- DALI_LOG_WARNING("Animation::Play Unsupported Value Type provided as TargetValue\n");
- }
- }
+ object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue );
}
}
}
// Remove all the connectors
mConnectors.Clear();
+ // Reset the connector target values
+ mConnectorTargetValues.clear();
+
// Replace the old scene-object with a new one
DestroySceneObject();
CreateSceneObject();
ExtendDuration( period );
+ // Store data to later notify the object that its property is being animated
+ ConnectorTargetValues connectorPair;
+ connectorPair.targetValue = destinationValue;
+ connectorPair.connectorIndex = mConnectors.Count();
+ connectorPair.timePeriod = period;
+ mConnectorTargetValues.push_back( connectorPair );
+
switch ( destinationType )
{
case Property::BOOLEAN:
case Property::FLOAT:
{
- if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex ) ||
- ( Dali::Actor::Property::SIZE_HEIGHT == targetPropertyIndex ) ||
- ( Dali::Actor::Property::SIZE_DEPTH == targetPropertyIndex ) ||
- ( Dali::Actor::Property::POSITION_X == targetPropertyIndex ) ||
- ( Dali::Actor::Property::POSITION_Y == targetPropertyIndex ) ||
- ( Dali::Actor::Property::POSITION_Z == targetPropertyIndex ) )
- {
-
- Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
- if ( maybeActor )
- {
- // Store data to later notify the actor that its size or position is being animated
- ConnectorTargetValues connectorPair;
- connectorPair.targetValue = destinationValue;
- connectorPair.connectorIndex = mConnectors.Count();
-
- mConnectorActorTargetValues.push_back( connectorPair );
- }
- }
-
AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
targetPropertyIndex,
componentIndex,
case Property::VECTOR3:
{
- if ( Dali::Actor::Property::SIZE == targetPropertyIndex || Dali::Actor::Property::POSITION == targetPropertyIndex )
- {
- // Test whether this is actually an Actor
- Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
- if ( maybeActor )
- {
- // Store data to later notify the actor that its size or position is being animated
- ConnectorTargetValues connectorPair;
- connectorPair.targetValue = destinationValue;
- connectorPair.connectorIndex = mConnectors.Count();
-
- mConnectorActorTargetValues.push_back( connectorPair );
- }
- }
-
AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
targetPropertyIndex,
componentIndex,
Dali::Animation handle( this );
mFinishedSignal.Emit( handle );
}
-
- // This callback is used internally, to avoid the overhead of using a signal.
- if ( mFinishedCallback )
- {
- mFinishedCallback( mFinishedCallbackObject );
- }
}
bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
return connected;
}
-void Animation::SetFinishedCallback( FinishedCallback callback, Object* object )
-{
- mFinishedCallback = callback;
- mFinishedCallbackObject = object;
-}
-
void Animation::AddAnimatorConnector( AnimatorConnectorBase* connector )
{
DALI_ASSERT_DEBUG( NULL != connector );
return mPlayRange;
}
+bool Animation::CompareConnectorEndTimes( const Animation::ConnectorTargetValues& lhs, const Animation::ConnectorTargetValues& rhs )
+{
+ return ( ( lhs.timePeriod.delaySeconds + lhs.timePeriod.durationSeconds ) < ( rhs.timePeriod.delaySeconds + rhs.timePeriod.durationSeconds ) );
+}
} // namespace Internal
typedef Dali::Animation::EndAction EndAction;
typedef Dali::Animation::Interpolation Interpolation;
- typedef void (*FinishedCallback)(Object* object);
-
/**
* Create a new Animation object.
* @param[in] durationSeconds The duration of the animation.
static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes);
/**
- * This callback is intended for internal use only, to avoid the overhead of using a signal.
- * @param[in] callback The callback function to connect.
- * @param[in] object The internal object requesting the callback, or NULL.
- */
- void SetFinishedCallback( FinishedCallback callback, Object* object );
-
- /**
* @copydoc Dali::Animation::AnimateBy(Property target, Property::Value relativeValue)
*/
void AnimateBy(Property& target, Property::Value& relativeValue);
struct ConnectorTargetValues
{
- unsigned int connectorIndex;
+ ConnectorTargetValues()
+ : targetValue(),
+ timePeriod( 0.0f ),
+ connectorIndex( 0 )
+ {
+ }
+
Property::Value targetValue;
+ TimePeriod timePeriod;
+ unsigned int connectorIndex;
};
- EventThreadServices& mEventThreadServices;
- AnimationPlaylist& mPlaylist;
+private:
+
+ /**
+ * Compares the end times of the animators returning true if lhs end time is less than rhs end time.
+ * @param[in] lhs The first comparator
+ * @param[in] rhs The second comparator
+ * @return True if end time of lhs is less, false otherwise.
+ */
+ static bool CompareConnectorEndTimes( const ConnectorTargetValues& lhs, const ConnectorTargetValues& rhs );
+
+private:
const SceneGraph::Animation* mAnimation;
- int mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
+ EventThreadServices& mEventThreadServices;
+ AnimationPlaylist& mPlaylist;
Dali::Animation::AnimationSignalType mFinishedSignal;
- FinishedCallback mFinishedCallback;
- Object* mFinishedCallbackObject;
-
AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
- std::vector< ConnectorTargetValues > mConnectorActorTargetValues; //< Store Actor target values and matchinf connector index that need to set value on Animation::Play
+ typedef std::vector< ConnectorTargetValues > ConnectorTargetValuesContainer;
+ ConnectorTargetValuesContainer mConnectorTargetValues; //< Used to store animating property target value information
+
+ Vector2 mPlayRange;
- // Cached for public getters
float mDurationSeconds;
float mSpeedFactor;
+ int mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
int mLoopCount;
int mCurrentLoop;
- Vector2 mPlayRange;
EndAction mEndAction;
EndAction mDisconnectAction;
AlphaFunction mDefaultAlpha;
Dali::Animation::State mState;
-
};
} // namespace Internal
{
segment = t * numSegs;
float segLength = 1.0f / numSegs;
- float segStart = (float)segment * segLength;
+ float segStart = static_cast<float>( segment ) * segLength;
tLocal = (t - segStart) * numSegs;
}
}
}
}
+void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+{
+ if ( index < DEFAULT_PROPERTY_MAX_COUNT )
+ {
+ OnNotifyDefaultPropertyAnimation( animation, index, value );
+ }
+ else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+ {
+ AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index );
+ if( animatableProperty )
+ {
+ // update the cached property value
+ animatableProperty->SetPropertyValue( value );
+ }
+ }
+ else
+ {
+ CustomPropertyMetadata* custom = FindCustomProperty( index );
+ if( custom && custom->IsAnimatable() )
+ {
+ // update the cached property value
+ custom->SetPropertyValue( value );
+ }
+ }
+}
+
void Object::EnablePropertyNotifications()
{
if( mPropertyNotifications )
int arrayIndex = index - PROPERTY_CUSTOM_START_INDEX;
if( arrayIndex >= 0 )
{
- if( arrayIndex < (int)mCustomProperties.Count() ) // we can only access the first 2 billion custom properties
+ if( arrayIndex < static_cast<int>( mCustomProperties.Count() ) ) // we can only access the first 2 billion custom properties
{
property = static_cast<CustomPropertyMetadata*>(mCustomProperties[ arrayIndex ]);
}
AnimatablePropertyMetadata* Object::FindAnimatableProperty( Property::Index index ) const
{
- for ( int arrayIndex = 0; arrayIndex < (int)mAnimatableProperties.Count(); arrayIndex++ )
+ const PropertyMetadataLookup::SizeType count = mAnimatableProperties.Count();
+ for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
{
AnimatablePropertyMetadata* property = static_cast<AnimatablePropertyMetadata*>( mAnimatableProperties[ arrayIndex ] );
if( property->index == index )
if( parentTypeInfo )
{
// Go through each custom property
- for ( int arrayIndex = 0; arrayIndex < (int)mCustomProperties.Count(); arrayIndex++ )
+ const PropertyMetadataLookup::SizeType count = mCustomProperties.Count();
+ for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
{
CustomPropertyMetadata* customProperty = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );
namespace Internal
{
+class Animation;
class ConstraintBase;
class EventThreadServices;
class Handle;
*/
virtual void RemovePropertyNotifications();
+ /**
+ * Notifies that a property is being animated.
+ * @param[in] animation The animation animating the property.
+ * @param[in] index The index of the property.
+ * @param[in] value The value of the property after the animation.
+ */
+ void NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+
/******************************** Uniform Mappings ********************************/
/**
virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const = 0;
/**
+ * Notifies that a default property is being animated so the deriving class should update the cached value.
+ * @param[in] animation The animation animating the property.
+ * @param[in] index The index of the property.
+ * @param[in] value The value of the property after the animation.
+ */
+ virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+ { }
+
+ /**
* @todo this is virtual so that for now actor can override it,
* it needs to be removed and only have GetSceneObject but that requires changing actor and constraint logic
* Retrieve the scene-graph object added by this object.
mViewMode( MONO ),
mStereoBase( DEFAULT_STEREO_BASE ),
mTopMargin( 0 ),
- mSystemOverlay(NULL)
+ mSystemOverlay(NULL),
+ mDepthTreeDirty( false )
{
}
} // unnamed namespace
+HitTestInterface::~HitTestInterface()
+{
+}
+
bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func )
{
bool wasHit( false );
* @return true if the layer should consume the hit, false otherwise.
*/
virtual bool DoesLayerConsumeHit( Layer* layer ) = 0;
+
+protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~HitTestInterface();
+
};
/**
/*
- * 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.
DALI_LOG_INFO( gLogFilter, Debug::General, " State(%s), Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
TOUCH_POINT_STATE[iter->GetState()], iter->GetScreenPosition().x, iter->GetScreenPosition().y,
- ( hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL ),
+ ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
( hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" ),
hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
Dali::Actor primaryHitActor = primaryPoint.hitActor;
TouchPoint::State primaryPointState = primaryPoint.state;
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor: (%p) %s\n", primaryPoint.hitActor ? (void*)&primaryPoint.hitActor.GetBaseObject() : NULL, primaryPoint.hitActor ? primaryPoint.hitActor.GetName().c_str() : "" );
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? (void*)&consumedActor.GetBaseObject() : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor: (%p) %s\n", primaryPoint.hitActor ? reinterpret_cast< void* >( &primaryPoint.hitActor.GetBaseObject() ) : NULL, primaryPoint.hitActor ? primaryPoint.hitActor.GetName().c_str() : "" );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
if ( ( primaryPointState == TouchPoint::Started ) &&
( hoverEvent.GetPointCount() == 1 ) &&
{
if ( lastPrimaryHitActor->GetLeaveRequired() )
{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit): (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit): (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
leaveEventConsumer = EmitHoverSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, hoverEvent, TouchPoint::Leave );
}
}
{
// At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one.
// An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit): (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit): (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
leaveEventConsumer = EmitHoverSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, hoverEvent, TouchPoint::Interrupted );
}
}
{
if( lastConsumedActor->GetLeaveRequired() )
{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
EmitHoverSignals( lastConsumedActor, lastRenderTaskImpl, hoverEvent, TouchPoint::Leave );
}
}
{
// At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one.
// An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume): (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
EmitHoverSignals( mLastConsumedActor.GetActor(), lastRenderTaskImpl, hoverEvent, TouchPoint::Interrupted );
}
}
/*
- * 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.
DALI_LOG_INFO( gLogFilter, Debug::General, " State(%s), Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
TOUCH_POINT_STATE[iter->GetState()], iter->GetScreenPosition().x, iter->GetScreenPosition().y,
- ( hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL ),
+ ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
( hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" ),
hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
Dali::Actor primaryHitActor = primaryPoint.GetHitActor();
PointState::Type primaryPointState = primaryPoint.GetState();
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor: (%p) %s\n", primaryHitActor ? (void*)&primaryHitActor.GetBaseObject() : NULL, primaryHitActor ? primaryHitActor.GetName().c_str() : "" );
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? (void*)&consumedActor.GetBaseObject() : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "PrimaryHitActor: (%p) %s\n", primaryHitActor ? reinterpret_cast< void* >( &primaryHitActor.GetBaseObject() ) : NULL, primaryHitActor ? primaryHitActor.GetName().c_str() : "" );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
if ( ( primaryPointState == PointState::DOWN ) &&
( touchEvent.GetPointCount() == 1 ) &&
{
if ( lastPrimaryHitActor->GetLeaveRequired() )
{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit): (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Hit): (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::LEAVE );
}
}
{
// At this point mLastPrimaryHitActor was touchable and sensitive in the previous touch event process but is not in the current one.
// An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit): (%p) %s\n", (void*)lastPrimaryHitActor, lastPrimaryHitActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Hit): (%p) %s\n", reinterpret_cast< void* >( lastPrimaryHitActor ), lastPrimaryHitActor->GetName().c_str() );
leaveEventConsumer = EmitTouchSignals( mLastPrimaryHitActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::INTERRUPTED );
}
}
{
if( lastConsumedActor->GetLeaveRequired() )
{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "LeaveActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
EmitTouchSignals( lastConsumedActor, lastRenderTaskImpl, touchEvent, touchData, PointState::LEAVE );
}
}
{
// At this point mLastConsumedActor was touchable and sensitive in the previous touch event process but is not in the current one.
// An interrupted event is send to allow some actors to go back to their original state (i.e. Button controls)
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume): (%p) %s\n", (void*)lastConsumedActor, lastConsumedActor->GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "InterruptedActor(Consume): (%p) %s\n", reinterpret_cast< void* >( lastConsumedActor ), lastConsumedActor->GetName().c_str() );
EmitTouchSignals( mLastConsumedActor.GetActor(), lastRenderTaskImpl, touchEvent, touchData, PointState::INTERRUPTED );
}
}
/*
- * 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.
DALI_LOG_INFO( gLogFilter, Debug::General, " Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
event.point.x, event.point.y,
- ( hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL ),
+ ( hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL ),
( hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" ),
hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y );
// Recursively deliver events to the actor and its parents, until the event is consumed or the stage is reached.
Dali::Actor consumedActor = EmitWheelSignals( hitTestResults.actor, wheelEvent );
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "HitActor: (%p) %s\n", hitTestResults.actor ? (void*)&hitTestResults.actor.GetBaseObject() : NULL, hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" );
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? (void*)&consumedActor.GetBaseObject() : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "HitActor: (%p) %s\n", hitTestResults.actor ? reinterpret_cast< void* >( &hitTestResults.actor.GetBaseObject() ) : NULL, hitTestResults.actor ? hitTestResults.actor.GetName().c_str() : "" );
+ DALI_LOG_INFO( gLogFilter, Debug::Concise, "ConsumedActor: (%p) %s\n", consumedActor ? reinterpret_cast< void* >( &consumedActor.GetBaseObject() ) : NULL, consumedActor ? consumedActor.GetName().c_str() : "" );
}
else
{
/*
- * 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.
// Get image size from buffer
Dali::Integration::PlatformAbstraction& platformAbstraction = Internal::ThreadLocalStorage::Get().GetPlatformAbstraction();
const ImageDimensions expectedSize = platformAbstraction.GetClosestImageSize( buffer, size, fittingMode, samplingMode, orientationCorrection );
- image->mWidth = (unsigned int) expectedSize.GetWidth();
- image->mHeight = (unsigned int) expectedSize.GetHeight();
+ image->mWidth = static_cast<unsigned int>( expectedSize.GetWidth() );
+ image->mHeight = static_cast<unsigned int>( expectedSize.GetHeight() );
// Load the image synchronously
Integration::BitmapPtr bitmap = platformAbstraction.DecodeBuffer( resourceType, &(buffer->GetVector()[0]), encodedImageByteCount );
return value;
}
+void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+{
+ switch ( index )
+ {
+ case Dali::RenderTask::Property::VIEWPORT_POSITION:
+ {
+ value.Get( mViewportPosition );
+ break;
+ }
+ case Dali::RenderTask::Property::VIEWPORT_SIZE:
+ {
+ value.Get( mViewportSize );
+ break;
+ }
+ case Dali::RenderTask::Property::CLEAR_COLOR:
+ {
+ value.Get( mClearColor );
+ break;
+ }
+ case Dali::RenderTask::Property::REQUIRES_SYNC:
+ default:
+ {
+ // Nothing to do as not animatable
+ break;
+ }
+ }
+}
+
const SceneGraph::PropertyOwner* RenderTask::GetSceneObject() const
{
return mSceneObject;
virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
/**
+ * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
+ */
+ virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value );
+
+ /**
* @copydoc Dali::Internal::Object::GetSceneObject()
*/
virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
/*
- * 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.
void FrameBuffer::AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer )
{
- if( (unsigned int)( texture->GetWidth() / ( 1 << mipmapLevel ) ) == mWidth &&
- (unsigned int)( texture->GetHeight() / ( 1 << mipmapLevel ) ) == mHeight )
+ if( ( texture->GetWidth() / ( 1u << mipmapLevel ) == mWidth ) &&
+ ( texture->GetHeight() / ( 1u << mipmapLevel ) == mHeight ) )
{
mColor = texture;
AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
/*
- * 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.
{
if( NULL != mRenderObject )
{
- SetFilterModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, (unsigned int)minFilter, (unsigned int)magFilter );
+ SetFilterModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, static_cast< unsigned int >( minFilter ), static_cast< unsigned int >( magFilter ) );
}
}
{
if( NULL != mRenderObject )
{
- SetWrapModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, (unsigned int)rWrap, (unsigned int)sWrap, (unsigned int)tWrap );
+ SetWrapModeMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, static_cast< unsigned int >( rWrap ), static_cast< unsigned int >( sWrap ), static_cast< unsigned int >( tWrap ) );
}
}
// has to fill with all the actors it has not done any size negotiation for.
actorImpl.NegotiateSize( size, *mRelayoutStack );
+
+ // Reset the flag so that size negotiation will respect the actor's original resize policy
+ actorImpl.SetUseAssignedSize( false );
}
}
void RemoveRenderTracker( Render::RenderTracker* renderTracker )
{
- DALI_ASSERT_DEBUG( renderTracker != NULL );
- for(RenderTrackerIter iter = mRenderTrackers.Begin(), end = mRenderTrackers.End(); iter != end; ++iter)
- {
- if( *iter == renderTracker )
- {
- mRenderTrackers.Erase( iter );
- break;
- }
- }
+ mRenderTrackers.EraseObject( renderTracker );
}
void UpdateTrackers()
void RenderManager::RemoveRenderer( Render::Renderer* renderer )
{
- DALI_ASSERT_DEBUG( NULL != renderer );
-
- RendererOwnerContainer& renderers = mImpl->rendererContainer;
-
- // Find the renderer
- for ( RendererOwnerIter iter = renderers.Begin(); iter != renderers.End(); ++iter )
- {
- if ( *iter == renderer )
- {
- renderers.Erase( iter ); // Renderer found; now destroy it
- break;
- }
- }
+ mImpl->rendererContainer.EraseObject( renderer );
}
void RenderManager::AddSampler( Render::Sampler* sampler )
void RenderManager::RemoveSampler( Render::Sampler* sampler )
{
- DALI_ASSERT_DEBUG( NULL != sampler );
-
- SamplerOwnerContainer& samplers = mImpl->samplerContainer;
-
- // Find the sampler
- for ( SamplerOwnerIter iter = samplers.Begin(); iter != samplers.End(); ++iter )
- {
- if ( *iter == sampler )
- {
- samplers.Erase( iter ); // Sampler found; now destroy it
- break;
- }
- }
+ mImpl->samplerContainer.EraseObject( sampler );
}
void RenderManager::AddTexture( Render::Texture* texture )
void RenderManager::RemovePropertyBuffer( Render::PropertyBuffer* propertyBuffer )
{
- DALI_ASSERT_DEBUG( NULL != propertyBuffer );
-
- PropertyBufferOwnerContainer& propertyBuffers = mImpl->propertyBufferContainer;
-
- // Find the sampler
- for ( PropertyBufferOwnerIter iter = propertyBuffers.Begin(); iter != propertyBuffers.End(); ++iter )
- {
- if ( *iter == propertyBuffer )
- {
- propertyBuffers.Erase( iter ); // Property buffer found; now destroy it
- break;
- }
- }
+ mImpl->propertyBufferContainer.EraseObject( propertyBuffer );
}
void RenderManager::SetPropertyBufferFormat(Render::PropertyBuffer* propertyBuffer, Render::PropertyBuffer::Format* format )
void RenderManager::RemoveGeometry( Render::Geometry* geometry )
{
- DALI_ASSERT_DEBUG( NULL != geometry );
-
- GeometryOwnerContainer& geometries = mImpl->geometryContainer;
-
- // Find the geometry
- for ( GeometryOwnerIter iter = geometries.Begin(); iter != geometries.End(); ++iter )
- {
- if ( *iter == geometry )
- {
- geometries.Erase( iter ); // Geometry found; now destroy it
- break;
- }
- }
+ mImpl->geometryContainer.EraseObject( geometry );
}
void RenderManager::AddVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer )
#define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
/*
- * Copyright (c) 2015 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.
// INTERNAL INCLUDES
#include <dali/public-api/object/property.h>
-#include <dali/integration-api/resource-declarations.h>
#include <dali/internal/common/buffer-index.h>
namespace Dali
#define DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_DATA_PROVIDER_H
/*
- * Copyright (c) 2015 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.
* limitations under the License.
*/
#include <dali/public-api/common/dali-vector.h>
-#include <dali/integration-api/resource-declarations.h>
#include <dali/internal/common/buffer-index.h>
namespace Dali
#define __DALI_INTERNAL_CONTEXT_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.
*/
void PrintGlString(const char* stringName, GLenum stringId)
{
- DALI_LOG_INFO(Debug::Filter::gRender, Debug::General, "GL %s = %s\n", stringName, (const char *)GetString( stringId ) );
+ DALI_LOG_INFO(Debug::Filter::gRender, Debug::General, "GL %s = %s\n", stringName, reinterpret_cast< const char * >( GetString( stringId ) ) );
}
/****************************************************************************************
// Create a color attachment.
if( texture->GetType() == TextureType::TEXTURE_2D )
{
- context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+ if( !texture->IsNativeImage() )
+ {
+ context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->GetId(), mipmapLevel );
+ }
+ else
+ {
+ // If it's a native image we need to use GL_TEXTURE_EXTERNAL_OES as the texture target parameter
+ context.FramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_EXTERNAL_OES, texture->GetId(), mipmapLevel );
+ }
}
else
{
#define DALI_INTERNAL_RENDER_FRAME_BUFFER_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.
#include <dali/internal/render/gl-resources/context.h>
#include <dali/internal/render/renderers/render-sampler.h>
#include <dali/integration-api/gl-defines.h>
-#include <dali/integration-api/resource-declarations.h>
namespace Dali
{
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
#include <dali/internal/render/renderers/render-property-buffer.h>
#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
GetPropertyImplementationGlType(attributeType),
GL_FALSE, // Not normalized
elementSize,
- (void*)attributeOffset );
+ reinterpret_cast< void* >( attributeOffset ) );
}
}
Program* program = mRenderDataProvider->GetShader().GetProgram();
if( !program )
{
- DALI_LOG_ERROR( "Failed to get program for shader at address %p.\n", (void*)&mRenderDataProvider->GetShader() );
+ DALI_LOG_ERROR( "Failed to get program for shader at address %p.\n", reinterpret_cast< void* >( &mRenderDataProvider->GetShader() ) );
return;
}
return mType;
}
+ /**
+ * Check if the texture is a native image
+ * @return if the texture is a native image
+ */
+ bool IsNativeImage() const
+ {
+ return mNativeImage;
+ }
+
private:
/**
NativeImageInterfacePtr mNativeImage; ///< Pointer to native image
GLenum mInternalFormat; ///< The format of the pixel data
GLenum mPixelDataType; ///< The data type of the pixel data
- unsigned int mWidth; ///< Widht of the texture
+ unsigned int mWidth; ///< Width of the texture
unsigned int mHeight; ///< Height of the texture
bool mHasAlpha : 1; ///< Whether the format has an alpha channel
bool mIsCompressed : 1; ///< Whether the format is compressed
/*
- * 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.
for( int i=0; i<numberOfActiveUniforms; ++i )
{
- mGlAbstraction.GetActiveUniform( mProgramId, (GLuint)i, uniformMaxNameLength,
+ mGlAbstraction.GetActiveUniform( mProgramId, static_cast< GLuint >( i ), uniformMaxNameLength,
&nameLength, &number, &type, name );
- if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE ) /// Is there a native sampler type?
+ if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE || type == GL_SAMPLER_EXTERNAL_OES )
{
GLuint location = mGlAbstraction.GetUniformLocation( mProgramId, name );
samplerNames.push_back(name);
int samplerPosition = 0;
while( token )
{
- if( ( strncmp( token, "sampler2D", 9u ) == 0 ) || ( strncmp( token, "samplerCube", 11u ) == 0 ) )
+ if( ( strncmp( token, "sampler2D", 9u ) == 0 ) ||
+ ( strncmp( token, "samplerCube", 11u ) == 0 ) ||
+ ( strncmp( token, "samplerExternalOES", 18u ) == 0 ) )
{
bool found( false );
token = strtok_r( NULL, " ;\n", &nextPtr );
/*
- * 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.
}
}
+/// Compares the end times of the animators and if the end time is less, then it is moved earlier in the list. If end times are the same, then no change.
+bool CompareAnimatorEndTimes( const Dali::Internal::SceneGraph::AnimatorBase* lhs, const Dali::Internal::SceneGraph::AnimatorBase* rhs )
+{
+ return ( ( lhs->GetInitialDelay() + lhs->GetDuration() ) < ( rhs->GetInitialDelay() + rhs->GetDuration() ) );
}
+} // unnamed namespace
+
namespace Dali
{
void Animation::Play()
{
+ // Sort according to end time with earlier end times coming first, if the end time is the same, then the animators are not moved
+ std::stable_sort( mAnimators.Begin(), mAnimators.End(), CompareAnimatorEndTimes );
+
mState = Playing;
if ( mSpeedFactor < 0.0f && mElapsedSeconds <= mPlayRange.x*mDurationSeconds )
#define __DALI_INTERNAL_SCENE_GRAPH_ANIMATOR_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.
* Retrieve the duration of the animator.
* @return The duration in seconds.
*/
- float GetDuration()
+ float GetDuration() const
{
return mDurationSeconds;
}
* Retrieve the initial delay of the animator.
* @return The delay in seconds.
*/
- float GetInitialDelay()
+ float GetInitialDelay() const
{
return mInitialDelaySeconds;
}
{
}
+ using AnimatorFunctionBase::operator();
float operator()(float alpha, const int& property)
{
return int(property + mRelative * alpha + 0.5f );
{
}
+ using AnimatorFunctionBase::operator();
float operator()(float alpha, const int& property)
{
return int(property + ((mTarget - property) * alpha) + 0.5f);
{
}
+ using AnimatorFunctionBase::operator();
float operator()(float alpha, const float& property)
{
return float(property + mRelative * alpha);
{
}
+ using AnimatorFunctionBase::operator();
float operator()(float alpha, const float& property)
{
return float(property + ((mTarget - property) * alpha));
{
}
+ using AnimatorFunctionBase::operator();
Vector2 operator()(float alpha, const Vector2& property)
{
return Vector2(property + mRelative * alpha);
{
}
+ using AnimatorFunctionBase::operator();
Vector2 operator()(float alpha, const Vector2& property)
{
return Vector2(property + ((mTarget - property) * alpha));
{
}
+ using AnimatorFunctionBase::operator();
Vector3 operator()(float alpha, const Vector3& property)
{
return Vector3(property + mRelative * alpha);
{
}
+ using AnimatorFunctionBase::operator();
Vector3 operator()(float alpha, const Vector3& property)
{
return Vector3(property + ((mTarget - property) * alpha));
{
}
+ using AnimatorFunctionBase::operator();
Vector4 operator()(float alpha, const Vector4& property)
{
return Vector4(property + mRelative * alpha);
{
}
+ using AnimatorFunctionBase::operator();
Vector4 operator()(float alpha, const Vector4& property)
{
return Vector4(property + ((mTarget - property) * alpha));
{
}
+ using AnimatorFunctionBase::operator();
Vector4 operator()(float alpha, const Vector4& property)
{
Vector4 result(property);
{
}
+ using AnimatorFunctionBase::operator();
Vector4 operator()(float alpha, const Vector4& property)
{
Vector4 result(property);
{
}
+ using AnimatorFunctionBase::operator();
bool operator()(float alpha, const bool& property)
{
// Alpha is not useful here, just keeping to the same template as other update functors
{
}
+ using AnimatorFunctionBase::operator();
bool operator()(float alpha, const bool& property)
{
// Alpha is not useful here, just keeping to the same template as other update functors
{
}
+ using AnimatorFunctionBase::operator();
Quaternion operator()(float alpha, const Quaternion& rotation)
{
if (alpha > 0.0f)
{
}
+ using AnimatorFunctionBase::operator();
Quaternion operator()(float alpha, const Quaternion& rotation)
{
return Quaternion::Slerp(rotation, mTarget, alpha);
{
}
+ using AnimatorFunctionBase::operator();
bool operator()(float progress, const bool& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
float operator()(float progress, const int& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
float operator()(float progress, const float& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
Vector2 operator()(float progress, const Vector2& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
Vector3 operator()(float progress, const Vector3& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
Vector4 operator()(float progress, const Vector4& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
Quaternion operator()(float progress, const Quaternion& property)
{
if(mKeyFrames->IsActive(progress))
{
}
+ using AnimatorFunctionBase::operator();
Vector3 operator()(float progress, const Vector3& property)
{
Vector3 position(property);
mForward.Normalize();
}
+ using AnimatorFunctionBase::operator();
Quaternion operator()(float progress, const Quaternion& property)
{
Vector3 tangent;
* may not be called (i.e. when shutting down).
*/
virtual void PropertyOwnerDestroyed( PropertyOwner& owner ) = 0;
+
+ protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~Observer() {}
+
};
/**
* Inform the observer of the object that the object is about to be destroyed
*/
virtual void ObservedObjectDestroyed(PropertyOwner& object){}
+
+ protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~Observer() {}
+
};
/**
class Observer
{
public:
+
+ /**
+ * Inform observer that uniform mappings have been changed
+ * @param mappings
+ */
virtual void UniformMappingsChanged(const UniformMap& mappings) = 0;
+
+ protected:
+
+ /**
+ * Virtual destructor, no deletion through this interface
+ */
+ virtual ~Observer() {}
};
/**
/*
- * 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.
++iter;
continue;
}
- float previousValueWeight = (float)(MAX_GESTURE_AGE - (lastVSyncTime - lastTime)) / (float)MAX_GESTURE_AGE;
+ float previousValueWeight = ( static_cast< float >( MAX_GESTURE_AGE ) - (lastVSyncTime - lastTime) ) / static_cast< float >( MAX_GESTURE_AGE );
float velMag = currentGesture.screen.velocity.Length();
float velDiff = velMag - screenVelocity.Length();
float acceleration = 0.0f;
#define DALI_INTERNAL_SCENE_GRAPH_RENDER_INSTRUCTION_PROCESSOR_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.
// INTERNAL INCLUDES
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/update/manager/sorted-layers.h>
-#include <dali/integration-api/resource-declarations.h>
#include <dali/public-api/common/dali-vector.h>
namespace Dali
template < class T >
inline void EraseUsingDiscardQueue( OwnerContainer<T*>& container, T* object, DiscardQueue& discardQueue, BufferIndex updateBufferIndex )
{
+ DALI_ASSERT_DEBUG( object && "NULL object not allowed" );
+
typename OwnerContainer<T*>::Iterator iter = container.Begin();
const typename OwnerContainer<T*>::ConstIterator endIter = container.End();
for ( ; iter != endIter; ++iter )
void UpdateManager::RemoveObject( PropertyOwner* object )
{
- DALI_ASSERT_DEBUG( NULL != object );
-
- OwnerContainer< PropertyOwner* >& customObjects = mImpl->customObjects;
-
- // Find the object and destroy it
- for ( OwnerContainer< PropertyOwner* >::Iterator iter = customObjects.Begin(); iter != customObjects.End(); ++iter )
- {
- PropertyOwner* current = *iter;
- if ( current == object )
- {
- customObjects.Erase( iter );
- return;
- }
- }
-
- // Should not reach here
- DALI_ASSERT_DEBUG(false);
+ mImpl->customObjects.EraseObject( object );
}
void UpdateManager::AddAnimation( Animation* animation )
void UpdateManager::RemovePropertyNotification( PropertyNotification* propertyNotification )
{
- PropertyNotificationContainer &propertyNotifications = mImpl->propertyNotifications;
- PropertyNotificationIter iter = propertyNotifications.Begin();
-
- while ( iter != propertyNotifications.End() )
- {
- if( *iter == propertyNotification )
- {
- propertyNotifications.Erase(iter);
- break;
- }
- ++iter;
- }
+ mImpl->propertyNotifications.EraseObject( propertyNotification );
}
void UpdateManager::PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode )
void UpdateManager::RemoveShader( Shader* shader )
{
- DALI_ASSERT_DEBUG(shader != NULL);
-
// Find the shader and destroy it
EraseUsingDiscardQueue( mImpl->shaders, shader, mImpl->discardQueue, mSceneGraphBuffers.GetUpdateBufferIndex() );
}
void UpdateManager::RemoveRenderer( Renderer* renderer )
{
- DALI_ASSERT_DEBUG( renderer != NULL );
-
- renderer->DisconnectFromSceneGraph( *mImpl->sceneController, mSceneGraphBuffers.GetUpdateBufferIndex() );
-
// Find the renderer and destroy it
EraseUsingDiscardQueue( mImpl->renderers, renderer, mImpl->discardQueue, mSceneGraphBuffers.GetUpdateBufferIndex() );
+ // Need to remove the render object as well
+ renderer->DisconnectFromSceneGraph( *mImpl->sceneController, mSceneGraphBuffers.GetUpdateBufferIndex() );
}
void UpdateManager::SetPanGestureProcessor( PanGesture* panGestureProcessor )
void UpdateManager::AddTextureSet( TextureSet* textureSet )
{
DALI_ASSERT_DEBUG( NULL != textureSet );
+
mImpl->textureSets.PushBack( textureSet );
}
void UpdateManager::RemoveTextureSet( TextureSet* textureSet )
{
- DALI_ASSERT_DEBUG( textureSet != NULL );
-
- // Find the texture and destroy it
- TextureSetOwner& textures = mImpl->textureSets;
- for ( TextureSetIter iter = textures.Begin(), endIter = textures.End(); iter != endIter; ++iter )
- {
- if ( *iter == textureSet )
- {
- textures.Erase( iter );
- return;
- }
- }
+ mImpl->textureSets.EraseObject( textureSet );
}
RenderTaskList* UpdateManager::GetRenderTaskList( bool systemLevel )
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/common/dali-common.h>
-#include <dali/integration-api/resource-declarations.h>
-
#include <dali/internal/common/message.h>
#include <dali/internal/common/type-abstraction-enums.h>
#include <dali/internal/common/shader-saver.h>
#define __DALI_ANIMATION_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.
* The overall animation time is superseded by the values given in the TimePeriod structure used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and Animate() methods.
* If any of the individual calls to those functions exceeds the overall animation time, then the overall animation time is automatically extended.
*
+ * Using AnimateTo and AnimateBy for the same property of the same Actor will yield undefined behaviour especially if the TimePeriod overlaps.
+ *
+ * After calling Animation::Play(), Handle::GetProperty will return the target value of the animated property.
+ *
* Signals
* | %Signal Name | Method |
* |--------------|--------------------------|
/*
- * Copyright (c) 2015 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.
size_t tokenLength = endOfToken - startOfToken;
// Allocate space for symbol
- char *mangledSymbol = (char*)malloc(tokenLength+1u);
+ char *mangledSymbol = reinterpret_cast< char* >( malloc( tokenLength + 1u ) );
if(mangledSymbol != NULL)
{
strncpy(mangledSymbol, startOfToken, tokenLength);
/*
- * Copyright (c) 2015 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.
if( capacity > oldCapacity )
{
const SizeType wholeAllocation = sizeof(SizeType) * 2u + capacity * elementSize;
- void* wholeData = (void*) new unsigned char[ wholeAllocation ];
+ void* wholeData = reinterpret_cast< void* >( new unsigned char[ wholeAllocation ] );
DALI_ASSERT_ALWAYS( wholeData && "VectorBase::Reserve - Memory allocation failed" );
#if defined( DEBUG_ENABLED )
const unsigned int CORE_MAJOR_VERSION = 1;
const unsigned int CORE_MINOR_VERSION = 2;
-const unsigned int CORE_MICRO_VERSION = 39;
+const unsigned int CORE_MICRO_VERSION = 40;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifndef EMSCRIPTEN
/*
- * Copyright (c) 2015 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.
float Quaternion::Length() const
{
- return (float)sqrt(mVector.w * mVector.w + mVector.Dot(mVector));
+ return static_cast< float >( sqrt(mVector.w * mVector.w + mVector.Dot(mVector) ) );
}
float Quaternion::LengthSquared() const
{
- return (float)(mVector.w * mVector.w + mVector.Dot(mVector));
+ return static_cast< float >( mVector.w * mVector.w + mVector.Dot(mVector) );
}
void Quaternion::Normalize()
Name: dali
Summary: The OpenGLES Canvas Core Library
-Version: 1.2.39
+Version: 1.2.40
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT