X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Actor.cpp;h=a897ae13925b218bf03ea2c2fedfecca04dc6e9f;hb=032363632332b2657f0afe41d1b47ead0621b374;hp=01419e2fb824749e32839aef7058eedc44c92c07;hpb=21563e4f34805ea1285ed3eba4bdb0393bd9e336;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 01419e2..a897ae1 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -18,23 +18,26 @@ // Enable debug log for test coverage #define DEBUG_ENABLED 1 -#include "assert.h" -#include -#include -#include // For FLT_MAX +#include #include -#include -#include +#include #include -#include +#include +#include +#include #include +#include + +#include // For FLT_MAX +#include + +#include "assert.h" //& set: DaliActor using std::string; using namespace Dali; - void utc_dali_actor_startup(void) { test_return_value = TET_UNDEF; @@ -47,11 +50,11 @@ void utc_dali_actor_cleanup(void) namespace { -bool gTouchCallBackCalled=false; -bool gTouchCallBackCalled2=false; -bool gTouchCallBackCalled3=false; +bool gTouchCallBackCalled = false; +bool gTouchCallBackCalled2 = false; +bool gTouchCallBackCalled3 = false; -bool gHoverCallBackCalled=false; +bool gHoverCallBackCalled = false; static bool gTestConstraintCalled; @@ -59,7 +62,7 @@ LayoutDirection::Type gLayoutDirectionType; struct TestConstraint { - void operator()( Vector4& color, const PropertyInputContainer& /* inputs */ ) + void operator()(Vector4& color, const PropertyInputContainer& /* inputs */) { gTestConstraintCalled = true; } @@ -79,16 +82,15 @@ struct TestConstraintRef { } - void operator()( T& current, const PropertyInputContainer& /* inputs */ ) + void operator()(T& current, const PropertyInputContainer& /* inputs */) { mResultRef = mValue; } unsigned int& mResultRef; - unsigned int mValue; + unsigned int mValue; }; - static bool TestTouchCallback(Actor, const TouchEvent&) { gTouchCallBackCalled = true; @@ -112,7 +114,7 @@ static bool TestTouchCallback3(Actor, const TouchEvent&) static void ResetTouchCallbacks() { - gTouchCallBackCalled = false; + gTouchCallBackCalled = false; gTouchCallBackCalled2 = false; gTouchCallBackCalled3 = false; } @@ -125,65 +127,69 @@ static bool TestCallback3(Actor actor, const HoverEvent& event) } // validation stuff for onstage & offstage signals -static std::vector< std::string > gActorNamesOnOffScene; -static int gOnSceneCallBackCalled; -void OnSceneCallback( Actor actor ) +static std::vector gActorNamesOnOffScene; +static int gOnSceneCallBackCalled; +void OnSceneCallback(Actor actor) { ++gOnSceneCallBackCalled; - gActorNamesOnOffScene.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) ); - DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true ); + gActorNamesOnOffScene.push_back(actor.GetProperty(Actor::Property::NAME)); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE) == true); } static int gOffSceneCallBackCalled; -void OffSceneCallback( Actor actor ) +void OffSceneCallback(Actor actor) { ++gOffSceneCallBackCalled; - gActorNamesOnOffScene.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) ); - DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == false ); + gActorNamesOnOffScene.push_back(actor.GetProperty(Actor::Property::NAME)); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE) == false); } struct PositionComponentConstraint { - PositionComponentConstraint(){} + PositionComponentConstraint() + { + } - void operator()( Vector3& pos, const PropertyInputContainer& inputs ) + void operator()(Vector3& pos, const PropertyInputContainer& inputs) { const Matrix& m = inputs[0]->GetMatrix(); - Vector3 scale; - Quaternion rot; + Vector3 scale; + Quaternion rot; m.GetTransformComponents(pos, rot, scale); } }; struct OrientationComponentConstraint { - OrientationComponentConstraint(){} + OrientationComponentConstraint() + { + } - void operator()( Quaternion& orientation, const PropertyInputContainer& inputs ) + void operator()(Quaternion& orientation, const PropertyInputContainer& inputs) { const Quaternion& parentOrientation = inputs[0]->GetQuaternion(); - Vector3 pos, scale; - Quaternion rot; + Vector3 pos, scale; + Quaternion rot; orientation = parentOrientation; } }; // OnRelayout -static bool gOnRelayoutCallBackCalled = false; -static std::vector< std::string > gActorNamesRelayout; +static bool gOnRelayoutCallBackCalled = false; +static std::vector gActorNamesRelayout; -void OnRelayoutCallback( Actor actor ) +void OnRelayoutCallback(Actor actor) { gOnRelayoutCallBackCalled = true; - gActorNamesRelayout.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) ); + gActorNamesRelayout.push_back(actor.GetProperty(Actor::Property::NAME)); } struct VisibilityChangedFunctorData { VisibilityChangedFunctorData() : actor(), - visible( false ), - type( DevelActor::VisibilityChange::SELF ), - called( false ) + visible(false), + type(DevelActor::VisibilityChange::SELF), + called(false) { } @@ -191,54 +197,57 @@ struct VisibilityChangedFunctorData { actor.Reset(); visible = false; - type = DevelActor::VisibilityChange::SELF; - called = false; + type = DevelActor::VisibilityChange::SELF; + called = false; } - void Check( bool compareCalled, Actor compareActor, bool compareVisible, DevelActor::VisibilityChange::Type compareType, const char * location ) + void Check(bool compareCalled, Actor compareActor, bool compareVisible, DevelActor::VisibilityChange::Type compareType, const char* location) { - DALI_TEST_EQUALS( called, compareCalled, TEST_INNER_LOCATION( location ) ); - DALI_TEST_EQUALS( actor, compareActor, TEST_INNER_LOCATION( location ) ); - DALI_TEST_EQUALS( visible, compareVisible, TEST_INNER_LOCATION( location ) ); - DALI_TEST_EQUALS( (int)type, (int)compareType, TEST_INNER_LOCATION( location ) ); + DALI_TEST_EQUALS(called, compareCalled, TEST_INNER_LOCATION(location)); + DALI_TEST_EQUALS(actor, compareActor, TEST_INNER_LOCATION(location)); + DALI_TEST_EQUALS(visible, compareVisible, TEST_INNER_LOCATION(location)); + DALI_TEST_EQUALS((int)type, (int)compareType, TEST_INNER_LOCATION(location)); } - void Check( bool compareCalled, const std::string& location ) + void Check(bool compareCalled, const std::string& location) { - DALI_TEST_EQUALS( called, compareCalled, TEST_INNER_LOCATION( location ) ); + DALI_TEST_EQUALS(called, compareCalled, TEST_INNER_LOCATION(location)); } - Actor actor; - bool visible; + Actor actor; + bool visible; DevelActor::VisibilityChange::Type type; - bool called; + bool called; }; struct VisibilityChangedFunctor { - VisibilityChangedFunctor( VisibilityChangedFunctorData& dataVar ) : data( dataVar ) { } + VisibilityChangedFunctor(VisibilityChangedFunctorData& dataVar) + : data(dataVar) + { + } - void operator()( Actor actor, bool visible, DevelActor::VisibilityChange::Type type ) + void operator()(Actor actor, bool visible, DevelActor::VisibilityChange::Type type) { - data.actor = actor; + data.actor = actor; data.visible = visible; - data.type = type; - data.called = true; + data.type = type; + data.called = true; } VisibilityChangedFunctorData& data; }; - struct VisibilityChangedVoidFunctor { VisibilityChangedVoidFunctor(bool& signalCalled) - : mSignalCalled( signalCalled ) - { } + : mSignalCalled(signalCalled) + { + } void operator()() { - mSignalCalled = true; + mSignalCalled = true; } bool& mSignalCalled; @@ -247,40 +256,41 @@ struct VisibilityChangedVoidFunctor struct ChildOrderChangedFunctor { ChildOrderChangedFunctor(bool& signalCalled, Actor& actor) - : mSignalCalled( signalCalled ), - mActor( actor ) - { } + : mSignalCalled(signalCalled), + mActor(actor) + { + } - void operator()( Actor actor ) + void operator()(Actor actor) { - mSignalCalled = true; - mActor = actor; + mSignalCalled = true; + mActor = actor; } - bool& mSignalCalled; + bool& mSignalCalled; Actor& mActor; }; struct CulledPropertyNotificationFunctor { - CulledPropertyNotificationFunctor( bool& signalCalled, PropertyNotification& propertyNotification ) - : mSignalCalled( signalCalled ), - mPropertyNotification( propertyNotification ) - { } + CulledPropertyNotificationFunctor(bool& signalCalled, PropertyNotification& propertyNotification) + : mSignalCalled(signalCalled), + mPropertyNotification(propertyNotification) + { + } - void operator()( PropertyNotification& source ) + void operator()(PropertyNotification& source) { - mSignalCalled = true; + mSignalCalled = true; mPropertyNotification = source; } - bool& mSignalCalled; + bool& mSignalCalled; PropertyNotification& mPropertyNotification; }; } // anonymous namespace - //& purpose: Testing New API int UtcDaliActorNew(void) { @@ -298,9 +308,9 @@ int UtcDaliActorDownCastP(void) TestApplication application; tet_infoline("Testing Dali::Actor::DownCast()"); - Actor actor = Actor::New(); + Actor actor = Actor::New(); BaseHandle object(actor); - Actor actor2 = Actor::DownCast(object); + Actor actor2 = Actor::DownCast(object); DALI_TEST_CHECK(actor2); END_TEST; } @@ -312,7 +322,7 @@ int UtcDaliActorDownCastN(void) tet_infoline("Testing Dali::Actor::DownCast()"); BaseHandle unInitializedObject; - Actor actor = Actor::DownCast(unInitializedObject); + Actor actor = Actor::DownCast(unInitializedObject); DALI_TEST_CHECK(!actor); END_TEST; } @@ -322,14 +332,14 @@ int UtcDaliActorMoveConstructor(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( actor ); + DALI_TEST_CHECK(actor); - int id = actor.GetProperty< int >( Actor::Property::ID ); + int id = actor.GetProperty(Actor::Property::ID); - Actor moved = std::move( actor); - DALI_TEST_CHECK( moved ); - DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION ); - DALI_TEST_CHECK( !actor ); + Actor moved = std::move(actor); + DALI_TEST_CHECK(moved); + DALI_TEST_EQUALS(id, moved.GetProperty(Actor::Property::ID), TEST_LOCATION); + DALI_TEST_CHECK(!actor); END_TEST; } @@ -339,15 +349,15 @@ int UtcDaliActorMoveAssignment(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( actor ); + DALI_TEST_CHECK(actor); - int id = actor.GetProperty< int >( Actor::Property::ID ); + int id = actor.GetProperty(Actor::Property::ID); Actor moved; - moved = std::move( actor); - DALI_TEST_CHECK( moved ); - DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION ); - DALI_TEST_CHECK( !actor ); + moved = std::move(actor); + DALI_TEST_CHECK(moved); + DALI_TEST_EQUALS(id, moved.GetProperty(Actor::Property::ID), TEST_LOCATION); + DALI_TEST_CHECK(!actor); END_TEST; } @@ -359,7 +369,7 @@ int UtcDaliActorGetName(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetProperty< std::string >( Actor::Property::NAME ).empty()); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::NAME).empty()); END_TEST; } @@ -369,10 +379,10 @@ int UtcDaliActorSetName(void) TestApplication application; string str("ActorName"); - Actor actor = Actor::New(); + Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::NAME,str); - DALI_TEST_CHECK(actor.GetProperty< std::string >( Actor::Property::NAME ) == str); + actor.SetProperty(Actor::Property::NAME, str); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::NAME) == str); END_TEST; } @@ -381,12 +391,12 @@ int UtcDaliActorGetId(void) tet_infoline("Testing Dali::Actor::UtcDaliActo.GetProperty< int >( Actor::Property::ID )"); TestApplication application; - Actor first = Actor::New(); + Actor first = Actor::New(); Actor second = Actor::New(); - Actor third = Actor::New(); + Actor third = Actor::New(); - DALI_TEST_CHECK(first.GetProperty< int >( Actor::Property::ID ) != second.GetProperty< int >( Actor::Property::ID )); - DALI_TEST_CHECK(second.GetProperty< int >( Actor::Property::ID ) != third.GetProperty< int >( Actor::Property::ID )); + DALI_TEST_CHECK(first.GetProperty(Actor::Property::ID) != second.GetProperty(Actor::Property::ID)); + DALI_TEST_CHECK(second.GetProperty(Actor::Property::ID) != third.GetProperty(Actor::Property::ID)); END_TEST; } @@ -395,11 +405,11 @@ int UtcDaliActorIsRoot(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK(!actor.GetProperty< bool >( Actor::Property::IS_ROOT )); + DALI_TEST_CHECK(!actor.GetProperty(Actor::Property::IS_ROOT)); // get the root layer - actor = application.GetScene().GetLayer( 0 ); - DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_ROOT ) ); + actor = application.GetScene().GetLayer(0); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::IS_ROOT)); END_TEST; } @@ -408,11 +418,11 @@ int UtcDaliActorOnScene(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) ); + DALI_TEST_CHECK(!actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE)); // get the root layer - actor = application.GetScene().GetLayer( 0 ); - DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) ); + actor = application.GetScene().GetLayer(0); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::CONNECTED_TO_SCENE)); END_TEST; } @@ -421,11 +431,11 @@ int UtcDaliActorIsLayer(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::IS_LAYER ) ); + DALI_TEST_CHECK(!actor.GetProperty(Actor::Property::IS_LAYER)); // get the root layer - actor = application.GetScene().GetLayer( 0 ); - DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_LAYER ) ); + actor = application.GetScene().GetLayer(0); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::IS_LAYER)); END_TEST; } @@ -440,8 +450,8 @@ int UtcDaliActorGetLayer(void) DALI_TEST_CHECK(layer); // get the root layers layer - actor = application.GetScene().GetLayer( 0 ); - DALI_TEST_CHECK( actor.GetLayer() ); + actor = application.GetScene().GetLayer(0); + DALI_TEST_CHECK(actor.GetLayer()); END_TEST; } @@ -451,33 +461,33 @@ int UtcDaliActorAddP(void) TestApplication application; Actor parent = Actor::New(); - Actor child = Actor::New(); + Actor child = Actor::New(); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); parent.Add(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); Actor parent2 = Actor::New(); - parent2.Add( child ); + parent2.Add(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); - DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); // try Adding to same parent again, works - parent2.Add( child ); - DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION ); + parent2.Add(child); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); // try reparenting an orphaned child { Actor temporaryParent = Actor::New(); - temporaryParent.Add( child ); - DALI_TEST_EQUALS( parent2.GetChildCount(), 0u, TEST_LOCATION ); + temporaryParent.Add(child); + DALI_TEST_EQUALS(parent2.GetChildCount(), 0u, TEST_LOCATION); } // temporaryParent has now died, reparent the orphaned child - parent2.Add( child ); - DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION ); + parent2.Add(child); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); END_TEST; } @@ -490,43 +500,43 @@ int UtcDaliActorAddN(void) Actor child = Actor::New(); Actor parent2 = Actor::New(); - parent2.Add( child ); + parent2.Add(child); // try illegal Add try { - parent2.Add( parent2 ); - tet_printf("Assertion test failed - no Exception\n" ); + parent2.Add(parent2); + tet_printf("Assertion test failed - no Exception\n"); tet_result(TET_FAIL); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "this != &child", TEST_LOCATION); - DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_PRINT_ASSERT(e); + DALI_TEST_ASSERT(e, "&mOwner != &child", TEST_LOCATION); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); } catch(...) { - tet_printf("Assertion test failed - wrong Exception\n" ); + tet_printf("Assertion test failed - wrong Exception\n"); tet_result(TET_FAIL); } // try reparenting root try { - parent2.Add( application.GetScene().GetLayer( 0 ) ); - tet_printf("Assertion test failed - no Exception\n" ); + parent2.Add(application.GetScene().GetLayer(0)); + tet_printf("Assertion test failed - no Exception\n"); tet_result(TET_FAIL); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); + DALI_TEST_PRINT_ASSERT(e); DALI_TEST_ASSERT(e, "!child.IsRoot()", TEST_LOCATION); - DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); } catch(...) { - tet_printf("Assertion test failed - wrong Exception\n" ); + tet_printf("Assertion test failed - wrong Exception\n"); tet_result(TET_FAIL); } @@ -534,19 +544,19 @@ int UtcDaliActorAddN(void) try { Actor empty; - parent2.Add( empty ); - tet_printf("Assertion test failed - no Exception\n" ); + parent2.Add(empty); + tet_printf("Assertion test failed - no Exception\n"); tet_result(TET_FAIL); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); + DALI_TEST_PRINT_ASSERT(e); DALI_TEST_ASSERT(e, "actor", TEST_LOCATION); - DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); } catch(...) { - tet_printf("Assertion test failed - wrong Exception\n" ); + tet_printf("Assertion test failed - wrong Exception\n"); tet_result(TET_FAIL); } @@ -559,43 +569,43 @@ int UtcDaliActorRemoveN(void) TestApplication application; Actor parent = Actor::New(); - Actor child = Actor::New(); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); + Actor child = Actor::New(); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); parent.Add(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); parent.Remove(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); // remove again, no problem parent.Remove(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); // add child back parent.Add(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); // try Remove self, its a no-op - parent.Remove( parent ); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); + parent.Remove(parent); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); // try Remove empty try { Actor empty; - parent.Remove( empty ); - tet_printf("Assertion test failed - no Exception\n" ); + parent.Remove(empty); + tet_printf("Assertion test failed - no Exception\n"); tet_result(TET_FAIL); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); + DALI_TEST_PRINT_ASSERT(e); DALI_TEST_ASSERT(e, "actor", TEST_LOCATION); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); } catch(...) { - tet_printf("Assertion test failed - wrong Exception\n" ); + tet_printf("Assertion test failed - wrong Exception\n"); tet_result(TET_FAIL); } END_TEST; @@ -606,10 +616,10 @@ int UtcDaliActorRemoveP(void) TestApplication application; Actor parent = Actor::New(); - Actor child = Actor::New(); + Actor child = Actor::New(); Actor random = Actor::New(); - application.GetScene().Add( parent ); + application.GetScene().Add(parent); DALI_TEST_CHECK(parent.GetChildCount() == 0); @@ -621,18 +631,44 @@ int UtcDaliActorRemoveP(void) DALI_TEST_CHECK(parent.GetChildCount() == 1); - application.GetScene().Remove( parent ); + application.GetScene().Remove(parent); DALI_TEST_CHECK(parent.GetChildCount() == 1); END_TEST; } +int UtcDaliActorSwitchParentN(void) +{ + tet_infoline("Testing Actor::UtcDaliActorSwitchParentN"); + TestApplication application; + + Actor parent1 = Actor::New(); + Actor child = Actor::New(); + + DALI_TEST_EQUALS(parent1.GetChildCount(), 0u, TEST_LOCATION); + + parent1.Add(child); + + DALI_TEST_EQUALS(parent1.GetChildCount(), 1u, TEST_LOCATION); + + Actor parent2 = Actor::New(); + + DALI_TEST_EQUALS(parent2.GetChildCount(), 0u, TEST_LOCATION); + + // Try switch parent with that both of parent1 and parent2 are off scene. + DevelActor::SwitchParent(child, parent2); + + DALI_TEST_EQUALS(parent1.GetChildCount(), 1u, TEST_LOCATION); + DALI_TEST_EQUALS(parent2.GetChildCount(), 0u, TEST_LOCATION); + END_TEST; +} + int UtcDaliActorGetChildCount(void) { TestApplication application; Actor parent = Actor::New(); - Actor child = Actor::New(); + Actor child = Actor::New(); DALI_TEST_CHECK(parent.GetChildCount() == 0); @@ -687,7 +723,7 @@ int UtcDaliActorGetParent01(void) TestApplication application; Actor parent = Actor::New(); - Actor child = Actor::New(); + Actor child = Actor::New(); parent.Add(child); @@ -710,21 +746,21 @@ int UtcDaliActorCustomProperty(void) TestApplication application; Actor actor = Actor::New(); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - float startValue(1.0f); - Property::Index index = actor.RegisterProperty( "testProperty", startValue ); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + float startValue(1.0f); + Property::Index index = actor.RegisterProperty("testProperty", startValue); + DALI_TEST_CHECK(actor.GetProperty(index) == startValue); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK(actor.GetProperty(index) == startValue); - actor.SetProperty( index, 5.0f ); + actor.SetProperty(index, 5.0f); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == 5.0f ); + DALI_TEST_CHECK(actor.GetProperty(index) == 5.0f); END_TEST; } @@ -733,21 +769,21 @@ int UtcDaliActorCustomPropertyIntToFloat(void) TestApplication application; Actor actor = Actor::New(); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - float startValue(5.0f); - Property::Index index = actor.RegisterProperty( "testProperty", startValue ); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + float startValue(5.0f); + Property::Index index = actor.RegisterProperty("testProperty", startValue); + DALI_TEST_CHECK(actor.GetProperty(index) == startValue); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK(actor.GetProperty(index) == startValue); - actor.SetProperty( index, int(1) ); + actor.SetProperty(index, int(1)); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == 1.0f ); + DALI_TEST_CHECK(actor.GetProperty(index) == 1.0f); END_TEST; } @@ -756,21 +792,21 @@ int UtcDaliActorCustomPropertyFloatToInt(void) TestApplication application; Actor actor = Actor::New(); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - int startValue(5); - Property::Index index = actor.RegisterProperty( "testProperty", startValue ); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + int startValue(5); + Property::Index index = actor.RegisterProperty("testProperty", startValue); + DALI_TEST_CHECK(actor.GetProperty(index) == startValue); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == startValue ); + DALI_TEST_CHECK(actor.GetProperty(index) == startValue); - actor.SetProperty( index, float(1.5) ); + actor.SetProperty(index, float(1.5)); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( actor.GetProperty(index) == 1 ); + DALI_TEST_CHECK(actor.GetProperty(index) == 1); END_TEST; } @@ -781,27 +817,27 @@ int UtcDaliActorSetParentOrigin(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN)); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, vector ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN)); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.1f, 0.2f, 0.3f ) ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, Vector3(0.1f, 0.2f, 0.3f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector3(0.1f, 0.2f, 0.3f), actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -812,31 +848,31 @@ int UtcDaliActorSetParentOriginIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN)); - actor.SetProperty( Actor::Property::PARENT_ORIGIN_X, vector.x ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN_X, vector.x); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).x, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN).x, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN_Y, vector.y ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN_Y, vector.y); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).y, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN).y, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN_Z, vector.z ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN_Z, vector.z); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).z, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN).z, TEST_LOCATION); END_TEST; } @@ -848,15 +884,15 @@ int UtcDaliActorGetCurrentParentOrigin(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN)); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, vector ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN)); END_TEST; } @@ -867,26 +903,26 @@ int UtcDaliActorSetAnchorPoint(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT)); - actor.SetProperty( Actor::Property::ANCHOR_POINT, vector ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT)); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - actor.SetProperty( Actor::Property::ANCHOR_POINT, Vector3( 0.1f, 0.2f, 0.3f ) ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, Vector3(0.1f, 0.2f, 0.3f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector3(0.1f, 0.2f, 0.3f), actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -897,31 +933,31 @@ int UtcDaliActorSetAnchorPointIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT)); - actor.SetProperty( Actor::Property::ANCHOR_POINT_X, vector.x ); + actor.SetProperty(Actor::Property::ANCHOR_POINT_X, vector.x); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).x, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT).x, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT_Y, vector.y ); + actor.SetProperty(Actor::Property::ANCHOR_POINT_Y, vector.y); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).y, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT).y, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT_Z, vector.z ); + actor.SetProperty(Actor::Property::ANCHOR_POINT_Z, vector.z); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).z, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT).z, TEST_LOCATION); END_TEST; } @@ -933,15 +969,15 @@ int UtcDaliActorGetCurrentAnchorPoint(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT)); - actor.SetProperty( Actor::Property::ANCHOR_POINT, vector); + actor.SetProperty(Actor::Property::ANCHOR_POINT, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT)); END_TEST; } @@ -949,63 +985,63 @@ int UtcDaliActorSetSize01(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE, Vector2( vector.x, vector.y ) ); + actor.SetProperty(Actor::Property::SIZE, Vector2(vector.x, vector.y)); // Immediately retrieve the size after setting - Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + Vector3 currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(vector.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(vector.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(vector.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); // Flush the queue and render once application.SendNotification(); application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SIZE)); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(vector.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(vector.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(vector.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); // Check async behaviour - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(vector.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(vector.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(vector.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); // Change the resize policy and check whether the size stays the same - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); // Set a new size after resize policy is changed and check the new size - actor.SetProperty( Actor::Property::SIZE, Vector3( 0.1f, 0.2f, 0.0f ) ); + actor.SetProperty(Actor::Property::SIZE, Vector3(0.1f, 0.2f, 0.0f)); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, Vector3(0.1f, 0.2f, 0.0f), Math::MACHINE_EPSILON_0, TEST_LOCATION); // Change the resize policy again and check whether the new size stays the same - actor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + actor.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, Vector3(0.1f, 0.2f, 0.0f), Math::MACHINE_EPSILON_0, TEST_LOCATION); // Set another new size after resize policy is changed and check the new size - actor.SetProperty( Actor::Property::SIZE, Vector3( 50.0f, 60.0f, 0.0f ) ); + actor.SetProperty(Actor::Property::SIZE, Vector3(50.0f, 60.0f, 0.0f)); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, Vector3( 50.0f, 60.0f, 0.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, Vector3(50.0f, 60.0f, 0.0f), Math::MACHINE_EPSILON_0, TEST_LOCATION); END_TEST; } @@ -1014,26 +1050,26 @@ int UtcDaliActorSetSize02(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE, Vector3( vector.x, vector.y, vector.z ) ); + actor.SetProperty(Actor::Property::SIZE, Vector3(vector.x, vector.y, vector.z)); // Immediately check the size after setting - Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + Vector3 currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SIZE)); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); END_TEST; } @@ -1043,26 +1079,26 @@ int UtcDaliActorSetSize03(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE,Vector2(vector.x, vector.y)); + actor.SetProperty(Actor::Property::SIZE, Vector2(vector.x, vector.y)); // Immediately check the size after setting - Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + Vector3 currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SIZE)); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); END_TEST; } @@ -1072,42 +1108,42 @@ int UtcDaliActorSetSize04(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE,vector); + actor.SetProperty(Actor::Property::SIZE, vector); // Immediately check the size after setting - Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + Vector3 currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SIZE)); - application.GetScene().Add( actor ); - actor.SetProperty( Actor::Property::SIZE, Vector3( 0.1f, 0.2f, 0.3f ) ); + application.GetScene().Add(actor); + actor.SetProperty(Actor::Property::SIZE, Vector3(0.1f, 0.2f, 0.3f)); // Immediately check the size after setting - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.3f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, Vector3(0.1f, 0.2f, 0.3f), Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the size in the new frame - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector3(0.1f, 0.2f, 0.3f), actor.GetCurrentProperty(Actor::Property::SIZE), TEST_LOCATION); - currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.3f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, Vector3(0.1f, 0.2f, 0.3f), Math::MACHINE_EPSILON_0, TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -1118,79 +1154,79 @@ int UtcDaliActorSetSizeIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE_WIDTH, vector.width ); + actor.SetProperty(Actor::Property::SIZE_WIDTH, vector.width); // Immediately check the width after setting - float sizeWidth = actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(); - DALI_TEST_EQUALS( sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + float sizeWidth = actor.GetProperty(Actor::Property::SIZE_WIDTH).Get(); + DALI_TEST_EQUALS(sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the width in the new frame - DALI_TEST_EQUALS( vector.width, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.width, actor.GetCurrentProperty(Actor::Property::SIZE).width, TEST_LOCATION); - sizeWidth = actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(); - DALI_TEST_EQUALS( sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeWidth = actor.GetProperty(Actor::Property::SIZE_WIDTH).Get(); + DALI_TEST_EQUALS(sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION); - actor.SetProperty( Actor::Property::SIZE_HEIGHT, vector.height ); + actor.SetProperty(Actor::Property::SIZE_HEIGHT, vector.height); // Immediately check the height after setting - float sizeHeight = actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(); - DALI_TEST_EQUALS( sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + float sizeHeight = actor.GetProperty(Actor::Property::SIZE_HEIGHT).Get(); + DALI_TEST_EQUALS(sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the height in the new frame - DALI_TEST_EQUALS( vector.height, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.height, actor.GetCurrentProperty(Actor::Property::SIZE).height, TEST_LOCATION); - sizeHeight = actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(); - DALI_TEST_EQUALS( sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeHeight = actor.GetProperty(Actor::Property::SIZE_HEIGHT).Get(); + DALI_TEST_EQUALS(sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION); - actor.SetProperty( Actor::Property::SIZE_DEPTH, vector.depth ); + actor.SetProperty(Actor::Property::SIZE_DEPTH, vector.depth); // Immediately check the depth after setting - float sizeDepth = actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(); - DALI_TEST_EQUALS( sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + float sizeDepth = actor.GetProperty(Actor::Property::SIZE_DEPTH).Get(); + DALI_TEST_EQUALS(sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the depth in the new frame - DALI_TEST_EQUALS( vector.depth, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).depth, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.depth, actor.GetCurrentProperty(Actor::Property::SIZE).depth, TEST_LOCATION); - sizeDepth = actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(); - DALI_TEST_EQUALS( sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeDepth = actor.GetProperty(Actor::Property::SIZE_DEPTH).Get(); + DALI_TEST_EQUALS(sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION); // Change the resize policy and check whether the size stays the same - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); - sizeWidth = actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(); - DALI_TEST_EQUALS( sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeWidth = actor.GetProperty(Actor::Property::SIZE_WIDTH).Get(); + DALI_TEST_EQUALS(sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION); - sizeHeight = actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(); - DALI_TEST_EQUALS( sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeHeight = actor.GetProperty(Actor::Property::SIZE_HEIGHT).Get(); + DALI_TEST_EQUALS(sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION); - sizeDepth = actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(); - DALI_TEST_EQUALS( sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeDepth = actor.GetProperty(Actor::Property::SIZE_DEPTH).Get(); + DALI_TEST_EQUALS(sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION); // Change the resize policy again and check whether the size stays the same - actor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + actor.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS); - sizeWidth = actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(); - DALI_TEST_EQUALS( sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeWidth = actor.GetProperty(Actor::Property::SIZE_WIDTH).Get(); + DALI_TEST_EQUALS(sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION); - sizeHeight = actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(); - DALI_TEST_EQUALS( sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeHeight = actor.GetProperty(Actor::Property::SIZE_HEIGHT).Get(); + DALI_TEST_EQUALS(sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION); - sizeDepth = actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(); - DALI_TEST_EQUALS( sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + sizeDepth = actor.GetProperty(Actor::Property::SIZE_DEPTH).Get(); + DALI_TEST_EQUALS(sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION); END_TEST; } @@ -1200,49 +1236,48 @@ int UtcDaliActorSetSizeIndividual02(void) TestApplication application; Actor actor = Actor::New(); - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - application.GetScene().Add( actor ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); - Vector3 vector( 100.0f, 200.0f, 400.0f ); - DALI_TEST_CHECK( vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) ); + Vector3 vector(100.0f, 200.0f, 400.0f); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE_WIDTH, vector.width ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(), vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_WIDTH, vector.width); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_WIDTH).Get(), vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION); - actor.SetProperty( Actor::Property::SIZE_HEIGHT, vector.height ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(), vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_HEIGHT, vector.height); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_HEIGHT).Get(), vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION); - actor.SetProperty( Actor::Property::SIZE_DEPTH, vector.depth ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(), vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_DEPTH, vector.depth); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_DEPTH).Get(), vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); // Check the width in the new frame - DALI_TEST_EQUALS( vector.width, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.height, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, TEST_LOCATION ); + DALI_TEST_EQUALS(vector.width, actor.GetCurrentProperty(Actor::Property::SIZE).width, TEST_LOCATION); + DALI_TEST_EQUALS(vector.height, actor.GetCurrentProperty(Actor::Property::SIZE).height, TEST_LOCATION); END_TEST; } - int UtcDaliActorGetCurrentSize(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 20.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE,vector); + actor.SetProperty(Actor::Property::SIZE, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SIZE)); END_TEST; } @@ -1250,10 +1285,10 @@ int UtcDaliActorGetNaturalSize(void) { TestApplication application; - Actor actor = Actor::New(); - Vector3 vector( 0.0f, 0.0f, 0.0f ); + Actor actor = Actor::New(); + Vector3 vector(0.0f, 0.0f, 0.0f); - DALI_TEST_CHECK( actor.GetNaturalSize() == vector ); + DALI_TEST_CHECK(actor.GetNaturalSize() == vector); END_TEST; } @@ -1262,40 +1297,42 @@ int UtcDaliActorGetCurrentSizeImmediate(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 20.0f); DALI_TEST_CHECK(vector != actor.GetTargetSize()); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); - actor.SetProperty( Actor::Property::SIZE,vector); + actor.SetProperty(Actor::Property::SIZE, vector); DALI_TEST_CHECK(vector == actor.GetTargetSize()); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SIZE)); // flush the queue and render once application.SendNotification(); application.Render(); DALI_TEST_CHECK(vector == actor.GetTargetSize()); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SIZE)); // Animation // Build the animation - const float durationSeconds = 2.0f; - Animation animation = Animation::New( durationSeconds ); - const Vector3 targetValue( 10.0f, 20.0f, 30.0f ); - animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetValue ); + const float durationSeconds = 2.0f; + Animation animation = Animation::New(durationSeconds); + const Vector3 targetValue(10.0f, 20.0f, 30.0f); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetValue); + + DALI_TEST_CHECK(actor.GetTargetSize() == vector); - DALI_TEST_CHECK( actor.GetTargetSize() == vector ); + application.GetScene().Add(actor); // Start the animation animation.Play(); application.SendNotification(); - application.Render( static_cast( durationSeconds * 1000.0f ) ); + application.Render(static_cast(durationSeconds * 1000.0f)); - DALI_TEST_CHECK( actor.GetTargetSize() == targetValue ); + DALI_TEST_CHECK(actor.GetTargetSize() == targetValue); END_TEST; } @@ -1306,20 +1343,20 @@ int UtcDaliActorCalculateScreenExtents(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::POSITION, Vector3(2.0f, 2.0f, 16.0f)); - actor.SetProperty( Actor::Property::SIZE,Vector3{ 1.0f, 1.0f, 1.0f }); + actor.SetProperty(Actor::Property::POSITION, Vector3(2.0f, 2.0f, 16.0f)); + actor.SetProperty(Actor::Property::SIZE, Vector3{1.0f, 1.0f, 1.0f}); application.SendNotification(); application.Render(); - auto expectedExtent = Rect<>{ -0.5f, -0.5f, 1.0f, 1.0f }; - auto actualExtent = DevelActor::CalculateScreenExtents( actor ); - DALI_TEST_EQUALS( expectedExtent.x, actualExtent.x, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); - DALI_TEST_EQUALS( expectedExtent.y, actualExtent.y, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); - DALI_TEST_EQUALS( expectedExtent.width, actualExtent.width, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); - DALI_TEST_EQUALS( expectedExtent.height, actualExtent.height, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + auto expectedExtent = Rect<>{-0.5f, -0.5f, 1.0f, 1.0f}; + auto actualExtent = DevelActor::CalculateScreenExtents(actor); + DALI_TEST_EQUALS(expectedExtent.x, actualExtent.x, Math::MACHINE_EPSILON_10000, TEST_LOCATION); + DALI_TEST_EQUALS(expectedExtent.y, actualExtent.y, Math::MACHINE_EPSILON_10000, TEST_LOCATION); + DALI_TEST_EQUALS(expectedExtent.width, actualExtent.width, Math::MACHINE_EPSILON_10000, TEST_LOCATION); + DALI_TEST_EQUALS(expectedExtent.height, actualExtent.height, Math::MACHINE_EPSILON_10000, TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -1331,40 +1368,40 @@ int UtcDaliActorSetPosition01(void) Actor actor = Actor::New(); // Set to random to start off with - actor.SetProperty( Actor::Property::POSITION, Vector3(120.0f, 120.0f, 0.0f)); + actor.SetProperty(Actor::Property::POSITION, Vector3(120.0f, 120.0f, 0.0f)); Vector3 vector(100.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION, Vector2(vector.x, vector.y)); + actor.SetProperty(Actor::Property::POSITION, Vector2(vector.x, vector.y)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); - application.GetScene().Add( actor ); - actor.SetProperty( Actor::Property::POSITION, Vector3( 0.1f, 0.2f, 0.3f ) ); + application.GetScene().Add(actor); + actor.SetProperty(Actor::Property::POSITION, Vector3(0.1f, 0.2f, 0.3f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector3(0.1f, 0.2f, 0.3f), actor.GetCurrentProperty(Actor::Property::POSITION), TEST_LOCATION); - actor.SetProperty( Actor::Property::POSITION_X, 1.0f ); - actor.SetProperty( Actor::Property::POSITION_Y, 1.1f ); - actor.SetProperty( Actor::Property::POSITION_Z, 1.2f ); + actor.SetProperty(Actor::Property::POSITION_X, 1.0f); + actor.SetProperty(Actor::Property::POSITION_Y, 1.1f); + actor.SetProperty(Actor::Property::POSITION_Z, 1.2f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 1.0f, 1.1f, 1.2f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector3(1.0f, 1.1f, 1.2f), actor.GetCurrentProperty(Actor::Property::POSITION), TEST_LOCATION); - actor.TranslateBy( Vector3( 0.1f, 0.1f, 0.1f ) ); + actor.TranslateBy(Vector3(0.1f, 0.1f, 0.1f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 1.1f, 1.2f, 1.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + DALI_TEST_EQUALS(Vector3(1.1f, 1.2f, 1.3f), actor.GetCurrentProperty(Actor::Property::POSITION), Math::MACHINE_EPSILON_10000, TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -1376,19 +1413,19 @@ int UtcDaliActorSetPosition02(void) Actor actor = Actor::New(); // Set to random to start off with - actor.SetProperty( Actor::Property::POSITION, Vector3(120.0f, 120.0f, 120.0f)); + actor.SetProperty(Actor::Property::POSITION, Vector3(120.0f, 120.0f, 120.0f)); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION, Vector3(vector.x, vector.y, vector.z)); + actor.SetProperty(Actor::Property::POSITION, Vector3(vector.x, vector.y, vector.z)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); END_TEST; } @@ -1400,19 +1437,19 @@ int UtcDaliActorSetPosition03(void) Actor actor = Actor::New(); // Set to random to start off with - actor.SetProperty( Actor::Property::POSITION, Vector3(120.0f, 120.0f, 120.0f)); + actor.SetProperty(Actor::Property::POSITION, Vector3(120.0f, 120.0f, 120.0f)); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION, vector); + actor.SetProperty(Actor::Property::POSITION, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); END_TEST; } @@ -1424,15 +1461,15 @@ int UtcDaliActorSetX(void) Vector3 vector(100.0f, 0.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION_X, 100.0f); + actor.SetProperty(Actor::Property::POSITION_X, 100.0f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); END_TEST; } @@ -1444,15 +1481,15 @@ int UtcDaliActorSetY(void) Vector3 vector(0.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION_Y, 100.0f); + actor.SetProperty(Actor::Property::POSITION_Y, 100.0f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); END_TEST; } @@ -1464,15 +1501,15 @@ int UtcDaliActorSetZ(void) Vector3 vector(0.0f, 0.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION_Z, 100.0f); + actor.SetProperty(Actor::Property::POSITION_Z, 100.0f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); END_TEST; } @@ -1483,49 +1520,49 @@ int UtcDaliActorSetPositionProperties(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION_X, vector.x ); - DALI_TEST_EQUALS( vector.x, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::POSITION_X ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::POSITION_X, vector.x); + DALI_TEST_EQUALS(vector.x, actor.GetProperty(Actor::Property::POSITION).x, TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetProperty(Actor::Property::POSITION_X), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::POSITION_X ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< float >( Actor::Property::POSITION_X ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::POSITION).x, TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetProperty(Actor::Property::POSITION).x, TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetProperty(Actor::Property::POSITION_X), TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::POSITION).x, TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::POSITION_X), TEST_LOCATION); - actor.SetProperty( Actor::Property::POSITION_Y, vector.y ); - DALI_TEST_EQUALS( vector.y, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetProperty< float >( Actor::Property::POSITION_Y ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::POSITION_Y, vector.y); + DALI_TEST_EQUALS(vector.y, actor.GetProperty(Actor::Property::POSITION).y, TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetProperty(Actor::Property::POSITION_Y), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetProperty< float >( Actor::Property::POSITION_Y ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< float >( Actor::Property::POSITION_Y ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::POSITION).y, TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetProperty(Actor::Property::POSITION).y, TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetProperty(Actor::Property::POSITION_Y), TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::POSITION).y, TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::POSITION_Y), TEST_LOCATION); - actor.SetProperty( Actor::Property::POSITION_Z, vector.z ); - DALI_TEST_EQUALS( vector.z, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetProperty< float >( Actor::Property::POSITION_Z ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::POSITION_Z, vector.z); + DALI_TEST_EQUALS(vector.z, actor.GetProperty(Actor::Property::POSITION).z, TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetProperty(Actor::Property::POSITION_Z), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetProperty< float >( Actor::Property::POSITION_Z ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< float >( Actor::Property::POSITION_Z ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::POSITION).z, TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetProperty(Actor::Property::POSITION).z, TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetProperty(Actor::Property::POSITION_Z), TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::POSITION).z, TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::POSITION_Z), TEST_LOCATION); END_TEST; } @@ -1534,18 +1571,18 @@ int UtcDaliActorTranslateBy(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::POSITION)); - actor.SetProperty( Actor::Property::POSITION, vector); + actor.SetProperty(Actor::Property::POSITION, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::POSITION)); actor.TranslateBy(vector); @@ -1553,7 +1590,7 @@ int UtcDaliActorTranslateBy(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector*2.0f == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); + DALI_TEST_CHECK(vector * 2.0f == actor.GetCurrentProperty(Actor::Property::POSITION)); END_TEST; } @@ -1561,15 +1598,15 @@ int UtcDaliActorGetCurrentPosition(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Vector3 setVector(100.0f, 100.0f, 0.0f); - actor.SetProperty( Actor::Property::POSITION, setVector); + actor.SetProperty(Actor::Property::POSITION, setVector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) == setVector); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::POSITION) == setVector); END_TEST; } @@ -1577,33 +1614,33 @@ int UtcDaliActorGetCurrentWorldPosition(void) { TestApplication application; - Actor parent = Actor::New(); - Vector3 parentPosition( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::POSITION, parentPosition ); - parent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - parent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - application.GetScene().Add( parent ); + Actor parent = Actor::New(); + Vector3 parentPosition(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::POSITION, parentPosition); + parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + parent.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + application.GetScene().Add(parent); Actor child = Actor::New(); - child.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - child.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - Vector3 childPosition( 6.0f, 6.0f, 6.0f ); - child.SetProperty( Actor::Property::POSITION, childPosition ); - parent.Add( child ); + child.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + child.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + Vector3 childPosition(6.0f, 6.0f, 6.0f); + child.SetProperty(Actor::Property::POSITION, childPosition); + parent.Add(child); // The actors should not have a world position yet - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3::ZERO, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3::ZERO, TEST_LOCATION); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::POSITION), childPosition, TEST_LOCATION); // The actors should have a world position now - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition + childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition + childPosition, TEST_LOCATION); END_TEST; } @@ -1612,56 +1649,56 @@ int UtcDaliActorSetInheritPosition(void) tet_infoline("Testing Actor::SetInheritPosition"); TestApplication application; - Actor parent = Actor::New(); - Vector3 parentPosition( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::POSITION, parentPosition ); - parent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - parent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - application.GetScene().Add( parent ); + Actor parent = Actor::New(); + Vector3 parentPosition(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::POSITION, parentPosition); + parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + parent.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + application.GetScene().Add(parent); Actor child = Actor::New(); - child.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - child.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - Vector3 childPosition( 10.0f, 11.0f, 12.0f ); - child.SetProperty( Actor::Property::POSITION, childPosition ); - parent.Add( child ); + child.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + child.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + Vector3 childPosition(10.0f, 11.0f, 12.0f); + child.SetProperty(Actor::Property::POSITION, childPosition); + parent.Add(child); // The actors should not have a world position yet - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3::ZERO, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3::ZERO, TEST_LOCATION); // first test default, which is to inherit position - DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_POSITION ), true, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::INHERIT_POSITION), true, TEST_LOCATION); application.SendNotification(); application.Render(0); // should only really call Update as Render is not required to update scene - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition + childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::POSITION), childPosition, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition + childPosition, TEST_LOCATION); //Change child position - Vector3 childOffset( -1.0f, 1.0f, 0.0f ); - child.SetProperty( Actor::Property::POSITION, childOffset ); + Vector3 childOffset(-1.0f, 1.0f, 0.0f); + child.SetProperty(Actor::Property::POSITION, childOffset); // Use local position as world postion - child.SetProperty( Actor::Property::INHERIT_POSITION, false ); - DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_POSITION ), false, TEST_LOCATION ); + child.SetProperty(Actor::Property::INHERIT_POSITION, false); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::INHERIT_POSITION), false, TEST_LOCATION); application.SendNotification(); application.Render(0); // should only really call Update as Render is not required to update scene - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childOffset, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), childOffset, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::POSITION), childOffset, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_POSITION), childOffset, TEST_LOCATION); //Change back to inherit position from parent - child.SetProperty( Actor::Property::INHERIT_POSITION, true ); - DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_POSITION ), true, TEST_LOCATION ); + child.SetProperty(Actor::Property::INHERIT_POSITION, true); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::INHERIT_POSITION), true, TEST_LOCATION); application.SendNotification(); application.Render(0); // should only really call Update as Render is not required to update scene - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childOffset, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition + childOffset, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::POSITION), childOffset, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_POSITION), parentPosition + childOffset, TEST_LOCATION); END_TEST; } @@ -1671,31 +1708,31 @@ int UtcDaliActorInheritOpacity(void) TestApplication application; Actor parent = Actor::New(); - Actor child = Actor::New(); - parent.Add( child ); - application.GetScene().Add( parent ); + Actor child = Actor::New(); + parent.Add(child); + application.GetScene().Add(parent); - DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get(), 1.0f, 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get(), 1.0f, 0.0001f, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetProperty(Actor::Property::COLOR_ALPHA).Get(), 1.0f, 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::COLOR_ALPHA).Get(), 1.0f, 0.0001f, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - parent.SetProperty( Actor::Property::OPACITY, 0.1f ); + parent.SetProperty(Actor::Property::OPACITY, 0.1f); - DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get(), 0.1f, 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get(), 1.0f, 0.0001f, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetProperty(Actor::Property::COLOR_ALPHA).Get(), 0.1f, 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::COLOR_ALPHA).Get(), 1.0f, 0.0001f, TEST_LOCATION); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::WORLD_COLOR ).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get(), 0.1f, 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetProperty( Actor::Property::WORLD_COLOR ).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get(), 1.f, 0.0001f, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetProperty(Actor::Property::WORLD_COLOR).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::COLOR_ALPHA).Get(), 0.1f, 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_COLOR).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::WORLD_COLOR).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_COLOR).Get(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::COLOR_ALPHA).Get(), 1.f, 0.0001f, TEST_LOCATION); END_TEST; } @@ -1705,16 +1742,16 @@ int UtcDaliActorSetOrientation01(void) { TestApplication application; - Quaternion rotation( Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); - Actor actor = Actor::New(); + Quaternion rotation(Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); + Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::ORIENTATION, rotation); + actor.SetProperty(Actor::Property::ORIENTATION, rotation); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); END_TEST; } @@ -1724,34 +1761,34 @@ int UtcDaliActorSetOrientation02(void) Actor actor = Actor::New(); - Radian angle( 0.785f ); + Radian angle(0.785f); Vector3 axis(1.0f, 1.0f, 0.0f); - actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( angle, axis ) ); - Quaternion rotation( angle, axis ); + actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(angle, axis)); + Quaternion rotation(angle, axis); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); - application.GetScene().Add( actor ); - actor.RotateBy( Degree( 360 ), axis); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + application.GetScene().Add(actor); + actor.RotateBy(Degree(360), axis); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); - actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ) ); - Quaternion result( Radian( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ); + actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(Degree(0), Vector3(1.0f, 0.0f, 0.0f))); + Quaternion result(Radian(0), Vector3(1.0f, 0.0f, 0.0f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(result, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); - actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( angle, axis ) ); + actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(angle, axis)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -1760,19 +1797,19 @@ int UtcDaliActorSetOrientationProperty(void) { TestApplication application; - Quaternion rotation( Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); - Actor actor = Actor::New(); + Quaternion rotation(Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); + Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::ORIENTATION, rotation ); - DALI_TEST_EQUALS(rotation, actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + actor.SetProperty(Actor::Property::ORIENTATION, rotation); + DALI_TEST_EQUALS(rotation, actor.GetProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); - DALI_TEST_EQUALS(rotation, actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); END_TEST; } @@ -1783,22 +1820,22 @@ int UtcDaliActorRotateBy01(void) Actor actor = Actor::New(); - Radian angle( M_PI * 0.25f ); - actor.RotateBy(( angle ), Vector3::ZAXIS); + Radian angle(M_PI * 0.25f); + actor.RotateBy((angle), Vector3::ZAXIS); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Quaternion( angle, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Quaternion(angle, Vector3::ZAXIS), actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - actor.RotateBy( angle, Vector3::ZAXIS); + actor.RotateBy(angle, Vector3::ZAXIS); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -1809,33 +1846,33 @@ int UtcDaliActorRotateBy02(void) Actor actor = Actor::New(); - Radian angle( M_PI * 0.25f ); + Radian angle(M_PI * 0.25f); Quaternion rotation(angle, Vector3::ZAXIS); actor.RotateBy(rotation); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); actor.RotateBy(rotation); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); END_TEST; } int UtcDaliActorGetCurrentOrientation(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Quaternion rotation(Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); - actor.SetProperty( Actor::Property::ORIENTATION, rotation ); + actor.SetProperty(Actor::Property::ORIENTATION, rotation); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); END_TEST; } @@ -1844,39 +1881,39 @@ int UtcDaliActorGetCurrentWorldOrientation(void) tet_infoline("Testing Actor::GetCurrentWorldRotation"); TestApplication application; - Actor parent = Actor::New(); - Radian rotationAngle( Degree(90.0f) ); - Quaternion rotation( rotationAngle, Vector3::YAXIS ); - parent.SetProperty( Actor::Property::ORIENTATION, rotation ); - application.GetScene().Add( parent ); + Actor parent = Actor::New(); + Radian rotationAngle(Degree(90.0f)); + Quaternion rotation(rotationAngle, Vector3::YAXIS); + parent.SetProperty(Actor::Property::ORIENTATION, rotation); + application.GetScene().Add(parent); Actor child = Actor::New(); - child.SetProperty( Actor::Property::ORIENTATION, rotation ); - parent.Add( child ); + child.SetProperty(Actor::Property::ORIENTATION, rotation); + parent.Add(child); // The actors should not have a world rotation yet - DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_ORIENTATION), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_ORIENTATION), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::ORIENTATION), rotation, 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::ORIENTATION), rotation, 0.001, TEST_LOCATION); // The actors should have a world rotation now - DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_ORIENTATION), Quaternion(rotationAngle, Vector3::YAXIS), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_ORIENTATION), Quaternion(rotationAngle * 2.0f, Vector3::YAXIS), 0.001, TEST_LOCATION); // turn off child rotation inheritance - child.SetProperty( Actor::Property::INHERIT_ORIENTATION, false ); - DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_ORIENTATION ), false, TEST_LOCATION ); + child.SetProperty(Actor::Property::INHERIT_ORIENTATION, false); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::INHERIT_ORIENTATION), false, TEST_LOCATION); application.SendNotification(); application.Render(0); // The actors should have a world rotation now - DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), rotation, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_ORIENTATION), Quaternion(rotationAngle, Vector3::YAXIS), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_ORIENTATION), rotation, 0.001, TEST_LOCATION); END_TEST; } @@ -1888,18 +1925,18 @@ int UtcDaliActorSetScale01(void) Actor actor = Actor::New(); // Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale() - actor.SetProperty( Actor::Property::SCALE,0.25f); + actor.SetProperty(Actor::Property::SCALE, 0.25f); Vector3 scale(10.0f, 10.0f, 10.0f); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) != scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) != scale); - actor.SetProperty( Actor::Property::SCALE,scale.x); + actor.SetProperty(Actor::Property::SCALE, scale.x); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) == scale); END_TEST; } @@ -1907,30 +1944,30 @@ int UtcDaliActorSetScale01(void) int UtcDaliActorSetScale02(void) { TestApplication application; - Vector3 scale(10.0f, 10.0f, 10.0f); + Vector3 scale(10.0f, 10.0f, 10.0f); Actor actor = Actor::New(); // Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale() - actor.SetProperty( Actor::Property::SCALE, Vector3( 12.0f, 1.0f, 2.0f ) ); + actor.SetProperty(Actor::Property::SCALE, Vector3(12.0f, 1.0f, 2.0f)); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) != scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) != scale); - actor.SetProperty( Actor::Property::SCALE, Vector3( scale.x, scale.y, scale.z ) ); + actor.SetProperty(Actor::Property::SCALE, Vector3(scale.x, scale.y, scale.z)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) == scale); // add to stage and test - application.GetScene().Add( actor ); - actor.SetProperty( Actor::Property::SCALE, Vector3( 2.0f, 2.0f, 2.0f ) ); + application.GetScene().Add(actor); + actor.SetProperty(Actor::Property::SCALE, Vector3(2.0f, 2.0f, 2.0f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 2.0f, 2.0f, 2.0f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Vector3(2.0f, 2.0f, 2.0f), actor.GetCurrentProperty(Actor::Property::SCALE), 0.001, TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -1939,22 +1976,22 @@ int UtcDaliActorSetScale02(void) int UtcDaliActorSetScale03(void) { TestApplication application; - Vector3 scale(10.0f, 10.0f, 10.0f); + Vector3 scale(10.0f, 10.0f, 10.0f); Actor actor = Actor::New(); // Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale() - actor.SetProperty( Actor::Property::SCALE, Vector3(12.0f, 1.0f, 2.0f)); + actor.SetProperty(Actor::Property::SCALE, Vector3(12.0f, 1.0f, 2.0f)); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) != scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) != scale); - actor.SetProperty( Actor::Property::SCALE,scale); + actor.SetProperty(Actor::Property::SCALE, scale); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) == scale); END_TEST; } @@ -1965,43 +2002,43 @@ int UtcDaliActorSetScaleIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SCALE)); - actor.SetProperty( Actor::Property::SCALE_X, vector.x ); - DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::SCALE_X ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::SCALE_X, vector.x); + DALI_TEST_EQUALS(vector.x, actor.GetProperty(Actor::Property::SCALE_X), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::SCALE_X ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::SCALE).x, TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetProperty(Actor::Property::SCALE_X), TEST_LOCATION); + DALI_TEST_EQUALS(vector.x, actor.GetCurrentProperty(Actor::Property::SCALE_X), TEST_LOCATION); - actor.SetProperty( Actor::Property::SCALE_Y, vector.y ); - DALI_TEST_EQUALS( vector.y, actor.GetProperty< float >( Actor::Property::SCALE_Y ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::SCALE_Y, vector.y); + DALI_TEST_EQUALS(vector.y, actor.GetProperty(Actor::Property::SCALE_Y), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).y, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetProperty< float >( Actor::Property::SCALE_Y ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::SCALE).y, TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetProperty(Actor::Property::SCALE_Y), TEST_LOCATION); + DALI_TEST_EQUALS(vector.y, actor.GetCurrentProperty(Actor::Property::SCALE_Y), TEST_LOCATION); - actor.SetProperty( Actor::Property::SCALE_Z, vector.z ); - DALI_TEST_EQUALS( vector.z, actor.GetProperty< float >( Actor::Property::SCALE_Z ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::SCALE_Z, vector.z); + DALI_TEST_EQUALS(vector.z, actor.GetProperty(Actor::Property::SCALE_Z), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).z, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetProperty< float >( Actor::Property::SCALE_Z ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::SCALE).z, TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetProperty(Actor::Property::SCALE_Z), TEST_LOCATION); + DALI_TEST_EQUALS(vector.z, actor.GetCurrentProperty(Actor::Property::SCALE_Z), TEST_LOCATION); - DALI_TEST_EQUALS( vector, actor.GetProperty< Vector3 >( Actor::Property::SCALE ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector, actor.GetProperty(Actor::Property::SCALE), TEST_LOCATION); + DALI_TEST_EQUALS(vector, actor.GetCurrentProperty(Actor::Property::SCALE), TEST_LOCATION); END_TEST; } @@ -2009,18 +2046,18 @@ int UtcDaliActorSetScaleIndividual(void) int UtcDaliActorScaleBy(void) { TestApplication application; - Actor actor = Actor::New(); - Vector3 vector(100.0f, 100.0f, 100.0f); + Actor actor = Actor::New(); + Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::SCALE)); - actor.SetProperty( Actor::Property::SCALE,vector); + actor.SetProperty(Actor::Property::SCALE, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty(Actor::Property::SCALE)); actor.ScaleBy(vector); @@ -2028,24 +2065,24 @@ int UtcDaliActorScaleBy(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector*100.0f == actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); + DALI_TEST_CHECK(vector * 100.0f == actor.GetCurrentProperty(Actor::Property::SCALE)); END_TEST; } int UtcDaliActorGetCurrentScale(void) { TestApplication application; - Vector3 scale(12.0f, 1.0f, 2.0f); + Vector3 scale(12.0f, 1.0f, 2.0f); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SCALE,scale); + actor.SetProperty(Actor::Property::SCALE, scale); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::SCALE) == scale); END_TEST; } @@ -2053,33 +2090,33 @@ int UtcDaliActorGetCurrentWorldScale(void) { TestApplication application; - Actor parent = Actor::New(); - Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::SCALE, parentScale ); - application.GetScene().Add( parent ); + Actor parent = Actor::New(); + Vector3 parentScale(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::SCALE, parentScale); + application.GetScene().Add(parent); - Actor child = Actor::New(); - Vector3 childScale( 2.0f, 2.0f, 2.0f ); - child.SetProperty( Actor::Property::SCALE, childScale ); - parent.Add( child ); + Actor child = Actor::New(); + Vector3 childScale(2.0f, 2.0f, 2.0f); + child.SetProperty(Actor::Property::SCALE, childScale); + parent.Add(child); // The actors should not have a scale yet - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::SCALE), Vector3::ONE, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::SCALE), Vector3::ONE, TEST_LOCATION); // The actors should not have a world scale yet - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), Vector3::ONE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_SCALE), Vector3::ONE, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_SCALE), Vector3::ONE, TEST_LOCATION); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), parentScale, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), childScale, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::SCALE), parentScale, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::SCALE), childScale, TEST_LOCATION); // The actors should have a world scale now - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), parentScale, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), parentScale * childScale, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_SCALE), parentScale, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_SCALE), parentScale * childScale, TEST_LOCATION); END_TEST; } @@ -2088,29 +2125,29 @@ int UtcDaliActorInheritScale(void) tet_infoline("Testing Actor::SetInheritScale"); TestApplication application; - Actor parent = Actor::New(); - Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::SCALE, parentScale ); - application.GetScene().Add( parent ); + Actor parent = Actor::New(); + Vector3 parentScale(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::SCALE, parentScale); + application.GetScene().Add(parent); - Actor child = Actor::New(); - Vector3 childScale( 2.0f, 2.0f, 2.0f ); - child.SetProperty( Actor::Property::SCALE, childScale ); - parent.Add( child ); + Actor child = Actor::New(); + Vector3 childScale(2.0f, 2.0f, 2.0f); + child.SetProperty(Actor::Property::SCALE, childScale); + parent.Add(child); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), true, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), parentScale * childScale, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::INHERIT_SCALE), true, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_SCALE), parentScale * childScale, TEST_LOCATION); - child.SetProperty( Actor::Property::INHERIT_SCALE, false ); - DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), false, TEST_LOCATION ); + child.SetProperty(Actor::Property::INHERIT_SCALE, false); + DALI_TEST_EQUALS(child.GetProperty(Actor::Property::INHERIT_SCALE), false, TEST_LOCATION); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), childScale, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_SCALE), childScale, TEST_LOCATION); END_TEST; } @@ -2119,25 +2156,25 @@ int UtcDaliActorSetVisible(void) TestApplication application; Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::VISIBLE,false); + actor.SetProperty(Actor::Property::VISIBLE, false); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == false); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::VISIBLE) == false); - actor.SetProperty( Actor::Property::VISIBLE,true); + actor.SetProperty(Actor::Property::VISIBLE, true); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == true); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::VISIBLE) == true); // put actor on stage - application.GetScene().Add( actor ); - actor.SetProperty( Actor::Property::VISIBLE,false); + application.GetScene().Add(actor); + actor.SetProperty(Actor::Property::VISIBLE, false); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == false); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::VISIBLE) == false); END_TEST; } @@ -2147,7 +2184,7 @@ int UtcDaliActorIsVisible(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == true); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::VISIBLE) == true); END_TEST; } @@ -2157,38 +2194,38 @@ int UtcDaliActorSetOpacity(void) Actor actor = Actor::New(); // initial opacity is 1 - DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::OPACITY), 1.0f, TEST_LOCATION); - actor.SetProperty( Actor::Property::OPACITY, 0.4f); + actor.SetProperty(Actor::Property::OPACITY, 0.4f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.4f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::OPACITY), 0.4f, TEST_LOCATION); // change opacity, actor is on stage to change is not immediate - actor.SetProperty( Actor::Property::OPACITY, actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) + 0.1f ); + actor.SetProperty(Actor::Property::OPACITY, actor.GetCurrentProperty(Actor::Property::OPACITY) + 0.1f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::OPACITY), 0.5f, TEST_LOCATION); // put actor on stage - application.GetScene().Add( actor ); + application.GetScene().Add(actor); // change opacity, actor is on stage to change is not immediate - actor.SetProperty( Actor::Property::OPACITY, 0.9f ); - DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, TEST_LOCATION ); + actor.SetProperty(Actor::Property::OPACITY, 0.9f); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::OPACITY), 0.5f, TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.9f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::OPACITY), 0.9f, TEST_LOCATION); // change opacity, actor is on stage to change is not immediate - actor.SetProperty( Actor::Property::OPACITY, actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) - 0.9f ); + actor.SetProperty(Actor::Property::OPACITY, actor.GetCurrentProperty(Actor::Property::OPACITY) - 0.9f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::OPACITY), 0.0f, TEST_LOCATION); END_TEST; } @@ -2197,83 +2234,83 @@ int UtcDaliActorGetCurrentOpacity(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 0.5f); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::OPACITY) != 0.5f); - actor.SetProperty( Actor::Property::OPACITY,0.5f); + actor.SetProperty(Actor::Property::OPACITY, 0.5f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) == 0.5f); + DALI_TEST_CHECK(actor.GetCurrentProperty(Actor::Property::OPACITY) == 0.5f); END_TEST; } int UtcDaliActorSetSensitive(void) { TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); - bool sensitive = !actor.GetProperty< bool >( Actor::Property::SENSITIVE ); + bool sensitive = !actor.GetProperty(Actor::Property::SENSITIVE); - actor.SetProperty( Actor::Property::SENSITIVE,sensitive); + actor.SetProperty(Actor::Property::SENSITIVE, sensitive); - DALI_TEST_CHECK(sensitive == actor.GetProperty< bool >( Actor::Property::SENSITIVE )); + DALI_TEST_CHECK(sensitive == actor.GetProperty(Actor::Property::SENSITIVE)); END_TEST; } int UtcDaliActorIsSensitive(void) { TestApplication application; - Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SENSITIVE,false); + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::SENSITIVE, false); - DALI_TEST_CHECK(false == actor.GetProperty< bool >( Actor::Property::SENSITIVE )); + DALI_TEST_CHECK(false == actor.GetProperty(Actor::Property::SENSITIVE)); END_TEST; } int UtcDaliActorSetColor(void) { TestApplication application; - Actor actor = Actor::New(); - Vector4 color(1.0f, 1.0f, 1.0f, 0.5f); + Actor actor = Actor::New(); + Vector4 color(1.0f, 1.0f, 1.0f, 0.5f); - DALI_TEST_CHECK(color != actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); + DALI_TEST_CHECK(color != actor.GetCurrentProperty(Actor::Property::COLOR)); - actor.SetProperty( Actor::Property::COLOR,color); + actor.SetProperty(Actor::Property::COLOR, color); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(color == actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); + DALI_TEST_CHECK(color == actor.GetCurrentProperty(Actor::Property::COLOR)); - actor.SetProperty( Actor::Property::COLOR, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ) + Vector4( -0.4f, -0.5f, -0.6f, -0.4f ) ); + actor.SetProperty(Actor::Property::COLOR, actor.GetCurrentProperty(Actor::Property::COLOR) + Vector4(-0.4f, -0.5f, -0.6f, -0.4f)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector4( 0.6f, 0.5f, 0.4f, 0.1f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector4(0.6f, 0.5f, 0.4f, 0.1f), actor.GetCurrentProperty(Actor::Property::COLOR), TEST_LOCATION); - application.GetScene().Add( actor ); - actor.SetProperty( Actor::Property::COLOR, color ); + application.GetScene().Add(actor); + actor.SetProperty(Actor::Property::COLOR, color); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( color, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + DALI_TEST_EQUALS(color, actor.GetCurrentProperty(Actor::Property::COLOR), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ) + Vector4( 1.1f, 1.1f, 1.1f, 1.1f ) ); + actor.SetProperty(Actor::Property::COLOR, actor.GetCurrentProperty(Actor::Property::COLOR) + Vector4(1.1f, 1.1f, 1.1f, 1.1f)); // flush the queue and render once application.SendNotification(); application.Render(); // Actor color is not clamped - DALI_TEST_EQUALS( Vector4( 2.1f, 2.1f, 2.1f, 1.6f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector4(2.1f, 2.1f, 2.1f, 1.6f), actor.GetCurrentProperty(Actor::Property::COLOR), TEST_LOCATION); // world color is clamped - DALI_TEST_EQUALS( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), TEST_LOCATION ); + DALI_TEST_EQUALS(Vector4(1.0f, 1.0f, 1.0f, 1.0f), actor.GetCurrentProperty(Actor::Property::WORLD_COLOR), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR, color ); - DALI_TEST_EQUALS( color, actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR, color); + DALI_TEST_EQUALS(color, actor.GetProperty(Actor::Property::COLOR), TEST_LOCATION); - Vector3 newColor( 1.0f, 0.0f, 0.0f ); - actor.SetProperty( Actor::Property::COLOR, newColor ); - DALI_TEST_EQUALS( Vector4( newColor.r, newColor.g, newColor.b, 1.0f ), actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + Vector3 newColor(1.0f, 0.0f, 0.0f); + actor.SetProperty(Actor::Property::COLOR, newColor); + DALI_TEST_EQUALS(Vector4(newColor.r, newColor.g, newColor.b, 1.0f), actor.GetProperty(Actor::Property::COLOR), TEST_LOCATION); - application.GetScene().Remove( actor ); + application.GetScene().Remove(actor); END_TEST; } @@ -2284,80 +2321,77 @@ int UtcDaliActorSetColorIndividual(void) Actor actor = Actor::New(); Vector4 vector(0.7f, 0.8f, 0.9f, 0.6f); - DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty(Actor::Property::COLOR)); - actor.SetProperty( Actor::Property::COLOR_RED, vector.r ); - DALI_TEST_EQUALS( vector.r, actor.GetProperty< float >( Actor::Property::COLOR_RED ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_RED, vector.r); + DALI_TEST_EQUALS(vector.r, actor.GetProperty(Actor::Property::COLOR_RED), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.r, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).r, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.r, actor.GetProperty< float >( Actor::Property::COLOR_RED ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.r, actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.r, actor.GetCurrentProperty(Actor::Property::COLOR).r, TEST_LOCATION); + DALI_TEST_EQUALS(vector.r, actor.GetProperty(Actor::Property::COLOR_RED), TEST_LOCATION); + DALI_TEST_EQUALS(vector.r, actor.GetCurrentProperty(Actor::Property::COLOR_RED), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_GREEN, vector.g ); - DALI_TEST_EQUALS( vector.g, actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_GREEN, vector.g); + DALI_TEST_EQUALS(vector.g, actor.GetProperty(Actor::Property::COLOR_GREEN), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.g, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).g, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.g, actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.g, actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.g, actor.GetCurrentProperty(Actor::Property::COLOR).g, TEST_LOCATION); + DALI_TEST_EQUALS(vector.g, actor.GetProperty(Actor::Property::COLOR_GREEN), TEST_LOCATION); + DALI_TEST_EQUALS(vector.g, actor.GetCurrentProperty(Actor::Property::COLOR_GREEN), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_BLUE, vector.b ); - DALI_TEST_EQUALS( vector.b, actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_BLUE, vector.b); + DALI_TEST_EQUALS(vector.b, actor.GetProperty(Actor::Property::COLOR_BLUE), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.b, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).b, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.b, actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.b, actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.b, actor.GetCurrentProperty(Actor::Property::COLOR).b, TEST_LOCATION); + DALI_TEST_EQUALS(vector.b, actor.GetProperty(Actor::Property::COLOR_BLUE), TEST_LOCATION); + DALI_TEST_EQUALS(vector.b, actor.GetCurrentProperty(Actor::Property::COLOR_BLUE), TEST_LOCATION); - - actor.SetProperty( Actor::Property::COLOR_ALPHA, vector.a ); - DALI_TEST_EQUALS( vector.a, actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_ALPHA, vector.a); + DALI_TEST_EQUALS(vector.a, actor.GetProperty(Actor::Property::COLOR_ALPHA), TEST_LOCATION); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.a, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.a, actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector.a, actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), TEST_LOCATION ); - - DALI_TEST_EQUALS( vector, actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); - DALI_TEST_EQUALS( vector, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + DALI_TEST_EQUALS(vector.a, actor.GetCurrentProperty(Actor::Property::COLOR).a, TEST_LOCATION); + DALI_TEST_EQUALS(vector.a, actor.GetProperty(Actor::Property::COLOR_ALPHA), TEST_LOCATION); + DALI_TEST_EQUALS(vector.a, actor.GetCurrentProperty(Actor::Property::COLOR_ALPHA), TEST_LOCATION); - actor.SetProperty( Actor::Property::OPACITY, 0.2f ); + DALI_TEST_EQUALS(vector, actor.GetProperty(Actor::Property::COLOR), TEST_LOCATION); + DALI_TEST_EQUALS(vector, actor.GetCurrentProperty(Actor::Property::COLOR), TEST_LOCATION); + actor.SetProperty(Actor::Property::OPACITY, 0.2f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( 0.2f, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, TEST_LOCATION ); + DALI_TEST_EQUALS(0.2f, actor.GetCurrentProperty(Actor::Property::COLOR).a, TEST_LOCATION); END_TEST; } - int UtcDaliActorGetCurrentColor(void) { TestApplication application; - Actor actor = Actor::New(); - Vector4 color(1.0f, 1.0f, 1.0f, 0.5f); + Actor actor = Actor::New(); + Vector4 color(1.0f, 1.0f, 1.0f, 0.5f); - actor.SetProperty( Actor::Property::COLOR,color); + actor.SetProperty(Actor::Property::COLOR, color); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(color == actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); + DALI_TEST_CHECK(color == actor.GetCurrentProperty(Actor::Property::COLOR)); END_TEST; } @@ -2366,57 +2400,57 @@ int UtcDaliActorGetCurrentWorldColor(void) tet_infoline("Actor::GetCurrentWorldColor"); TestApplication application; - Actor parent = Actor::New(); - Vector4 parentColor( 1.0f, 0.5f, 0.0f, 0.8f ); - parent.SetProperty( Actor::Property::COLOR, parentColor ); - application.GetScene().Add( parent ); + Actor parent = Actor::New(); + Vector4 parentColor(1.0f, 0.5f, 0.0f, 0.8f); + parent.SetProperty(Actor::Property::COLOR, parentColor); + application.GetScene().Add(parent); - Actor child = Actor::New(); - Vector4 childColor( 0.5f, 0.6f, 0.5f, 1.0f ); - child.SetProperty( Actor::Property::COLOR, childColor ); - parent.Add( child ); + Actor child = Actor::New(); + Vector4 childColor(0.5f, 0.6f, 0.5f, 1.0f); + child.SetProperty(Actor::Property::COLOR, childColor); + parent.Add(child); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::COLOR), Color::WHITE, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::COLOR), Color::WHITE, TEST_LOCATION); // verify the default color mode - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, child.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); + DALI_TEST_EQUALS(USE_OWN_MULTIPLY_PARENT_ALPHA, child.GetProperty(Actor::Property::COLOR_MODE), TEST_LOCATION); // The actors should not have a world color yet - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Color::WHITE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_COLOR), Color::WHITE, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_COLOR), Color::WHITE, TEST_LOCATION); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), parentColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::COLOR), parentColor, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::COLOR), childColor, TEST_LOCATION); // The actors should have a world color now - DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), parentColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Vector4( childColor.r, childColor.g, childColor.b, childColor.a * parentColor.a), TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_COLOR), parentColor, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_COLOR), Vector4(childColor.r, childColor.g, childColor.b, childColor.a * parentColor.a), TEST_LOCATION); // use own color - child.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); + child.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_COLOR); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), childColor, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_COLOR), childColor, TEST_LOCATION); // use parent color - child.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); + child.SetProperty(Actor::Property::COLOR_MODE, USE_PARENT_COLOR); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), parentColor, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::COLOR), childColor, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_COLOR), parentColor, TEST_LOCATION); // use parent alpha - child.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); + child.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA); application.SendNotification(); application.Render(0); - Vector4 expectedColor( childColor ); + Vector4 expectedColor(childColor); expectedColor.a *= parentColor.a; - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), expectedColor, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::COLOR), childColor, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_COLOR), expectedColor, TEST_LOCATION); END_TEST; } @@ -2424,31 +2458,31 @@ int UtcDaliActorSetColorMode(void) { tet_infoline("Actor::SetColorMode"); TestApplication application; - Actor actor = Actor::New(); - Actor child = Actor::New(); - actor.Add( child ); + Actor actor = Actor::New(); + Actor child = Actor::New(); + actor.Add(child); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); - DALI_TEST_EQUALS( USE_OWN_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_COLOR); + DALI_TEST_EQUALS(USE_OWN_COLOR, actor.GetProperty(Actor::Property::COLOR_MODE), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR ); - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR); + DALI_TEST_EQUALS(USE_OWN_MULTIPLY_PARENT_COLOR, actor.GetProperty(Actor::Property::COLOR_MODE), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); - DALI_TEST_EQUALS( USE_PARENT_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_PARENT_COLOR); + DALI_TEST_EQUALS(USE_PARENT_COLOR, actor.GetProperty(Actor::Property::COLOR_MODE), TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA); + DALI_TEST_EQUALS(USE_OWN_MULTIPLY_PARENT_ALPHA, actor.GetProperty(Actor::Property::COLOR_MODE), TEST_LOCATION); END_TEST; } int UtcDaliActorScreenToLocal(void) { TestApplication application; - Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::POSITION, Vector2(10.0f, 10.0f)); + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::POSITION, Vector2(10.0f, 10.0f)); application.GetScene().Add(actor); // flush the queue and render once @@ -2461,7 +2495,7 @@ int UtcDaliActorScreenToLocal(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK( actor.ScreenToLocal(localX, localY, 50.0f, 50.0f) ); + DALI_TEST_CHECK(actor.ScreenToLocal(localX, localY, 50.0f, 50.0f)); DALI_TEST_EQUALS(localX, 40.0f, 0.01f, TEST_LOCATION); DALI_TEST_EQUALS(localY, 40.0f, 0.01f, TEST_LOCATION); @@ -2474,11 +2508,11 @@ int UtcDaliActorSetLeaveRequired(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::LEAVE_REQUIRED,false); - DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ) == false); + actor.SetProperty(Actor::Property::LEAVE_REQUIRED, false); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::LEAVE_REQUIRED) == false); - actor.SetProperty( Actor::Property::LEAVE_REQUIRED,true); - DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ) == true); + actor.SetProperty(Actor::Property::LEAVE_REQUIRED, true); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::LEAVE_REQUIRED) == true); END_TEST; } @@ -2488,7 +2522,7 @@ int UtcDaliActorGetLeaveRequired(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ) == false); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::LEAVE_REQUIRED) == false); END_TEST; } @@ -2498,11 +2532,11 @@ int UtcDaliActorSetKeyboardFocusable(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); - DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == true); + actor.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) == true); - actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, false ); - DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == false); + actor.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, false); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) == false); END_TEST; } @@ -2512,7 +2546,78 @@ int UtcDaliActorIsKeyboardFocusable(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == false); + DALI_TEST_CHECK(actor.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) == false); + END_TEST; +} + +int UtcDaliActorSetKeyboardFocusableChildren(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + actor.SetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, true); + DALI_TEST_CHECK(actor.GetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN) == true); + + actor.SetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, false); + DALI_TEST_CHECK(actor.GetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN) == false); + END_TEST; +} + +int UtcDaliActorAreChildrenKeyBoardFocusable(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + DALI_TEST_CHECK(actor.GetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN) == true); + END_TEST; +} + +int UtcDaliActorSetTouchFocusable(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + actor.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true); + DALI_TEST_CHECK(actor.GetProperty(DevelActor::Property::TOUCH_FOCUSABLE) == true); + + actor.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, false); + DALI_TEST_CHECK(actor.GetProperty(DevelActor::Property::TOUCH_FOCUSABLE) == false); + END_TEST; +} + +int UtcDaliActorIsTouchFocusable(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + DALI_TEST_CHECK(actor.GetProperty(DevelActor::Property::TOUCH_FOCUSABLE) == false); + END_TEST; +} + +int UtcDaliActorSetUserInteractionEnabled(void) +{ + TestApplication application; + Actor actor = Actor::New(); + + bool enabled = !actor.GetProperty(DevelActor::Property::USER_INTERACTION_ENABLED); + + actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, enabled); + + DALI_TEST_CHECK(enabled == actor.GetProperty(DevelActor::Property::USER_INTERACTION_ENABLED)); + END_TEST; +} + +int UtcDaliActorIsUserInteractionEnabled(void) +{ + TestApplication application; + Actor actor = Actor::New(); + actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, true); + + DALI_TEST_CHECK(true == actor.GetProperty(DevelActor::Property::USER_INTERACTION_ENABLED)); END_TEST; } @@ -2525,13 +2630,13 @@ int UtcDaliActorRemoveConstraints(void) Actor actor = Actor::New(); - Constraint constraint = Constraint::New( actor, Actor::Property::COLOR, TestConstraint() ); + Constraint constraint = Constraint::New(actor, Actor::Property::COLOR, TestConstraint()); constraint.Apply(); actor.RemoveConstraints(); - DALI_TEST_CHECK( gTestConstraintCalled == false ); + DALI_TEST_CHECK(gTestConstraintCalled == false); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); constraint.Apply(); // flush the queue and render once @@ -2540,7 +2645,7 @@ int UtcDaliActorRemoveConstraints(void) actor.RemoveConstraints(); - DALI_TEST_CHECK( gTestConstraintCalled == true ); + DALI_TEST_CHECK(gTestConstraintCalled == true); END_TEST; } @@ -2555,75 +2660,75 @@ int UtcDaliActorRemoveConstraintTag(void) unsigned int result1 = 0u; unsigned int result2 = 0u; - unsigned constraint1Tag = 1u; - Constraint constraint1 = Constraint::New( actor, Actor::Property::COLOR, TestConstraintRef(result1, 1) ); - constraint1.SetTag( constraint1Tag ); + unsigned constraint1Tag = 1u; + Constraint constraint1 = Constraint::New(actor, Actor::Property::COLOR, TestConstraintRef(result1, 1)); + constraint1.SetTag(constraint1Tag); constraint1.Apply(); - unsigned constraint2Tag = 2u; - Constraint constraint2 = Constraint::New( actor, Actor::Property::COLOR, TestConstraintRef(result2, 2) ); - constraint2.SetTag( constraint2Tag ); + unsigned constraint2Tag = 2u; + Constraint constraint2 = Constraint::New(actor, Actor::Property::COLOR, TestConstraintRef(result2, 2)); + constraint2.SetTag(constraint2Tag); constraint2.Apply(); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result1, 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( result2, 2u, TEST_LOCATION ); + DALI_TEST_EQUALS(result1, 1u, TEST_LOCATION); + DALI_TEST_EQUALS(result2, 2u, TEST_LOCATION); // 2. Remove Constraint1 and test... result1 = 0; result2 = 0; actor.RemoveConstraints(constraint1Tag); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); + actor.SetProperty(Actor::Property::COLOR, Color::WHITE); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result1, 0u, TEST_LOCATION ); ///< constraint 1 should not apply now. - DALI_TEST_EQUALS( result2, 2u, TEST_LOCATION ); + DALI_TEST_EQUALS(result1, 0u, TEST_LOCATION); ///< constraint 1 should not apply now. + DALI_TEST_EQUALS(result2, 2u, TEST_LOCATION); // 3. Re-Apply Constraint1 and test... result1 = 0; result2 = 0; constraint1.Apply(); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); + actor.SetProperty(Actor::Property::COLOR, Color::WHITE); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result1, 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( result2, 2u, TEST_LOCATION ); + DALI_TEST_EQUALS(result1, 1u, TEST_LOCATION); + DALI_TEST_EQUALS(result2, 2u, TEST_LOCATION); // 2. Remove Constraint2 and test... result1 = 0; result2 = 0; actor.RemoveConstraints(constraint2Tag); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); + actor.SetProperty(Actor::Property::COLOR, Color::WHITE); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result1, 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( result2, 0u, TEST_LOCATION ); ///< constraint 2 should not apply now. + DALI_TEST_EQUALS(result1, 1u, TEST_LOCATION); + DALI_TEST_EQUALS(result2, 0u, TEST_LOCATION); ///< constraint 2 should not apply now. // 2. Remove Constraint1 as well and test... result1 = 0; result2 = 0; actor.RemoveConstraints(constraint1Tag); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); + actor.SetProperty(Actor::Property::COLOR, Color::WHITE); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result1, 0u, TEST_LOCATION ); ///< constraint 1 should not apply now. - DALI_TEST_EQUALS( result2, 0u, TEST_LOCATION ); ///< constraint 2 should not apply now. + DALI_TEST_EQUALS(result1, 0u, TEST_LOCATION); ///< constraint 1 should not apply now. + DALI_TEST_EQUALS(result2, 0u, TEST_LOCATION); ///< constraint 2 should not apply now. END_TEST; } @@ -2635,25 +2740,25 @@ int UtcDaliActorTouchedSignal(void) // get the root layer Actor actor = application.GetScene().GetRootLayer(); - DALI_TEST_CHECK( gTouchCallBackCalled == false ); + DALI_TEST_CHECK(gTouchCallBackCalled == false); application.SendNotification(); application.Render(); // connect to its touch signal - actor.TouchedSignal().Connect( TestTouchCallback ); + actor.TouchedSignal().Connect(TestTouchCallback); // simulate a touch event in the middle of the screen - Vector2 touchPoint( application.GetScene().GetSize() * 0.5 ); + Vector2 touchPoint(application.GetScene().GetSize() * 0.5); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( touchPoint.x, touchPoint.y ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(touchPoint.x, touchPoint.y)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); - application.ProcessEvent( touchEvent ); + touchEvent.AddPoint(point); + application.ProcessEvent(touchEvent); - DALI_TEST_CHECK( gTouchCallBackCalled == true ); + DALI_TEST_CHECK(gTouchCallBackCalled == true); END_TEST; } @@ -2665,25 +2770,25 @@ int UtcDaliActorHoveredSignal(void) // get the root layer Actor actor = application.GetScene().GetRootLayer(); - DALI_TEST_CHECK( gHoverCallBackCalled == false ); + DALI_TEST_CHECK(gHoverCallBackCalled == false); application.SendNotification(); application.Render(); // connect to its hover signal - actor.HoveredSignal().Connect( TestCallback3 ); + actor.HoveredSignal().Connect(TestCallback3); // simulate a hover event in the middle of the screen - Vector2 touchPoint( application.GetScene().GetSize() * 0.5 ); + Vector2 touchPoint(application.GetScene().GetSize() * 0.5); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::MOTION ); - point.SetScreenPosition( Vector2( touchPoint.x, touchPoint.y ) ); + point.SetDeviceId(1); + point.SetState(PointState::MOTION); + point.SetScreenPosition(Vector2(touchPoint.x, touchPoint.y)); Dali::Integration::HoverEvent hoverEvent; - hoverEvent.AddPoint( point ); - application.ProcessEvent( hoverEvent ); + hoverEvent.AddPoint(point); + application.ProcessEvent(hoverEvent); - DALI_TEST_CHECK( gHoverCallBackCalled == true ); + DALI_TEST_CHECK(gHoverCallBackCalled == true); END_TEST; } @@ -2698,19 +2803,19 @@ int UtcDaliActorOnOffSceneSignal(void) gActorNamesOnOffScene.clear(); Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::NAME, "parent" ); - parent.OnSceneSignal().Connect( OnSceneCallback ); - parent.OffSceneSignal().Connect( OffSceneCallback ); + parent.SetProperty(Actor::Property::NAME, "parent"); + parent.OnSceneSignal().Connect(OnSceneCallback); + parent.OffSceneSignal().Connect(OffSceneCallback); // sanity check - DALI_TEST_CHECK( gOnSceneCallBackCalled == 0 ); - DALI_TEST_CHECK( gOffSceneCallBackCalled == 0 ); + DALI_TEST_CHECK(gOnSceneCallBackCalled == 0); + DALI_TEST_CHECK(gOffSceneCallBackCalled == 0); // add parent to the scene - application.GetScene().Add( parent ); + application.GetScene().Add(parent); // onstage emitted, offstage not - DALI_TEST_EQUALS( gOnSceneCallBackCalled, 1, TEST_LOCATION ); - DALI_TEST_EQUALS( gOffSceneCallBackCalled, 0, TEST_LOCATION ); - DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 0 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnSceneCallBackCalled, 1, TEST_LOCATION); + DALI_TEST_EQUALS(gOffSceneCallBackCalled, 0, TEST_LOCATION); + DALI_TEST_EQUALS("parent", gActorNamesOnOffScene[0], TEST_LOCATION); // test adding a child, should get onstage emitted // clean test data @@ -2718,60 +2823,60 @@ int UtcDaliActorOnOffSceneSignal(void) gActorNamesOnOffScene.clear(); Actor child = Actor::New(); - child.SetProperty( Actor::Property::NAME, "child" ); - child.OnSceneSignal().Connect( OnSceneCallback ); - child.OffSceneSignal().Connect( OffSceneCallback ); - parent.Add( child ); // add child + child.SetProperty(Actor::Property::NAME, "child"); + child.OnSceneSignal().Connect(OnSceneCallback); + child.OffSceneSignal().Connect(OffSceneCallback); + parent.Add(child); // add child // onscene emitted, offscene not - DALI_TEST_EQUALS( gOnSceneCallBackCalled, 1, TEST_LOCATION ); - DALI_TEST_EQUALS( gOffSceneCallBackCalled, 0, TEST_LOCATION ); - DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 0 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnSceneCallBackCalled, 1, TEST_LOCATION); + DALI_TEST_EQUALS(gOffSceneCallBackCalled, 0, TEST_LOCATION); + DALI_TEST_EQUALS("child", gActorNamesOnOffScene[0], TEST_LOCATION); // test removing parent from the scene // clean test data gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0; gActorNamesOnOffScene.clear(); - application.GetScene().Remove( parent ); + application.GetScene().Remove(parent); // onscene not emitted, offscene is - DALI_TEST_EQUALS( gOnSceneCallBackCalled, 0, TEST_LOCATION ); - DALI_TEST_EQUALS( gOffSceneCallBackCalled, 2, TEST_LOCATION ); - DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 0 ], TEST_LOCATION ); - DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 1 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnSceneCallBackCalled, 0, TEST_LOCATION); + DALI_TEST_EQUALS(gOffSceneCallBackCalled, 2, TEST_LOCATION); + DALI_TEST_EQUALS("child", gActorNamesOnOffScene[0], TEST_LOCATION); + DALI_TEST_EQUALS("parent", gActorNamesOnOffScene[1], TEST_LOCATION); // test adding parent back to the scene // clean test data gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0; gActorNamesOnOffScene.clear(); - application.GetScene().Add( parent ); + application.GetScene().Add(parent); // onscene emitted, offscene not - DALI_TEST_EQUALS( gOnSceneCallBackCalled, 2, TEST_LOCATION ); - DALI_TEST_EQUALS( gOffSceneCallBackCalled, 0, TEST_LOCATION ); - DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 0 ], TEST_LOCATION ); - DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 1 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnSceneCallBackCalled, 2, TEST_LOCATION); + DALI_TEST_EQUALS(gOffSceneCallBackCalled, 0, TEST_LOCATION); + DALI_TEST_EQUALS("parent", gActorNamesOnOffScene[0], TEST_LOCATION); + DALI_TEST_EQUALS("child", gActorNamesOnOffScene[1], TEST_LOCATION); // test removing child // clean test data gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0; gActorNamesOnOffScene.clear(); - parent.Remove( child ); + parent.Remove(child); // onscene not emitted, offscene is - DALI_TEST_EQUALS( gOnSceneCallBackCalled, 0, TEST_LOCATION ); - DALI_TEST_EQUALS( gOffSceneCallBackCalled, 1, TEST_LOCATION ); - DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 0 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnSceneCallBackCalled, 0, TEST_LOCATION); + DALI_TEST_EQUALS(gOffSceneCallBackCalled, 1, TEST_LOCATION); + DALI_TEST_EQUALS("child", gActorNamesOnOffScene[0], TEST_LOCATION); // test removing parent // clean test data gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0; gActorNamesOnOffScene.clear(); - application.GetScene().Remove( parent ); + application.GetScene().Remove(parent); // onscene not emitted, offscene is - DALI_TEST_EQUALS( gOnSceneCallBackCalled, 0, TEST_LOCATION ); - DALI_TEST_EQUALS( gOffSceneCallBackCalled, 1, TEST_LOCATION ); - DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 0 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnSceneCallBackCalled, 0, TEST_LOCATION); + DALI_TEST_EQUALS(gOffSceneCallBackCalled, 1, TEST_LOCATION); + DALI_TEST_EQUALS("parent", gActorNamesOnOffScene[0], TEST_LOCATION); END_TEST; } @@ -2781,26 +2886,26 @@ int UtcDaliActorFindChildByName(void) TestApplication application; Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::NAME, "parent" ); - Actor first = Actor::New(); - first .SetProperty( Actor::Property::NAME, "first" ); + parent.SetProperty(Actor::Property::NAME, "parent"); + Actor first = Actor::New(); + first.SetProperty(Actor::Property::NAME, "first"); Actor second = Actor::New(); - second.SetProperty( Actor::Property::NAME, "second" ); + second.SetProperty(Actor::Property::NAME, "second"); parent.Add(first); first.Add(second); - Actor found = parent.FindChildByName( "foo" ); - DALI_TEST_CHECK( !found ); + Actor found = parent.FindChildByName("foo"); + DALI_TEST_CHECK(!found); - found = parent.FindChildByName( "parent" ); - DALI_TEST_CHECK( found == parent ); + found = parent.FindChildByName("parent"); + DALI_TEST_CHECK(found == parent); - found = parent.FindChildByName( "first" ); - DALI_TEST_CHECK( found == first ); + found = parent.FindChildByName("first"); + DALI_TEST_CHECK(found == first); - found = parent.FindChildByName( "second" ); - DALI_TEST_CHECK( found == second ); + found = parent.FindChildByName("second"); + DALI_TEST_CHECK(found == second); END_TEST; } @@ -2816,17 +2921,17 @@ int UtcDaliActorFindChildById(void) parent.Add(first); first.Add(second); - Actor found = parent.FindChildById( 100000 ); - DALI_TEST_CHECK( !found ); + Actor found = parent.FindChildById(100000); + DALI_TEST_CHECK(!found); - found = parent.FindChildById( parent.GetProperty< int >( Actor::Property::ID ) ); - DALI_TEST_CHECK( found == parent ); + found = parent.FindChildById(parent.GetProperty(Actor::Property::ID)); + DALI_TEST_CHECK(found == parent); - found = parent.FindChildById( first.GetProperty< int >( Actor::Property::ID ) ); - DALI_TEST_CHECK( found == first ); + found = parent.FindChildById(first.GetProperty(Actor::Property::ID)); + DALI_TEST_CHECK(found == first); - found = parent.FindChildById( second.GetProperty< int >( Actor::Property::ID ) ); - DALI_TEST_CHECK( found == second ); + found = parent.FindChildById(second.GetProperty(Actor::Property::ID)); + DALI_TEST_CHECK(found == second); END_TEST; } @@ -2835,15 +2940,16 @@ int UtcDaliActorHitTest(void) struct HitTestData { public: - HitTestData( const Vector3& scale, const Vector2& touchPoint, bool result ) - : mScale( scale ), - mTouchPoint( touchPoint ), - mResult( result ) - {} + HitTestData(const Vector3& scale, const Vector2& touchPoint, bool result) + : mScale(scale), + mTouchPoint(touchPoint), + mResult(result) + { + } Vector3 mScale; Vector2 mTouchPoint; - bool mResult; + bool mResult; }; TestApplication application; @@ -2852,56 +2958,59 @@ int UtcDaliActorHitTest(void) // Fill a vector with different hit tests. struct HitTestData* hitTestData[] = { // scale touch point result - new HitTestData( Vector3( 100.f, 100.f, 1.f ), Vector2( 289.f, 400.f ), true ), // touch point close to the right edge (inside) - new HitTestData( Vector3( 100.f, 100.f, 1.f ), Vector2( 291.f, 400.f ), false ), // touch point close to the right edge (outside) - new HitTestData( Vector3( 110.f, 100.f, 1.f ), Vector2( 291.f, 400.f ), true ), // same point as above with a wider scale. Should be inside. - new HitTestData( Vector3( 100.f, 100.f, 1.f ), Vector2( 200.f, 451.f ), false ), // touch point close to the down edge (outside) - new HitTestData( Vector3( 100.f, 110.f, 1.f ), Vector2( 200.f, 451.f ), true ), // same point as above with a wider scale. Should be inside. + new HitTestData(Vector3(100.f, 100.f, 1.f), Vector2(289.f, 400.f), true), // touch point close to the right edge (inside) + new HitTestData(Vector3(100.f, 100.f, 1.f), Vector2(291.f, 400.f), false), // touch point close to the right edge (outside) + new HitTestData(Vector3(110.f, 100.f, 1.f), Vector2(291.f, 400.f), true), // same point as above with a wider scale. Should be inside. + new HitTestData(Vector3(100.f, 100.f, 1.f), Vector2(200.f, 451.f), false), // touch point close to the down edge (outside) + new HitTestData(Vector3(100.f, 110.f, 1.f), Vector2(200.f, 451.f), true), // same point as above with a wider scale. Should be inside. NULL, }; // get the root layer Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); ResetTouchCallbacks(); unsigned int index = 0; - while( NULL != hitTestData[index] ) + while(NULL != hitTestData[index]) { - actor.SetProperty( Actor::Property::SIZE, Vector2( 1.f, 1.f ) ); - actor.SetProperty( Actor::Property::SCALE, Vector3( hitTestData[index]->mScale.x, hitTestData[index]->mScale.y, hitTestData[index]->mScale.z ) ); + actor.SetProperty(Actor::Property::SIZE, Vector2(1.f, 1.f)); + actor.SetProperty(Actor::Property::SCALE, Vector3(hitTestData[index]->mScale.x, hitTestData[index]->mScale.y, hitTestData[index]->mScale.z)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK( !gTouchCallBackCalled ); + DALI_TEST_CHECK(!gTouchCallBackCalled); // connect to its touch signal actor.TouchedSignal().Connect(TestTouchCallback); Dali::Integration::Point point; - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( hitTestData[index]->mTouchPoint.x, hitTestData[index]->mTouchPoint.y ) ); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(hitTestData[index]->mTouchPoint.x, hitTestData[index]->mTouchPoint.y)); Dali::Integration::TouchEvent event; - event.AddPoint( point ); + event.AddPoint(point); // flush the queue and render once application.SendNotification(); application.Render(); - application.ProcessEvent( event ); + application.ProcessEvent(event); - DALI_TEST_CHECK( gTouchCallBackCalled == hitTestData[index]->mResult ); + DALI_TEST_CHECK(gTouchCallBackCalled == hitTestData[index]->mResult); - if( gTouchCallBackCalled != hitTestData[index]->mResult ) + if(gTouchCallBackCalled != hitTestData[index]->mResult) tet_printf("Test failed:\nScale %f %f %f\nTouchPoint %f, %f\nResult %d\n", - hitTestData[index]->mScale.x, hitTestData[index]->mScale.y, hitTestData[index]->mScale.z, - hitTestData[index]->mTouchPoint.x, hitTestData[index]->mTouchPoint.y, - hitTestData[index]->mResult ); + hitTestData[index]->mScale.x, + hitTestData[index]->mScale.y, + hitTestData[index]->mScale.z, + hitTestData[index]->mTouchPoint.x, + hitTestData[index]->mTouchPoint.y, + hitTestData[index]->mResult); ResetTouchCallbacks(); ++index; @@ -2922,19 +3031,19 @@ int UtcDaliActorSetDrawMode(void) application.SendNotification(); application.Render(1); - DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Ensure overlay is off by default + DALI_TEST_CHECK(DrawMode::NORMAL == a.GetProperty(Actor::Property::DRAW_MODE)); // Ensure overlay is off by default - a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); + a.SetProperty(Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D); application.SendNotification(); application.Render(1); - DALI_TEST_CHECK( DrawMode::OVERLAY_2D == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is overlay + DALI_TEST_CHECK(DrawMode::OVERLAY_2D == a.GetProperty(Actor::Property::DRAW_MODE)); // Check Actor is overlay - a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL ); + a.SetProperty(Actor::Property::DRAW_MODE, DrawMode::NORMAL); application.SendNotification(); application.Render(1); - DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is normal + DALI_TEST_CHECK(DrawMode::NORMAL == a.GetProperty(Actor::Property::DRAW_MODE)); // Check Actor is normal END_TEST; } @@ -2947,17 +3056,17 @@ int UtcDaliActorSetDrawModeOverlayRender(void) application.Render(1); std::vector ids; - ids.push_back( 8 ); // first rendered actor - ids.push_back( 9 ); // second rendered actor - ids.push_back( 10 ); // third rendered actor - application.GetGlAbstraction().SetNextTextureIds( ids ); + ids.push_back(8); // first rendered actor + ids.push_back(9); // second rendered actor + ids.push_back(10); // third rendered actor + application.GetGlAbstraction().SetNextTextureIds(ids); - Texture imageA = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16); - Texture imageB = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16); - Texture imageC = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16); - Actor a = CreateRenderableActor( imageA ); - Actor b = CreateRenderableActor( imageB ); - Actor c = CreateRenderableActor( imageC ); + Texture imageA = CreateTexture(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16); + Texture imageB = CreateTexture(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16); + Texture imageC = CreateTexture(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16); + Actor a = CreateRenderableActor(imageA); + Actor b = CreateRenderableActor(imageB); + Actor c = CreateRenderableActor(imageC); application.SendNotification(); application.Render(1); @@ -2977,14 +3086,14 @@ int UtcDaliActorSetDrawModeOverlayRender(void) application.Render(1); // Should be 3 textures changes. - const std::vector& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 ); + const std::vector& boundTextures = application.GetGlAbstraction().GetBoundTextures(GL_TEXTURE0); typedef std::vector::size_type TextureSize; - DALI_TEST_EQUALS( boundTextures.size(), static_cast( 3 ), TEST_LOCATION ); - if( boundTextures.size() == 3 ) + DALI_TEST_EQUALS(boundTextures.size(), static_cast(3), TEST_LOCATION); + if(boundTextures.size() == 3) { - DALI_TEST_CHECK( boundTextures[0] == 8u ); - DALI_TEST_CHECK( boundTextures[1] == 9u ); - DALI_TEST_CHECK( boundTextures[2] == 10u ); + DALI_TEST_CHECK(boundTextures[0] == 8u); + DALI_TEST_CHECK(boundTextures[1] == 9u); + DALI_TEST_CHECK(boundTextures[2] == 10u); } // Now texture ids have been set, we can monitor their render order. @@ -2992,19 +3101,19 @@ int UtcDaliActorSetDrawModeOverlayRender(void) // b (9) // c (10) // a (8) - a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); + a.SetProperty(Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D); application.GetGlAbstraction().ClearBoundTextures(); application.SendNotification(); application.Render(1); // Should be 3 texture changes. - DALI_TEST_EQUALS( boundTextures.size(), static_cast(3), TEST_LOCATION ); - if( boundTextures.size() == 3 ) + DALI_TEST_EQUALS(boundTextures.size(), static_cast(3), TEST_LOCATION); + if(boundTextures.size() == 3) { - DALI_TEST_CHECK( boundTextures[0] == 9u ); - DALI_TEST_CHECK( boundTextures[1] == 10u ); - DALI_TEST_CHECK( boundTextures[2] == 8u ); + DALI_TEST_CHECK(boundTextures[0] == 9u); + DALI_TEST_CHECK(boundTextures[1] == 10u); + DALI_TEST_CHECK(boundTextures[2] == 8u); } END_TEST; } @@ -3015,27 +3124,27 @@ int UtcDaliActorGetCurrentWorldMatrix(void) tet_infoline(" UtcDaliActorGetCurrentWorldMatrix"); Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); - Vector3 parentPosition( 10.0f, 20.0f, 30.0f); - Radian rotationAngle(Degree(85.0f)); + parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + parent.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + Vector3 parentPosition(10.0f, 20.0f, 30.0f); + Radian rotationAngle(Degree(85.0f)); Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); - Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::POSITION, parentPosition ); - parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); - parent.SetProperty( Actor::Property::SCALE, parentScale ); - application.GetScene().Add( parent ); + Vector3 parentScale(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::POSITION, parentPosition); + parent.SetProperty(Actor::Property::ORIENTATION, parentRotation); + parent.SetProperty(Actor::Property::SCALE, parentScale); + application.GetScene().Add(parent); Actor child = Actor::New(); - child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - Vector3 childPosition( 0.0f, 0.0f, 100.0f ); - Radian childRotationAngle(Degree(23.0f)); - Quaternion childRotation( childRotationAngle, Vector3::YAXIS ); - Vector3 childScale( 2.0f, 2.0f, 2.0f ); - child.SetProperty( Actor::Property::POSITION, childPosition ); - child.SetProperty( Actor::Property::ORIENTATION, childRotation ); - child.SetProperty( Actor::Property::SCALE, childScale ); - parent.Add( child ); + child.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Vector3 childPosition(0.0f, 0.0f, 100.0f); + Radian childRotationAngle(Degree(23.0f)); + Quaternion childRotation(childRotationAngle, Vector3::YAXIS); + Vector3 childScale(2.0f, 2.0f, 2.0f); + child.SetProperty(Actor::Property::POSITION, childPosition); + child.SetProperty(Actor::Property::ORIENTATION, childRotation); + child.SetProperty(Actor::Property::SCALE, childScale); + parent.Add(child); application.SendNotification(); application.Render(0); @@ -3046,43 +3155,41 @@ int UtcDaliActorGetCurrentWorldMatrix(void) parentMatrix.SetTransformComponents(parentScale, parentRotation, parentPosition); Matrix childMatrix(false); - childMatrix.SetTransformComponents( childScale, childRotation, childPosition ); + childMatrix.SetTransformComponents(childScale, childRotation, childPosition); //Child matrix should be the composition of child and parent Matrix childWorldMatrix(false); - Matrix::Multiply( childWorldMatrix, childMatrix, parentMatrix); + Matrix::Multiply(childWorldMatrix, childMatrix, parentMatrix); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Matrix >( Actor::Property::WORLD_MATRIX ), parentMatrix, 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Matrix >( Actor::Property::WORLD_MATRIX ), childWorldMatrix, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_MATRIX), parentMatrix, 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::WORLD_MATRIX), childWorldMatrix, 0.001, TEST_LOCATION); END_TEST; } - - int UtcDaliActorConstrainedToWorldMatrix(void) { TestApplication application; tet_infoline(" UtcDaliActorConstrainedToWorldMatrix"); Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); - Vector3 parentPosition( 10.0f, 20.0f, 30.0f); - Radian rotationAngle(Degree(85.0f)); + parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + parent.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + Vector3 parentPosition(10.0f, 20.0f, 30.0f); + Radian rotationAngle(Degree(85.0f)); Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); - Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::POSITION, parentPosition ); - parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); - parent.SetProperty( Actor::Property::SCALE, parentScale ); - application.GetScene().Add( parent ); + Vector3 parentScale(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::POSITION, parentPosition); + parent.SetProperty(Actor::Property::ORIENTATION, parentRotation); + parent.SetProperty(Actor::Property::SCALE, parentScale); + application.GetScene().Add(parent); Actor child = Actor::New(); - child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - Constraint posConstraint = Constraint::New( child, Actor::Property::POSITION, PositionComponentConstraint() ); - posConstraint.AddSource( Source( parent, Actor::Property::WORLD_MATRIX ) ); + child.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Constraint posConstraint = Constraint::New(child, Actor::Property::POSITION, PositionComponentConstraint()); + posConstraint.AddSource(Source(parent, Actor::Property::WORLD_MATRIX)); posConstraint.Apply(); - application.GetScene().Add( child ); + application.GetScene().Add(child); application.SendNotification(); application.Render(0); @@ -3092,8 +3199,8 @@ int UtcDaliActorConstrainedToWorldMatrix(void) Matrix parentMatrix(false); parentMatrix.SetTransformComponents(parentScale, parentRotation, parentPosition); - DALI_TEST_EQUALS( parent.GetCurrentProperty< Matrix >( Actor::Property::WORLD_MATRIX ), parentMatrix, 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetCurrentProperty(Actor::Property::WORLD_MATRIX), parentMatrix, 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::POSITION), parent.GetCurrentProperty(Actor::Property::POSITION), 0.001, TEST_LOCATION); END_TEST; } @@ -3103,31 +3210,31 @@ int UtcDaliActorConstrainedToOrientation(void) tet_infoline(" UtcDaliActorConstrainedToOrientation"); Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); - Vector3 parentPosition( 10.0f, 20.0f, 30.0f); - Radian rotationAngle(Degree(85.0f)); + parent.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + parent.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + Vector3 parentPosition(10.0f, 20.0f, 30.0f); + Radian rotationAngle(Degree(85.0f)); Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); - Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetProperty( Actor::Property::POSITION, parentPosition ); - parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); - parent.SetProperty( Actor::Property::SCALE, parentScale ); - application.GetScene().Add( parent ); + Vector3 parentScale(1.0f, 2.0f, 3.0f); + parent.SetProperty(Actor::Property::POSITION, parentPosition); + parent.SetProperty(Actor::Property::ORIENTATION, parentRotation); + parent.SetProperty(Actor::Property::SCALE, parentScale); + application.GetScene().Add(parent); Actor child = Actor::New(); - child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); - Constraint posConstraint = Constraint::New( child, Actor::Property::ORIENTATION, OrientationComponentConstraint() ); - posConstraint.AddSource( Source( parent, Actor::Property::ORIENTATION ) ); + child.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Constraint posConstraint = Constraint::New(child, Actor::Property::ORIENTATION, OrientationComponentConstraint()); + posConstraint.AddSource(Source(parent, Actor::Property::ORIENTATION)); posConstraint.Apply(); - application.GetScene().Add( child ); + application.GetScene().Add(child); application.SendNotification(); application.Render(0); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), parent.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::ORIENTATION), parent.GetCurrentProperty(Actor::Property::ORIENTATION), 0.001, TEST_LOCATION); END_TEST; } @@ -3137,31 +3244,31 @@ int UtcDaliActorConstrainedToOpacity(void) tet_infoline(" UtcDaliActorConstrainedToOpacity"); Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::OPACITY, 0.7f ); - application.GetScene().Add( parent ); + parent.SetProperty(Actor::Property::OPACITY, 0.7f); + application.GetScene().Add(parent); - Actor child = Actor::New(); - Constraint opacityConstraint = Constraint::New( child, Actor::Property::OPACITY, EqualToConstraint() ); - opacityConstraint.AddSource( Source( parent, Actor::Property::OPACITY ) ); + Actor child = Actor::New(); + Constraint opacityConstraint = Constraint::New(child, Actor::Property::OPACITY, EqualToConstraint()); + opacityConstraint.AddSource(Source(parent, Actor::Property::OPACITY)); opacityConstraint.Apply(); - application.GetScene().Add( child ); + application.GetScene().Add(child); application.SendNotification(); application.Render(0); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( child.GetCurrentProperty< float >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::OPACITY), parent.GetCurrentProperty(Actor::Property::OPACITY), 0.001f, TEST_LOCATION); - parent.SetProperty( Actor::Property::OPACITY, 0.3f ); + parent.SetProperty(Actor::Property::OPACITY, 0.3f); application.SendNotification(); application.Render(0); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( child.GetCurrentProperty< float >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS(child.GetCurrentProperty(Actor::Property::OPACITY), parent.GetCurrentProperty(Actor::Property::OPACITY), 0.001f, TEST_LOCATION); END_TEST; } @@ -3172,45 +3279,45 @@ int UtcDaliActorUnparent(void) tet_infoline(" UtcDaliActorUnparent"); Actor parent = Actor::New(); - application.GetScene().Add( parent ); + application.GetScene().Add(parent); Actor child = Actor::New(); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); - DALI_TEST_CHECK( !child.GetParent() ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); + DALI_TEST_CHECK(!child.GetParent()); // Test that calling Unparent with no parent is a NOOP child.Unparent(); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); - DALI_TEST_CHECK( !child.GetParent() ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); + DALI_TEST_CHECK(!child.GetParent()); // Test that Unparent works - parent.Add( child ); + parent.Add(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); - DALI_TEST_CHECK( parent == child.GetParent() ); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); + DALI_TEST_CHECK(parent == child.GetParent()); child.Unparent(); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); - DALI_TEST_CHECK( !child.GetParent() ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); + DALI_TEST_CHECK(!child.GetParent()); // Test that UnparentAndReset works - parent.Add( child ); + parent.Add(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION ); - DALI_TEST_CHECK( parent == child.GetParent() ); + DALI_TEST_EQUALS(parent.GetChildCount(), 1u, TEST_LOCATION); + DALI_TEST_CHECK(parent == child.GetParent()); - UnparentAndReset( child ); + UnparentAndReset(child); - DALI_TEST_EQUALS( parent.GetChildCount(), 0u, TEST_LOCATION ); - DALI_TEST_CHECK( !child ); + DALI_TEST_EQUALS(parent.GetChildCount(), 0u, TEST_LOCATION); + DALI_TEST_CHECK(!child); // Test that UnparentAndReset is a NOOP with empty handle - UnparentAndReset( child ); + UnparentAndReset(child); - DALI_TEST_CHECK( !child ); + DALI_TEST_CHECK(!child); END_TEST; } @@ -3220,20 +3327,20 @@ int UtcDaliActorGetChildAt(void) tet_infoline(" UtcDaliActorGetChildAt"); Actor parent = Actor::New(); - application.GetScene().Add( parent ); + application.GetScene().Add(parent); Actor child0 = Actor::New(); - parent.Add( child0 ); + parent.Add(child0); Actor child1 = Actor::New(); - parent.Add( child1 ); + parent.Add(child1); Actor child2 = Actor::New(); - parent.Add( child2 ); + parent.Add(child2); - DALI_TEST_EQUALS( parent.GetChildAt( 0 ), child0, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetChildAt( 1 ), child1, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetChildAt( 2 ), child2, TEST_LOCATION ); + DALI_TEST_EQUALS(parent.GetChildAt(0), child0, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetChildAt(1), child1, TEST_LOCATION); + DALI_TEST_EQUALS(parent.GetChildAt(2), child2, TEST_LOCATION); END_TEST; } @@ -3243,16 +3350,15 @@ int UtcDaliActorSetGetOverlay(void) tet_infoline(" UtcDaliActorSetGetOverlay"); Actor parent = Actor::New(); - parent.SetProperty( Actor::Property::DRAW_MODE,DrawMode::OVERLAY_2D ); - DALI_TEST_CHECK( parent.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) == DrawMode::OVERLAY_2D ); + parent.SetProperty(Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D); + DALI_TEST_CHECK(parent.GetProperty(Actor::Property::DRAW_MODE) == DrawMode::OVERLAY_2D); END_TEST; } - int UtcDaliActorCreateDestroy(void) { Actor* actor = new Actor; - DALI_TEST_CHECK( actor ); + DALI_TEST_CHECK(actor); delete actor; END_TEST; } @@ -3261,69 +3367,69 @@ namespace { struct PropertyStringIndex { - const char * const name; + const char* const name; const Property::Index index; - const Property::Type type; + const Property::Type type; }; const PropertyStringIndex PROPERTY_TABLE[] = -{ - { "parentOrigin", Actor::Property::PARENT_ORIGIN, Property::VECTOR3 }, - { "parentOriginX", Actor::Property::PARENT_ORIGIN_X, Property::FLOAT }, - { "parentOriginY", Actor::Property::PARENT_ORIGIN_Y, Property::FLOAT }, - { "parentOriginZ", Actor::Property::PARENT_ORIGIN_Z, Property::FLOAT }, - { "anchorPoint", Actor::Property::ANCHOR_POINT, Property::VECTOR3 }, - { "anchorPointX", Actor::Property::ANCHOR_POINT_X, Property::FLOAT }, - { "anchorPointY", Actor::Property::ANCHOR_POINT_Y, Property::FLOAT }, - { "anchorPointZ", Actor::Property::ANCHOR_POINT_Z, Property::FLOAT }, - { "size", Actor::Property::SIZE, Property::VECTOR3 }, - { "sizeWidth", Actor::Property::SIZE_WIDTH, Property::FLOAT }, - { "sizeHeight", Actor::Property::SIZE_HEIGHT, Property::FLOAT }, - { "sizeDepth", Actor::Property::SIZE_DEPTH, Property::FLOAT }, - { "position", Actor::Property::POSITION, Property::VECTOR3 }, - { "positionX", Actor::Property::POSITION_X, Property::FLOAT }, - { "positionY", Actor::Property::POSITION_Y, Property::FLOAT }, - { "positionZ", Actor::Property::POSITION_Z, Property::FLOAT }, - { "worldPosition", Actor::Property::WORLD_POSITION, Property::VECTOR3 }, - { "worldPositionX", Actor::Property::WORLD_POSITION_X, Property::FLOAT }, - { "worldPositionY", Actor::Property::WORLD_POSITION_Y, Property::FLOAT }, - { "worldPositionZ", Actor::Property::WORLD_POSITION_Z, Property::FLOAT }, - { "orientation", Actor::Property::ORIENTATION, Property::ROTATION }, - { "worldOrientation", Actor::Property::WORLD_ORIENTATION, Property::ROTATION }, - { "scale", Actor::Property::SCALE, Property::VECTOR3 }, - { "scaleX", Actor::Property::SCALE_X, Property::FLOAT }, - { "scaleY", Actor::Property::SCALE_Y, Property::FLOAT }, - { "scaleZ", Actor::Property::SCALE_Z, Property::FLOAT }, - { "worldScale", Actor::Property::WORLD_SCALE, Property::VECTOR3 }, - { "visible", Actor::Property::VISIBLE, Property::BOOLEAN }, - { "color", Actor::Property::COLOR, Property::VECTOR4 }, - { "colorRed", Actor::Property::COLOR_RED, Property::FLOAT }, - { "colorGreen", Actor::Property::COLOR_GREEN, Property::FLOAT }, - { "colorBlue", Actor::Property::COLOR_BLUE, Property::FLOAT }, - { "colorAlpha", Actor::Property::COLOR_ALPHA, Property::FLOAT }, - { "worldColor", Actor::Property::WORLD_COLOR, Property::VECTOR4 }, - { "worldMatrix", Actor::Property::WORLD_MATRIX, Property::MATRIX }, - { "name", Actor::Property::NAME, Property::STRING }, - { "sensitive", Actor::Property::SENSITIVE, Property::BOOLEAN }, - { "leaveRequired", Actor::Property::LEAVE_REQUIRED, Property::BOOLEAN }, - { "inheritOrientation", Actor::Property::INHERIT_ORIENTATION, Property::BOOLEAN }, - { "inheritScale", Actor::Property::INHERIT_SCALE, Property::BOOLEAN }, - { "colorMode", Actor::Property::COLOR_MODE, Property::INTEGER }, - { "drawMode", Actor::Property::DRAW_MODE, Property::INTEGER }, - { "sizeModeFactor", Actor::Property::SIZE_MODE_FACTOR, Property::VECTOR3 }, - { "widthResizePolicy", Actor::Property::WIDTH_RESIZE_POLICY, Property::STRING }, - { "heightResizePolicy", Actor::Property::HEIGHT_RESIZE_POLICY, Property::STRING }, - { "sizeScalePolicy", Actor::Property::SIZE_SCALE_POLICY, Property::INTEGER }, - { "widthForHeight", Actor::Property::WIDTH_FOR_HEIGHT, Property::BOOLEAN }, - { "heightForWidth", Actor::Property::HEIGHT_FOR_WIDTH, Property::BOOLEAN }, - { "padding", Actor::Property::PADDING, Property::VECTOR4 }, - { "minimumSize", Actor::Property::MINIMUM_SIZE, Property::VECTOR2 }, - { "maximumSize", Actor::Property::MAXIMUM_SIZE, Property::VECTOR2 }, - { "inheritPosition", Actor::Property::INHERIT_POSITION, Property::BOOLEAN }, - { "clippingMode", Actor::Property::CLIPPING_MODE, Property::STRING }, - { "opacity", Actor::Property::OPACITY, Property::FLOAT }, + { + {"parentOrigin", Actor::Property::PARENT_ORIGIN, Property::VECTOR3}, + {"parentOriginX", Actor::Property::PARENT_ORIGIN_X, Property::FLOAT}, + {"parentOriginY", Actor::Property::PARENT_ORIGIN_Y, Property::FLOAT}, + {"parentOriginZ", Actor::Property::PARENT_ORIGIN_Z, Property::FLOAT}, + {"anchorPoint", Actor::Property::ANCHOR_POINT, Property::VECTOR3}, + {"anchorPointX", Actor::Property::ANCHOR_POINT_X, Property::FLOAT}, + {"anchorPointY", Actor::Property::ANCHOR_POINT_Y, Property::FLOAT}, + {"anchorPointZ", Actor::Property::ANCHOR_POINT_Z, Property::FLOAT}, + {"size", Actor::Property::SIZE, Property::VECTOR3}, + {"sizeWidth", Actor::Property::SIZE_WIDTH, Property::FLOAT}, + {"sizeHeight", Actor::Property::SIZE_HEIGHT, Property::FLOAT}, + {"sizeDepth", Actor::Property::SIZE_DEPTH, Property::FLOAT}, + {"position", Actor::Property::POSITION, Property::VECTOR3}, + {"positionX", Actor::Property::POSITION_X, Property::FLOAT}, + {"positionY", Actor::Property::POSITION_Y, Property::FLOAT}, + {"positionZ", Actor::Property::POSITION_Z, Property::FLOAT}, + {"worldPosition", Actor::Property::WORLD_POSITION, Property::VECTOR3}, + {"worldPositionX", Actor::Property::WORLD_POSITION_X, Property::FLOAT}, + {"worldPositionY", Actor::Property::WORLD_POSITION_Y, Property::FLOAT}, + {"worldPositionZ", Actor::Property::WORLD_POSITION_Z, Property::FLOAT}, + {"orientation", Actor::Property::ORIENTATION, Property::ROTATION}, + {"worldOrientation", Actor::Property::WORLD_ORIENTATION, Property::ROTATION}, + {"scale", Actor::Property::SCALE, Property::VECTOR3}, + {"scaleX", Actor::Property::SCALE_X, Property::FLOAT}, + {"scaleY", Actor::Property::SCALE_Y, Property::FLOAT}, + {"scaleZ", Actor::Property::SCALE_Z, Property::FLOAT}, + {"worldScale", Actor::Property::WORLD_SCALE, Property::VECTOR3}, + {"visible", Actor::Property::VISIBLE, Property::BOOLEAN}, + {"color", Actor::Property::COLOR, Property::VECTOR4}, + {"colorRed", Actor::Property::COLOR_RED, Property::FLOAT}, + {"colorGreen", Actor::Property::COLOR_GREEN, Property::FLOAT}, + {"colorBlue", Actor::Property::COLOR_BLUE, Property::FLOAT}, + {"colorAlpha", Actor::Property::COLOR_ALPHA, Property::FLOAT}, + {"worldColor", Actor::Property::WORLD_COLOR, Property::VECTOR4}, + {"worldMatrix", Actor::Property::WORLD_MATRIX, Property::MATRIX}, + {"name", Actor::Property::NAME, Property::STRING}, + {"sensitive", Actor::Property::SENSITIVE, Property::BOOLEAN}, + {"leaveRequired", Actor::Property::LEAVE_REQUIRED, Property::BOOLEAN}, + {"inheritOrientation", Actor::Property::INHERIT_ORIENTATION, Property::BOOLEAN}, + {"inheritScale", Actor::Property::INHERIT_SCALE, Property::BOOLEAN}, + {"colorMode", Actor::Property::COLOR_MODE, Property::INTEGER}, + {"drawMode", Actor::Property::DRAW_MODE, Property::INTEGER}, + {"sizeModeFactor", Actor::Property::SIZE_MODE_FACTOR, Property::VECTOR3}, + {"widthResizePolicy", Actor::Property::WIDTH_RESIZE_POLICY, Property::STRING}, + {"heightResizePolicy", Actor::Property::HEIGHT_RESIZE_POLICY, Property::STRING}, + {"sizeScalePolicy", Actor::Property::SIZE_SCALE_POLICY, Property::INTEGER}, + {"widthForHeight", Actor::Property::WIDTH_FOR_HEIGHT, Property::BOOLEAN}, + {"heightForWidth", Actor::Property::HEIGHT_FOR_WIDTH, Property::BOOLEAN}, + {"padding", Actor::Property::PADDING, Property::VECTOR4}, + {"minimumSize", Actor::Property::MINIMUM_SIZE, Property::VECTOR2}, + {"maximumSize", Actor::Property::MAXIMUM_SIZE, Property::VECTOR2}, + {"inheritPosition", Actor::Property::INHERIT_POSITION, Property::BOOLEAN}, + {"clippingMode", Actor::Property::CLIPPING_MODE, Property::STRING}, + {"opacity", Actor::Property::OPACITY, Property::FLOAT}, }; -const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] ); +const unsigned int PROPERTY_TABLE_COUNT = sizeof(PROPERTY_TABLE) / sizeof(PROPERTY_TABLE[0]); } // unnamed namespace int UtcDaliActorProperties(void) @@ -3332,12 +3438,12 @@ int UtcDaliActorProperties(void) Actor actor = Actor::New(); - for ( unsigned int i = 0; i < PROPERTY_TABLE_COUNT; ++i ) + for(unsigned int i = 0; i < PROPERTY_TABLE_COUNT; ++i) { - tet_printf( "Checking %s == %d\n", PROPERTY_TABLE[i].name, PROPERTY_TABLE[i].index ); - DALI_TEST_EQUALS( actor.GetPropertyName( PROPERTY_TABLE[i].index ), PROPERTY_TABLE[i].name, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetPropertyIndex( PROPERTY_TABLE[i].name ), PROPERTY_TABLE[i].index, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetPropertyType( PROPERTY_TABLE[i].index ), PROPERTY_TABLE[i].type, TEST_LOCATION ); + tet_printf("Checking %s == %d\n", PROPERTY_TABLE[i].name, PROPERTY_TABLE[i].index); + DALI_TEST_EQUALS(actor.GetPropertyName(PROPERTY_TABLE[i].index), PROPERTY_TABLE[i].name, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetPropertyIndex(PROPERTY_TABLE[i].name), PROPERTY_TABLE[i].index, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetPropertyType(PROPERTY_TABLE[i].index), PROPERTY_TABLE[i].type, TEST_LOCATION); } END_TEST; } @@ -3349,35 +3455,35 @@ int UtcDaliRelayoutProperties_ResizePolicies(void) Actor actor = Actor::New(); // Defaults - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::WIDTH_RESIZE_POLICY).Get(), "USE_NATURAL_SIZE", TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::HEIGHT_RESIZE_POLICY).Get(), "USE_NATURAL_SIZE", TEST_LOCATION); // Set resize policy for all dimensions - actor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); - for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i) + actor.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS); + for(unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i) { - DALI_TEST_EQUALS( actor.GetResizePolicy( static_cast< Dimension::Type >( 1 << i ) ), ResizePolicy::USE_NATURAL_SIZE, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetResizePolicy(static_cast(1 << i)), ResizePolicy::USE_NATURAL_SIZE, TEST_LOCATION); } // Set individual dimensions - const char* const widthPolicy = "FILL_TO_PARENT"; + const char* const widthPolicy = "FILL_TO_PARENT"; const char* const heightPolicy = "FIXED"; - actor.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, widthPolicy ); - actor.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, heightPolicy ); + actor.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, widthPolicy); + actor.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, heightPolicy); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), widthPolicy, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), heightPolicy, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::WIDTH_RESIZE_POLICY).Get(), widthPolicy, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::HEIGHT_RESIZE_POLICY).Get(), heightPolicy, TEST_LOCATION); // Set individual dimensions using enums - ResizePolicy::Type widthPolicyEnum = ResizePolicy::USE_ASSIGNED_SIZE; + ResizePolicy::Type widthPolicyEnum = ResizePolicy::USE_ASSIGNED_SIZE; ResizePolicy::Type heightPolicyEnum = ResizePolicy::SIZE_RELATIVE_TO_PARENT; - actor.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, widthPolicyEnum ); - actor.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, heightPolicyEnum ); + actor.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, widthPolicyEnum); + actor.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, heightPolicyEnum); - DALI_TEST_EQUALS( static_cast< int >( actor.GetResizePolicy( Dimension::WIDTH ) ), static_cast< int >( widthPolicyEnum ), TEST_LOCATION ); - DALI_TEST_EQUALS( static_cast< int >( actor.GetResizePolicy( Dimension::HEIGHT ) ), static_cast< int >( heightPolicyEnum ), TEST_LOCATION ); + DALI_TEST_EQUALS(static_cast(actor.GetResizePolicy(Dimension::WIDTH)), static_cast(widthPolicyEnum), TEST_LOCATION); + DALI_TEST_EQUALS(static_cast(actor.GetResizePolicy(Dimension::HEIGHT)), static_cast(heightPolicyEnum), TEST_LOCATION); END_TEST; } @@ -3389,21 +3495,21 @@ int UtcDaliRelayoutProperties_SizeScalePolicy(void) Actor actor = Actor::New(); // Defaults - DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), SizeScalePolicy::USE_SIZE_SET, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_SCALE_POLICY), SizeScalePolicy::USE_SIZE_SET, TEST_LOCATION); SizeScalePolicy::Type policy = SizeScalePolicy::FILL_WITH_ASPECT_RATIO; - actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy ); - DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_SCALE_POLICY, policy); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_SCALE_POLICY), policy, TEST_LOCATION); // Set const SizeScalePolicy::Type policy1 = SizeScalePolicy::FIT_WITH_ASPECT_RATIO; const SizeScalePolicy::Type policy2 = SizeScalePolicy::FILL_WITH_ASPECT_RATIO; - actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy1 ); - DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy1, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_SCALE_POLICY, policy1); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_SCALE_POLICY), policy1, TEST_LOCATION); - actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy2 ); - DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy2, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_SCALE_POLICY, policy2); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_SCALE_POLICY), policy2, TEST_LOCATION); END_TEST; } @@ -3415,18 +3521,18 @@ int UtcDaliRelayoutProperties_SizeModeFactor(void) Actor actor = Actor::New(); // Defaults - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_MODE_FACTOR ).Get< Vector3 >(), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_MODE_FACTOR).Get(), Vector3(1.0f, 1.0f, 1.0f), TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_MODE_FACTOR), Vector3(1.0f, 1.0f, 1.0f), TEST_LOCATION); - Vector3 sizeMode( 1.0f, 2.0f, 3.0f ); - actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeMode ); - DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ), sizeMode, TEST_LOCATION ); + Vector3 sizeMode(1.0f, 2.0f, 3.0f); + actor.SetProperty(Actor::Property::SIZE_MODE_FACTOR, sizeMode); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_MODE_FACTOR), sizeMode, TEST_LOCATION); // Set - Vector3 sizeMode1( 2.0f, 3.0f, 4.0f ); + Vector3 sizeMode1(2.0f, 3.0f, 4.0f); - actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeMode1 ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_MODE_FACTOR ).Get< Vector3 >(), sizeMode1, TEST_LOCATION ); + actor.SetProperty(Actor::Property::SIZE_MODE_FACTOR, sizeMode1); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::SIZE_MODE_FACTOR).Get(), sizeMode1, TEST_LOCATION); END_TEST; } @@ -3438,19 +3544,19 @@ int UtcDaliRelayoutProperties_DimensionDependency(void) Actor actor = Actor::New(); // Defaults - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_FOR_HEIGHT ).Get< bool >(), false, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_FOR_WIDTH ).Get< bool >(), false, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::WIDTH_FOR_HEIGHT).Get(), false, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::HEIGHT_FOR_WIDTH).Get(), false, TEST_LOCATION); // Set - actor.SetProperty( Actor::Property::WIDTH_FOR_HEIGHT, true ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_FOR_HEIGHT ).Get< bool >(), true, TEST_LOCATION ); + actor.SetProperty(Actor::Property::WIDTH_FOR_HEIGHT, true); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::WIDTH_FOR_HEIGHT).Get(), true, TEST_LOCATION); - actor.SetProperty( Actor::Property::HEIGHT_FOR_WIDTH, true ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_FOR_WIDTH ).Get< bool >(), true, TEST_LOCATION ); + actor.SetProperty(Actor::Property::HEIGHT_FOR_WIDTH, true); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::HEIGHT_FOR_WIDTH).Get(), true, TEST_LOCATION); // Test setting another resize policy - actor.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FIXED" ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_FOR_HEIGHT ).Get< bool >(), false, TEST_LOCATION ); + actor.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FIXED"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::WIDTH_FOR_HEIGHT).Get(), false, TEST_LOCATION); END_TEST; } @@ -3462,13 +3568,13 @@ int UtcDaliRelayoutProperties_Padding(void) Actor actor = Actor::New(); // Data - Vector4 padding( 1.0f, 2.0f, 3.0f, 4.0f ); + Vector4 padding(1.0f, 2.0f, 3.0f, 4.0f); // PADDING - actor.SetProperty( Actor::Property::PADDING, padding ); - Vector4 paddingResult = actor.GetProperty( Actor::Property::PADDING ).Get< Vector4 >(); + actor.SetProperty(Actor::Property::PADDING, padding); + Vector4 paddingResult = actor.GetProperty(Actor::Property::PADDING).Get(); - DALI_TEST_EQUALS( paddingResult, padding, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS(paddingResult, padding, Math::MACHINE_EPSILON_0, TEST_LOCATION); END_TEST; } @@ -3480,19 +3586,19 @@ int UtcDaliRelayoutProperties_MinimumMaximumSize(void) Actor actor = Actor::New(); // Data - Vector2 minSize( 1.0f, 2.0f ); + Vector2 minSize(1.0f, 2.0f); - actor.SetProperty( Actor::Property::MINIMUM_SIZE, minSize ); - Vector2 resultMin = actor.GetProperty( Actor::Property::MINIMUM_SIZE ).Get< Vector2 >(); + actor.SetProperty(Actor::Property::MINIMUM_SIZE, minSize); + Vector2 resultMin = actor.GetProperty(Actor::Property::MINIMUM_SIZE).Get(); - DALI_TEST_EQUALS( resultMin, minSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS(resultMin, minSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); - Vector2 maxSize( 3.0f, 4.0f ); + Vector2 maxSize(3.0f, 4.0f); - actor.SetProperty( Actor::Property::MAXIMUM_SIZE, maxSize ); - Vector2 resultMax = actor.GetProperty( Actor::Property::MAXIMUM_SIZE ).Get< Vector2 >(); + actor.SetProperty(Actor::Property::MAXIMUM_SIZE, maxSize); + Vector2 resultMax = actor.GetProperty(Actor::Property::MAXIMUM_SIZE).Get(); - DALI_TEST_EQUALS( resultMax, maxSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS(resultMax, maxSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); END_TEST; } @@ -3503,7 +3609,7 @@ int UtcDaliActorGetHeightForWidth(void) Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetHeightForWidth( 1.0f ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetHeightForWidth(1.0f), 1.0f, TEST_LOCATION); END_TEST; } @@ -3514,7 +3620,7 @@ int UtcDaliActorGetWidthForHeight(void) Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetWidthForHeight( 1.0f ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetWidthForHeight(1.0f), 1.0f, TEST_LOCATION); END_TEST; } @@ -3526,18 +3632,18 @@ int UtcDaliActorGetRelayoutSize(void) Actor actor = Actor::New(); // Add actor to stage - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - DALI_TEST_EQUALS( actor.GetRelayoutSize( Dimension::WIDTH ), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRelayoutSize(Dimension::WIDTH), 0.0f, TEST_LOCATION); - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 0.0f ) ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::WIDTH); + actor.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 0.0f)); // Flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetRelayoutSize( Dimension::WIDTH ), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRelayoutSize(Dimension::WIDTH), 1.0f, TEST_LOCATION); END_TEST; } @@ -3549,22 +3655,22 @@ int UtcDaliActorSetPadding(void) Actor actor = Actor::New(); Padding padding; - padding = actor.GetProperty( Actor::Property::PADDING ); + padding = actor.GetProperty(Actor::Property::PADDING); - DALI_TEST_EQUALS( padding.left, 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( padding.right, 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( padding.bottom, 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( padding.top, 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(padding.left, 0.0f, TEST_LOCATION); + DALI_TEST_EQUALS(padding.right, 0.0f, TEST_LOCATION); + DALI_TEST_EQUALS(padding.bottom, 0.0f, TEST_LOCATION); + DALI_TEST_EQUALS(padding.top, 0.0f, TEST_LOCATION); - Padding padding2( 1.0f, 2.0f, 3.0f, 4.0f ); - actor.SetProperty( Actor::Property::PADDING, padding2 ); + Padding padding2(1.0f, 2.0f, 3.0f, 4.0f); + actor.SetProperty(Actor::Property::PADDING, padding2); - padding = actor.GetProperty( Actor::Property::PADDING ); + padding = actor.GetProperty(Actor::Property::PADDING); - DALI_TEST_EQUALS( padding.left, padding2.left, TEST_LOCATION ); - DALI_TEST_EQUALS( padding.right, padding2.right, TEST_LOCATION ); - DALI_TEST_EQUALS( padding.bottom, padding2.bottom, TEST_LOCATION ); - DALI_TEST_EQUALS( padding.top, padding2.top, TEST_LOCATION ); + DALI_TEST_EQUALS(padding.left, padding2.left, TEST_LOCATION); + DALI_TEST_EQUALS(padding.right, padding2.right, TEST_LOCATION); + DALI_TEST_EQUALS(padding.bottom, padding2.bottom, TEST_LOCATION); + DALI_TEST_EQUALS(padding.top, padding2.top, TEST_LOCATION); END_TEST; } @@ -3575,18 +3681,18 @@ int UtcDaliActorSetMinimumSize(void) Actor actor = Actor::New(); - Vector2 size = actor.GetProperty< Vector2 >( Actor::Property::MINIMUM_SIZE ); + Vector2 size = actor.GetProperty(Actor::Property::MINIMUM_SIZE); - DALI_TEST_EQUALS( size.width, 0.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(size.width, 0.0f, TEST_LOCATION); + DALI_TEST_EQUALS(size.height, 0.0f, TEST_LOCATION); - Vector2 size2( 1.0f, 2.0f ); - actor.SetProperty( Actor::Property::MINIMUM_SIZE, size2 ); + Vector2 size2(1.0f, 2.0f); + actor.SetProperty(Actor::Property::MINIMUM_SIZE, size2); - size = actor.GetProperty< Vector2 >( Actor::Property::MINIMUM_SIZE ); + size = actor.GetProperty(Actor::Property::MINIMUM_SIZE); - DALI_TEST_EQUALS( size.width, size2.width, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, size2.height, TEST_LOCATION ); + DALI_TEST_EQUALS(size.width, size2.width, TEST_LOCATION); + DALI_TEST_EQUALS(size.height, size2.height, TEST_LOCATION); END_TEST; } @@ -3597,18 +3703,18 @@ int UtcDaliActorSetMaximumSize(void) Actor actor = Actor::New(); - Vector2 size = actor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ); + Vector2 size = actor.GetProperty(Actor::Property::MAXIMUM_SIZE); - DALI_TEST_EQUALS( size.width, FLT_MAX, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, FLT_MAX, TEST_LOCATION ); + DALI_TEST_EQUALS(size.width, FLT_MAX, TEST_LOCATION); + DALI_TEST_EQUALS(size.height, FLT_MAX, TEST_LOCATION); - Vector2 size2( 1.0f, 2.0f ); - actor.SetProperty( Actor::Property::MAXIMUM_SIZE, size2 ); + Vector2 size2(1.0f, 2.0f); + actor.SetProperty(Actor::Property::MAXIMUM_SIZE, size2); - size = actor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ); + size = actor.GetProperty(Actor::Property::MAXIMUM_SIZE); - DALI_TEST_EQUALS( size.width, size2.width, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, size2.height, TEST_LOCATION ); + DALI_TEST_EQUALS(size.width, size2.width, TEST_LOCATION); + DALI_TEST_EQUALS(size.height, size2.height, TEST_LOCATION); END_TEST; } @@ -3624,25 +3730,25 @@ int UtcDaliActorOnRelayoutSignal(void) gActorNamesRelayout.clear(); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::NAME, "actor" ); - actor.OnRelayoutSignal().Connect( OnRelayoutCallback ); + actor.SetProperty(Actor::Property::NAME, "actor"); + actor.OnRelayoutSignal().Connect(OnRelayoutCallback); // Sanity check - DALI_TEST_CHECK( ! gOnRelayoutCallBackCalled ); + DALI_TEST_CHECK(!gOnRelayoutCallBackCalled); // Add actor to stage - application.GetScene().Add( actor ); + application.GetScene().Add(actor); - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 2.0 ) ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + actor.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 2.0)); // Flush the queue and render once application.SendNotification(); application.Render(); // OnRelayout emitted - DALI_TEST_EQUALS( gOnRelayoutCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( "actor", gActorNamesRelayout[ 0 ], TEST_LOCATION ); + DALI_TEST_EQUALS(gOnRelayoutCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS("actor", gActorNamesRelayout[0], TEST_LOCATION); END_TEST; } @@ -3652,7 +3758,6 @@ int UtcDaliActorGetHierachyDepth(void) TestApplication application; tet_infoline("Testing Dali::Actor::GetHierarchyDepth()"); - /* Build tree of actors: * * Depth @@ -3665,7 +3770,7 @@ int UtcDaliActorGetHierachyDepth(void) * * GetHierarchyDepth should return 1 for A, 2 for B and C, and 3 for D, E and F. */ - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); @@ -3675,48 +3780,48 @@ int UtcDaliActorGetHierachyDepth(void) Actor actorF = Actor::New(); //Test that root actor has depth equal 0 - DALI_TEST_EQUALS( 0, stage.GetRootLayer().GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); + DALI_TEST_EQUALS(0, stage.GetRootLayer().GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); //Test actors return depth -1 when not connected to the tree - DALI_TEST_EQUALS( -1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); + DALI_TEST_EQUALS(-1, actorA.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorB.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorC.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorD.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorE.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorF.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); //Create the hierarchy - stage.Add( actorA ); - actorA.Add( actorB ); - actorA.Add( actorC ); - actorB.Add( actorD ); - actorB.Add( actorE ); - actorC.Add( actorF ); + stage.Add(actorA); + actorA.Add(actorB); + actorA.Add(actorC); + actorB.Add(actorD); + actorB.Add(actorE); + actorC.Add(actorF); //Test actors return correct depth - DALI_TEST_EQUALS( 1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( 2, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( 2, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( 3, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( 3, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( 3, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); + DALI_TEST_EQUALS(1, actorA.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(2, actorB.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(2, actorC.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(3, actorD.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(3, actorE.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(3, actorF.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); //Removing actorB from the hierarchy. actorB, actorD and actorE should now have depth equal -1 - actorA.Remove( actorB ); + actorA.Remove(actorB); - DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); + DALI_TEST_EQUALS(-1, actorB.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorD.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorE.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); //Removing actorA from the stage. All actors should have depth equal -1 - stage.Remove( actorA ); + stage.Remove(actorA); - DALI_TEST_EQUALS( -1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( -1, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION ); + DALI_TEST_EQUALS(-1, actorA.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorB.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorC.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorD.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorE.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); + DALI_TEST_EQUALS(-1, actorF.GetProperty(Actor::Property::HIERARCHY_DEPTH), TEST_LOCATION); END_TEST; } @@ -3727,36 +3832,36 @@ int UtcDaliActorAnchorPointPropertyAsString(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "TOP_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::TOP_LEFT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "TOP_LEFT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::TOP_LEFT, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "TOP_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::TOP_CENTER, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "TOP_CENTER"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::TOP_CENTER, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "TOP_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::TOP_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "TOP_RIGHT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::TOP_RIGHT, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "CENTER_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::CENTER_LEFT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "CENTER_LEFT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::CENTER_LEFT, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::CENTER, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "CENTER"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::CENTER, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "CENTER_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::CENTER_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "CENTER_RIGHT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::CENTER_RIGHT, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "BOTTOM_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "BOTTOM_LEFT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "BOTTOM_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "BOTTOM_CENTER"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION); - actor.SetProperty( Actor::Property::ANCHOR_POINT, "BOTTOM_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "BOTTOM_RIGHT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION); // Invalid should not change anything - actor.SetProperty( Actor::Property::ANCHOR_POINT, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::ANCHOR_POINT, "INVALID_ARG"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::ANCHOR_POINT), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION); END_TEST; } @@ -3767,36 +3872,36 @@ int UtcDaliActorParentOriginPropertyAsString(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "TOP_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "TOP_LEFT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::TOP_LEFT, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "TOP_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_CENTER, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "TOP_CENTER"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::TOP_CENTER, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "TOP_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "TOP_RIGHT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::TOP_RIGHT, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "CENTER_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::CENTER_LEFT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "CENTER_LEFT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::CENTER_LEFT, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::CENTER, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "CENTER"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::CENTER, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "CENTER_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::CENTER_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "CENTER_RIGHT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::CENTER_RIGHT, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "BOTTOM_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "BOTTOM_LEFT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "BOTTOM_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "BOTTOM_CENTER"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "BOTTOM_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "BOTTOM_RIGHT"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION); // Invalid should not change anything - actor.SetProperty( Actor::Property::PARENT_ORIGIN, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, "INVALID_ARG"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::PARENT_ORIGIN), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION); END_TEST; } @@ -3807,21 +3912,21 @@ int UtcDaliActorColorModePropertyAsString(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_COLOR" ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_COLOR, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, "USE_OWN_COLOR"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_COLOR, TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, "USE_PARENT_COLOR" ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, "USE_PARENT_COLOR"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_PARENT_COLOR, TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_COLOR" ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_COLOR"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_ALPHA" ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_ALPHA"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION); // Invalid should not change anything - actor.SetProperty( Actor::Property::COLOR_MODE, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, "INVALID_ARG"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION); END_TEST; } @@ -3832,15 +3937,15 @@ int UtcDaliActorDrawModePropertyAsString(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::DRAW_MODE, "NORMAL" ); - DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::NORMAL, TEST_LOCATION ); + actor.SetProperty(Actor::Property::DRAW_MODE, "NORMAL"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::DRAW_MODE), DrawMode::NORMAL, TEST_LOCATION); - actor.SetProperty( Actor::Property::DRAW_MODE, "OVERLAY_2D" ); - DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); + actor.SetProperty(Actor::Property::DRAW_MODE, "OVERLAY_2D"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::DRAW_MODE), DrawMode::OVERLAY_2D, TEST_LOCATION); // Invalid should not change anything - actor.SetProperty( Actor::Property::DRAW_MODE, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); + actor.SetProperty(Actor::Property::DRAW_MODE, "INVALID_ARG"); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::DRAW_MODE), DrawMode::OVERLAY_2D, TEST_LOCATION); END_TEST; } @@ -3851,17 +3956,17 @@ int UtcDaliActorColorModePropertyAsEnum(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_COLOR, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_COLOR); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_COLOR, TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_PARENT_COLOR); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_PARENT_COLOR, TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION); - actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); - DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + actor.SetProperty(Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::COLOR_MODE), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION); END_TEST; } @@ -3872,11 +3977,11 @@ int UtcDaliActorDrawModePropertyAsEnum(void) Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL ); - DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::NORMAL, TEST_LOCATION ); + actor.SetProperty(Actor::Property::DRAW_MODE, DrawMode::NORMAL); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::DRAW_MODE), DrawMode::NORMAL, TEST_LOCATION); - actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); - DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); + actor.SetProperty(Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::DRAW_MODE), DrawMode::OVERLAY_2D, TEST_LOCATION); END_TEST; } @@ -3888,15 +3993,15 @@ int UtcDaliActorAddRendererP(void) Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); + Shader shader = CreateShader(); Renderer renderer = Renderer::New(geometry, shader); - actor.AddRenderer( renderer ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); + actor.AddRenderer(renderer); + DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetRendererAt(0), renderer, TEST_LOCATION); END_TEST; } @@ -3906,25 +4011,25 @@ int UtcDaliActorAddRendererN01(void) tet_infoline("Testing Actor::AddRenderer"); TestApplication application; - Actor actor = Actor::New(); + Actor actor = Actor::New(); Renderer renderer; // try illegal Add try { - actor.AddRenderer( renderer ); - tet_printf("Assertion test failed - no Exception\n" ); + actor.AddRenderer(renderer); + tet_printf("Assertion test failed - no Exception\n"); tet_result(TET_FAIL); } catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); + DALI_TEST_PRINT_ASSERT(e); DALI_TEST_ASSERT(e, "Renderer handle is empty", TEST_LOCATION); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); } catch(...) { - tet_printf("Assertion test failed - wrong Exception\n" ); + tet_printf("Assertion test failed - wrong Exception\n"); tet_result(TET_FAIL); } @@ -3933,17 +4038,17 @@ int UtcDaliActorAddRendererN01(void) int UtcDaliActorAddRendererN02(void) { - tet_infoline( "UtcDaliActorAddRendererN02" ); + tet_infoline("UtcDaliActorAddRendererN02"); - Actor actor; + Actor actor; Renderer renderer; { TestApplication application; Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); - renderer = Renderer::New( geometry, shader ); + Shader shader = CreateShader(); + renderer = Renderer::New(geometry, shader); actor = Actor::New(); } @@ -3951,19 +4056,19 @@ int UtcDaliActorAddRendererN02(void) // try illegal AddRenderer try { - actor.AddRenderer( renderer ); - tet_printf( "Assertion test failed - no Exception\n" ); - tet_result( TET_FAIL ); + actor.AddRenderer(renderer); + tet_printf("Assertion test failed - no Exception\n"); + tet_result(TET_FAIL); } - catch( Dali::DaliException& e ) + catch(Dali::DaliException& e) { - DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT( e, "EventThreadServices::IsCoreRunning()", TEST_LOCATION ); + DALI_TEST_PRINT_ASSERT(e); + DALI_TEST_ASSERT(e, "EventThreadServices::IsCoreRunning()", TEST_LOCATION); } catch(...) { - tet_printf( "Assertion test failed - wrong Exception\n" ); - tet_result( TET_FAIL ); + tet_printf("Assertion test failed - wrong Exception\n"); + tet_result(TET_FAIL); } END_TEST; @@ -3981,7 +4086,7 @@ int UtcDaliActorAddRendererOnScene(void) application.Render(0); Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); + Shader shader = CreateShader(); Renderer renderer = Renderer::New(geometry, shader); application.SendNotification(); @@ -3989,7 +4094,7 @@ int UtcDaliActorAddRendererOnScene(void) try { - actor.AddRenderer( renderer ); + actor.AddRenderer(renderer); tet_result(TET_PASS); } catch(...) @@ -4007,16 +4112,16 @@ int UtcDaliActorRemoveRendererP1(void) Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); { Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); + Shader shader = CreateShader(); Renderer renderer = Renderer::New(geometry, shader); - actor.AddRenderer( renderer ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); + actor.AddRenderer(renderer); + DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetRendererAt(0), renderer, TEST_LOCATION); application.SendNotification(); application.Render(); @@ -4025,7 +4130,7 @@ int UtcDaliActorRemoveRendererP1(void) { Renderer renderer = actor.GetRendererAt(0); actor.RemoveRenderer(renderer); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); application.SendNotification(); application.Render(); @@ -4047,30 +4152,29 @@ int UtcDaliActorRemoveRendererP2(void) Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); + Shader shader = CreateShader(); Renderer renderer = Renderer::New(geometry, shader); - actor.AddRenderer( renderer ); + actor.AddRenderer(renderer); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetRendererAt(0), renderer, TEST_LOCATION); actor.RemoveRenderer(0); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); // Shut down whilst holding onto the renderer handle. END_TEST; } - int UtcDaliActorRemoveRendererN(void) { tet_infoline("Testing Actor::RemoveRenderer"); @@ -4078,111 +4182,113 @@ int UtcDaliActorRemoveRendererN(void) Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION); Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); + Shader shader = CreateShader(); Renderer renderer = Renderer::New(geometry, shader); - actor.AddRenderer( renderer ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); + actor.AddRenderer(renderer); + DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetRendererAt(0), renderer, TEST_LOCATION); actor.RemoveRenderer(10); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetRendererAt(0), renderer, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION); END_TEST; } // Clipping test helper functions: -Actor CreateActorWithContent( uint32_t width, uint32_t height) +Actor CreateActorWithContent(uint32_t width, uint32_t height) { - Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height ); - Actor actor = CreateRenderableActor( image ); + Texture image = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height); + Actor actor = CreateRenderableActor(image); // Setup dimensions and position so actor is not skipped by culling. - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - actor.SetProperty( Actor::Property::SIZE, Vector2( width, height ) ); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + actor.SetProperty(Actor::Property::SIZE, Vector2(width, height)); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); return actor; } Actor CreateActorWithContent16x16() { - return CreateActorWithContent( 16, 16 ); + return CreateActorWithContent(16, 16); } -void GenerateTrace( TestApplication& application, TraceCallStack& enabledDisableTrace, TraceCallStack& stencilTrace ) +void GenerateTrace(TestApplication& application, TraceCallStack& enabledDisableTrace, TraceCallStack& stencilTrace) { enabledDisableTrace.Reset(); stencilTrace.Reset(); - enabledDisableTrace.Enable( true ); - stencilTrace.Enable( true ); + enabledDisableTrace.Enable(true); + stencilTrace.Enable(true); application.SendNotification(); application.Render(); - enabledDisableTrace.Enable( false ); - stencilTrace.Enable( false ); + enabledDisableTrace.Enable(false); + stencilTrace.Enable(false); } -void CheckColorMask( TestGlAbstraction& glAbstraction, bool maskValue ) +void CheckColorMask(TestGlAbstraction& glAbstraction, bool maskValue) { const TestGlAbstraction::ColorMaskParams& colorMaskParams = glAbstraction.GetColorMaskParams(); - DALI_TEST_EQUALS( colorMaskParams.red, maskValue, TEST_LOCATION ); - DALI_TEST_EQUALS( colorMaskParams.green, maskValue, TEST_LOCATION ); - DALI_TEST_EQUALS( colorMaskParams.blue, maskValue, TEST_LOCATION ); - DALI_TEST_EQUALS( colorMaskParams.alpha, maskValue, TEST_LOCATION ); + DALI_TEST_EQUALS(colorMaskParams.red, maskValue, TEST_LOCATION); + DALI_TEST_EQUALS(colorMaskParams.green, maskValue, TEST_LOCATION); + DALI_TEST_EQUALS(colorMaskParams.blue, maskValue, TEST_LOCATION); + + // @todo only test alpha if the framebuffer has an alpha channel + //DALI_TEST_EQUALS(colorMaskParams.alpha, maskValue, TEST_LOCATION); } int UtcDaliActorPropertyClippingP(void) { // This test checks the clippingMode property. - tet_infoline( "Testing Actor::Property::ClippingMode: P" ); + tet_infoline("Testing Actor::Property::ClippingMode: P"); TestApplication application; Actor actor = Actor::New(); // Check default clippingEnabled value. - Property::Value getValue( actor.GetProperty( Actor::Property::CLIPPING_MODE ) ); + Property::Value getValue(actor.GetProperty(Actor::Property::CLIPPING_MODE)); - int value = 0; - bool getValueResult = getValue.Get( value ); - DALI_TEST_CHECK( getValueResult ); + int value = 0; + bool getValueResult = getValue.Get(value); + DALI_TEST_CHECK(getValueResult); - if( getValueResult ) + if(getValueResult) { - DALI_TEST_EQUALS( value, ClippingMode::DISABLED, TEST_LOCATION ); + DALI_TEST_EQUALS(value, ClippingMode::DISABLED, TEST_LOCATION); } // Check setting the property to the stencil mode. - actor.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); + actor.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); // Check the new value was set. - getValue = actor.GetProperty( Actor::Property::CLIPPING_MODE ); - getValueResult = getValue.Get( value ); - DALI_TEST_CHECK( getValueResult ); + getValue = actor.GetProperty(Actor::Property::CLIPPING_MODE); + getValueResult = getValue.Get(value); + DALI_TEST_CHECK(getValueResult); - if( getValueResult ) + if(getValueResult) { - DALI_TEST_EQUALS( value, ClippingMode::CLIP_CHILDREN, TEST_LOCATION ); + DALI_TEST_EQUALS(value, ClippingMode::CLIP_CHILDREN, TEST_LOCATION); } // Check setting the property to the scissor mode. - actor.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); + actor.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); // Check the new value was set. - getValue = actor.GetProperty( Actor::Property::CLIPPING_MODE ); - getValueResult = getValue.Get( value ); - DALI_TEST_CHECK( getValueResult ); + getValue = actor.GetProperty(Actor::Property::CLIPPING_MODE); + getValueResult = getValue.Get(value); + DALI_TEST_CHECK(getValueResult); - if( getValueResult ) + if(getValueResult) { - DALI_TEST_EQUALS( value, ClippingMode::CLIP_TO_BOUNDING_BOX, TEST_LOCATION ); + DALI_TEST_EQUALS(value, ClippingMode::CLIP_TO_BOUNDING_BOX, TEST_LOCATION); } END_TEST; } @@ -4190,33 +4296,33 @@ int UtcDaliActorPropertyClippingP(void) int UtcDaliActorPropertyClippingN(void) { // Negative test case for Clipping. - tet_infoline( "Testing Actor::Property::ClippingMode: N" ); + tet_infoline("Testing Actor::Property::ClippingMode: N"); TestApplication application; Actor actor = Actor::New(); // Check default clippingEnabled value. - Property::Value getValue( actor.GetProperty( Actor::Property::CLIPPING_MODE ) ); + Property::Value getValue(actor.GetProperty(Actor::Property::CLIPPING_MODE)); - int value = 0; - bool getValueResult = getValue.Get( value ); - DALI_TEST_CHECK( getValueResult ); + int value = 0; + bool getValueResult = getValue.Get(value); + DALI_TEST_CHECK(getValueResult); - if( getValueResult ) + if(getValueResult) { - DALI_TEST_EQUALS( value, ClippingMode::DISABLED, TEST_LOCATION ); + DALI_TEST_EQUALS(value, ClippingMode::DISABLED, TEST_LOCATION); } // Check setting an invalid property value won't change the current property value. - actor.SetProperty( Actor::Property::CLIPPING_MODE, "INVALID_PROPERTY" ); + actor.SetProperty(Actor::Property::CLIPPING_MODE, "INVALID_PROPERTY"); - getValue = actor.GetProperty( Actor::Property::CLIPPING_MODE ); - getValueResult = getValue.Get( value ); - DALI_TEST_CHECK( getValueResult ); + getValue = actor.GetProperty(Actor::Property::CLIPPING_MODE); + getValueResult = getValue.Get(value); + DALI_TEST_CHECK(getValueResult); - if( getValueResult ) + if(getValueResult) { - DALI_TEST_EQUALS( value, ClippingMode::DISABLED, TEST_LOCATION ); + DALI_TEST_EQUALS(value, ClippingMode::DISABLED, TEST_LOCATION); } END_TEST; @@ -4225,35 +4331,37 @@ int UtcDaliActorPropertyClippingN(void) int UtcDaliActorPropertyClippingActor(void) { // This test checks that an actor is correctly setup for clipping. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN actor" ); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_CHILDREN actor"); TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); - size_t startIndex = 0u; + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + size_t startIndex = 0u; // Create a clipping actor. Actor actorDepth1Clip = CreateActorWithContent16x16(); - actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - application.GetScene().Add( actorDepth1Clip ); + actorDepth1Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); + application.GetScene().Add(actorDepth1Clip); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, stencilTrace ); + GenerateTrace(application, enabledDisableTrace, stencilTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check the stencil buffer was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "2960" ) ); // 2960 is GL_STENCIL_TEST + std::ostringstream oss; + oss << std::hex << GL_STENCIL_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", oss.str())); // Check the stencil buffer was cleared. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "ClearStencil", "0", startIndex ) ); + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("ClearStencil", "0", startIndex)); // Check the correct setup was done to write to the first bit-plane (only) of the stencil buffer. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilFunc", "514, 1, 0", startIndex ) ); // 514 is GL_EQUAL, But testing no bit-planes for the first clipping node. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "1", startIndex ) ); - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7681, 7681", startIndex ) ); // GL_KEEP, GL_REPLACE, GL_REPLACE + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 1, 0", startIndex)); // 514 is GL_EQUAL, But testing no bit-planes for the first clipping node. + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilMask", "1", startIndex)); + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7681, 7681", startIndex)); // GL_KEEP, GL_REPLACE, GL_REPLACE END_TEST; } @@ -4261,48 +4369,52 @@ int UtcDaliActorPropertyClippingActor(void) int UtcDaliActorPropertyClippingActorEnableThenDisable(void) { // This test checks that an actor is correctly setup for clipping and then correctly setup when clipping is disabled - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN actor enable and then disable" ); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_CHILDREN actor enable and then disable"); TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); - size_t startIndex = 0u; + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + size_t startIndex = 0u; // Create a clipping actor. Actor actorDepth1Clip = CreateActorWithContent16x16(); - actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - application.GetScene().Add( actorDepth1Clip ); + actorDepth1Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); + application.GetScene().Add(actorDepth1Clip); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, stencilTrace ); + GenerateTrace(application, enabledDisableTrace, stencilTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check the stencil buffer was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "2960" ) ); // 2960 is GL_STENCIL_TEST + std::ostringstream oss; + oss << std::hex << GL_STENCIL_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", oss.str())); // Check the stencil buffer was cleared. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "ClearStencil", "0", startIndex ) ); + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("ClearStencil", "0", startIndex)); // Check the correct setup was done to write to the first bit-plane (only) of the stencil buffer. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilFunc", "514, 1, 0", startIndex ) ); // 514 is GL_EQUAL, But testing no bit-planes for the first clipping node. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "1", startIndex ) ); - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7681, 7681", startIndex ) ); // GL_KEEP, GL_REPLACE, GL_REPLACE + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 1, 0", startIndex)); // 514 is GL_EQUAL, But testing no bit-planes for the first clipping node. + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilMask", "1", startIndex)); + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7681, 7681", startIndex)); // GL_KEEP, GL_REPLACE, GL_REPLACE // Now disable the clipping - actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED ); + actorDepth1Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, stencilTrace ); + GenerateTrace(application, enabledDisableTrace, stencilTrace); // Check the stencil buffer was disabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Disable", "2960" ) ); // 2960 is GL_STENCIL_TEST + std::ostringstream stencil; + stencil << std::hex << GL_STENCIL_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Disable", stencil.str())); // Ensure all values in stencil-mask are set to 1. startIndex = 0u; - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "255", startIndex ) ); + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilMask", "255", startIndex)); END_TEST; } @@ -4311,74 +4423,76 @@ int UtcDaliActorPropertyClippingNestedChildren(void) { // This test checks that a hierarchy of actors are clipped correctly by // writing to and reading from the correct bit-planes of the stencil buffer. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN nested children" ); - TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_CHILDREN nested children"); + TestApplication application; + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); // Create a clipping actor. Actor actorDepth1Clip = CreateActorWithContent16x16(); - actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - application.GetScene().Add( actorDepth1Clip ); + actorDepth1Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); + application.GetScene().Add(actorDepth1Clip); // Create a child actor. Actor childDepth2 = CreateActorWithContent16x16(); - actorDepth1Clip.Add( childDepth2 ); + actorDepth1Clip.Add(childDepth2); // Create another clipping actor. Actor childDepth2Clip = CreateActorWithContent16x16(); - childDepth2Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - childDepth2.Add( childDepth2Clip ); + childDepth2Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); + childDepth2.Add(childDepth2Clip); // Create another 2 child actors. We do this so 2 nodes will have the same clipping ID. // This tests the sort algorithm. Actor childDepth3 = CreateActorWithContent16x16(); - childDepth2Clip.Add( childDepth3 ); + childDepth2Clip.Add(childDepth3); Actor childDepth4 = CreateActorWithContent16x16(); - childDepth3.Add( childDepth4 ); + childDepth3.Add(childDepth4); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, stencilTrace ); + GenerateTrace(application, enabledDisableTrace, stencilTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check the stencil buffer was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "2960" ) ); // 2960 is GL_STENCIL_TEST + std::ostringstream oss; + oss << std::hex << GL_STENCIL_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", oss.str())); // Perform the test twice, once for 2D layer, and once for 3D. - for( unsigned int i = 0u ; i < 2u; ++i ) + for(unsigned int i = 0u; i < 2u; ++i) { size_t startIndex = 0u; // Check the stencil buffer was cleared. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "ClearStencil", "0", startIndex ) ); + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("ClearStencil", "0", startIndex)); // Check the correct setup was done to write to the first bit-plane (only) of the stencil buffer. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilFunc", "514, 1, 0", startIndex ) ); // 514 is GL_EQUAL, But testing no bit-planes for the first clipping node. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "1", startIndex ) ); // Write to the first bit-plane - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7681, 7681", startIndex ) ); // GL_KEEP, GL_REPLACE, GL_REPLACE + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 1, 0", startIndex)); // 514 is GL_EQUAL, But testing no bit-planes for the first clipping node. + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilMask", "1", startIndex)); // Write to the first bit-plane + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7681, 7681", startIndex)); // GL_KEEP, GL_REPLACE, GL_REPLACE // Check the correct setup was done to test against first bit-plane (only) of the stencil buffer. - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilFunc", "514, 1, 255", startIndex ) ); // 514 is GL_EQUAL - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7680, 7680", startIndex ) ); // GL_KEEP, GL_KEEP, GL_KEEP + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 1, 1", startIndex)); // 514 is GL_EQUAL + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7680, 7680", startIndex)); // GL_KEEP, GL_KEEP, GL_KEEP // Check we are set up to write to the second bitplane of the stencil buffer (only). - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilFunc", "514, 3, 1", startIndex ) ); // 514 is GL_EQUAL, Test both bit-planes 1 & 2 - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "3", startIndex ) ); // Write to second (and previous) bit-planes - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7681, 7681", startIndex ) ); // GL_KEEP, GL_REPLACE, GL_REPLACE + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 3, 1", startIndex)); // 514 is GL_EQUAL, Test both bit-planes 1 & 2 + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilMask", "3", startIndex)); // Write to second (and previous) bit-planes + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7681, 7681", startIndex)); // GL_KEEP, GL_REPLACE, GL_REPLACE // Check we are set up to test against both the first and second bit-planes of the stencil buffer. // (Both must be set to pass the check). - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilFunc", "514, 3, 255", startIndex ) ); // 514 is GL_EQUAL, Test both bit-planes 1 & 2 - DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7680, 7680", startIndex ) ); // GL_KEEP, GL_KEEP, GL_KEEP + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 3, 3", startIndex)); // 514 is GL_EQUAL, Test both bit-planes 1 & 2 + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7680, 7680", startIndex)); // GL_KEEP, GL_KEEP, GL_KEEP // If we are on the first loop, set the layer to 3D and loop to perform the test again. - if( i == 0u ) + if(i == 0u) { - application.GetScene().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D ); - GenerateTrace( application, enabledDisableTrace, stencilTrace ); + application.GetScene().GetRootLayer().SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_3D); + GenerateTrace(application, enabledDisableTrace, stencilTrace); } } @@ -4388,10 +4502,10 @@ int UtcDaliActorPropertyClippingNestedChildren(void) int UtcDaliActorPropertyClippingActorDrawOrder(void) { // This test checks that a hierarchy of actors are drawn in the correct order when clipping is enabled. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN draw order" ); - TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_CHILDREN draw order"); + TestApplication application; + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); /* We create a small tree of actors as follows: @@ -4404,256 +4518,329 @@ int UtcDaliActorPropertyClippingActorDrawOrder(void) The correct draw order is "ABCDE" (the same as if clipping was not enabled). */ Actor actors[5]; - for( int i = 0; i < 5; ++i ) + for(int i = 0; i < 5; ++i) { - Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 16u, 16u ); - Actor actor = CreateRenderableActor( image ); + Texture image = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, 16u, 16u); + Actor actor = CreateRenderableActor(image); // Setup dimensions and position so actor is not skipped by culling. - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 16.0f, 16.0f ) ); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + actor.SetProperty(Actor::Property::SIZE, Vector2(16.0f, 16.0f)); - if( i == 0 ) + if(i == 0) { - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); } else { float b = i > 2 ? 1.0f : -1.0f; - actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5 + ( 0.2f * b ), 0.8f, 0.8f ) ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, Vector3(0.5 + (0.2f * b), 0.8f, 0.8f)); } actors[i] = actor; } // Enable clipping on the actor at the top of the left branch. - actors[1].SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); + actors[1].SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); // Build the scene graph. - application.GetScene().Add( actors[0] ); + application.GetScene().Add(actors[0]); // Left branch: - actors[0].Add( actors[1] ); - actors[1].Add( actors[2] ); + actors[0].Add(actors[1]); + actors[1].Add(actors[2]); // Right branch: - actors[0].Add( actors[3] ); - actors[3].Add( actors[4] ); + actors[0].Add(actors[3]); + actors[3].Add(actors[4]); // Gather the call trace. enabledDisableTrace.Reset(); - enabledDisableTrace.Enable( true ); + enabledDisableTrace.Enable(true); application.SendNotification(); application.Render(); - enabledDisableTrace.Enable( false ); + enabledDisableTrace.Enable(false); /* Check stencil is enabled and disabled again (as right-hand branch of tree is drawn). Note: Correct enable call trace: StackTrace: Index:0, Function:Enable, ParamList:3042 StackTrace: Index:1, Function:Enable, ParamList:2960 StackTrace: Index:2, Function:Disable, ParamList:2960 Incorrect enable call trace: StackTrace: Index:0, Function:Enable, ParamList:3042 StackTrace: Index:1, Function:Enable, ParamList:2960 */ - size_t startIndex = 0u; - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParamsFromStartIndex( "Enable", "3042", startIndex ) ); - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParamsFromStartIndex( "Enable", "2960", startIndex ) ); // 2960 is GL_STENCIL_TEST - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParamsFromStartIndex( "Disable", "2960", startIndex ) ); + size_t startIndex = 0u; + std::ostringstream blend; + blend << std::hex << GL_BLEND; + std::ostringstream stencil; + stencil << std::hex << GL_STENCIL_TEST; + + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParamsFromStartIndex("Enable", blend.str(), startIndex)); + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParamsFromStartIndex("Enable", stencil.str(), startIndex)); + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParamsFromStartIndex("Disable", stencil.str(), startIndex)); // Swap the clipping actor from top of left branch to top of right branch. - actors[1].SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED ); - actors[3].SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); + actors[1].SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED); + actors[3].SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); // Gather the call trace. enabledDisableTrace.Reset(); - enabledDisableTrace.Enable( true ); + enabledDisableTrace.Enable(true); application.SendNotification(); application.Render(); - enabledDisableTrace.Enable( false ); + enabledDisableTrace.Enable(false); // Check stencil is enabled but NOT disabled again (as right-hand branch of tree is drawn). // This proves the draw order has remained the same. startIndex = 0u; - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParamsFromStartIndex( "Enable", "2960", startIndex ) ); - DALI_TEST_CHECK( !enabledDisableTrace.FindMethodAndParamsFromStartIndex( "Disable", "2960", startIndex ) ); + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParamsFromStartIndex("Enable", stencil.str(), startIndex)); + DALI_TEST_CHECK(!enabledDisableTrace.FindMethodAndParamsFromStartIndex("Disable", stencil.str(), startIndex)); END_TEST; } -int UtcDaliActorPropertyScissorClippingActor(void) +int UtcDaliActorPropertyScissorClippingActor01(void) { // This test checks that an actor is correctly setup for clipping. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor" ); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor"); TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); - const Vector2 stageSize( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ); - const Vector2 imageSize( 16.0f, 16.0f ); + const Vector2 stageSize(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT); + const Vector2 imageSize(16.0f, 16.0f); // Create a clipping actor. Actor clippingActorA = CreateActorWithContent16x16(); // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system. // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test. - clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); - clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); - clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - application.GetScene().Add( clippingActorA ); + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT); + clippingActorA.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + application.GetScene().Add(clippingActorA); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, scissorTrace ); + GenerateTrace(application, enabledDisableTrace, scissorTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check scissor test was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST) + + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); // Check the scissor was set, and the coordinates are correct. std::stringstream compareParametersString; compareParametersString << "0, 0, " << imageSize.x << ", " << imageSize.y; - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", compareParametersString.str() ) ); // Compare with 0, 0, 16, 16 + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 0, 0, 16, 16 - clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); - clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, scissorTrace ); + GenerateTrace(application, enabledDisableTrace, scissorTrace); // Check the scissor was set, and the coordinates are correct. - compareParametersString.str( std::string() ); + compareParametersString.str(std::string()); compareParametersString.clear(); - compareParametersString << ( stageSize.x - imageSize.x ) << ", " << ( stageSize.y - imageSize.y ) << ", " << imageSize.x << ", " << imageSize.y; - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", compareParametersString.str() ) ); // Compare with 464, 784, 16, 16 + compareParametersString << (stageSize.x - imageSize.x) << ", " << (stageSize.y - imageSize.y) << ", " << imageSize.x << ", " << imageSize.y; + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 464, 784, 16, 16 END_TEST; } -int UtcDaliActorPropertyScissorClippingActorSiblings(void) +int UtcDaliActorPropertyScissorClippingActor02(void) { // This test checks that an actor is correctly setup for clipping. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actors which are siblings" ); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor with a transparent renderer"); TestApplication application; + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); - - const Vector2 stageSize( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ); - const Vector2 sizeA{ stageSize.width, stageSize.height * 0.25f }; - const Vector2 sizeB{ stageSize.width, stageSize.height * 0.05f }; - - // Create a clipping actors. - Actor clippingActorA = CreateActorWithContent( sizeA.width, sizeA.height ); - Actor clippingActorB = CreateActorWithContent( sizeB.width, sizeB.height ); + const Vector2 stageSize(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT); + const Vector2 actorSize(16.0f, 16.0f); - clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); + // Create a clipping actor. + Actor clippingActorA = CreateRenderableActor(); + clippingActorA[Actor::Property::SIZE] = actorSize; - clippingActorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorB.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); + Renderer renderer = clippingActorA.GetRendererAt(0); + DALI_TEST_CHECK(renderer); - clippingActorA.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, -200.0f, 0.0f )); - clippingActorB.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); + // Make Renderer opacity 0. + renderer[DevelRenderer::Property::OPACITY] = 0.0f; - application.GetScene().Add( clippingActorA ); - application.GetScene().Add( clippingActorB ); + // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system. + // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test. + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT); + clippingActorA.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + application.GetScene().Add(clippingActorA); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, scissorTrace ); + GenerateTrace(application, enabledDisableTrace, scissorTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check scissor test was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST) + + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); // Check the scissor was set, and the coordinates are correct. std::stringstream compareParametersString; + compareParametersString << "0, 0, " << actorSize.x << ", " << actorSize.y; + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 0, 0, 16, 16 - std::string clipA( "0, 500, 480, 200" ); - std::string clipB( "0, 380, 480, 40" ); + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT); + + // Gather the call trace. + GenerateTrace(application, enabledDisableTrace, scissorTrace); - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipA ) ); - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipB ) ); + // Check the scissor was set, and the coordinates are correct. + compareParametersString.str(std::string()); + compareParametersString.clear(); + compareParametersString << (stageSize.x - actorSize.x) << ", " << (stageSize.y - actorSize.y) << ", " << actorSize.x << ", " << actorSize.y; + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 464, 784, 16, 16 END_TEST; } -int UtcDaliActorPropertyScissorClippingActorNested01(void) +int UtcDaliActorPropertyScissorClippingActorSiblings(void) { // This test checks that an actor is correctly setup for clipping. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor nested" ); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actors which are siblings"); TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); - const Vector2 stageSize( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ); - const Vector2 imageSize( 16.0f, 16.0f ); + const Vector2 stageSize(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT); + const Vector2 sizeA{stageSize.width, stageSize.height * 0.25f}; + const Vector2 sizeB{stageSize.width, stageSize.height * 0.05f}; - /* Create a nest of 2 scissors to test nesting (intersecting clips). + // Create a clipping actors. + Actor clippingActorA = CreateActorWithContent(sizeA.width, sizeA.height); + Actor clippingActorB = CreateActorWithContent(sizeB.width, sizeB.height); - A is drawn first - with scissor clipping on - B is drawn second - also with scissor clipping on - C is the generated clipping region, the intersection ( A ∩ B ) + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + clippingActorA.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); - ┏━━━━━━━┓ ┌───────┐ - ┃ B ┃ │ B │ - ┌───╂┄┄┄┐ ┃ ┌┄┄┄╆━━━┓ │ - │ ┃ ┊ ┃ ━━━━━> ┊ ┃ C ┃ │ - │ ┗━━━┿━━━┛ ┊ ┗━━━╃───┘ - │ A │ ┊ A ┊ - └───────┘ └┄┄┄┄┄┄┄┘ + clippingActorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + clippingActorB.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); - We then reposition B around each corner of A to test the 4 overlap combinations (thus testing intersecting works correctly). - */ + clippingActorA.SetProperty(Actor::Property::POSITION, Vector3(0.0f, -200.0f, 0.0f)); + clippingActorB.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f)); + + application.GetScene().Add(clippingActorA); + application.GetScene().Add(clippingActorB); + + // Gather the call trace. + GenerateTrace(application, enabledDisableTrace, scissorTrace); + + // Check we are writing to the color buffer. + CheckColorMask(glAbstraction, true); + + // Check scissor test was enabled. + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); + + // Check the scissor was set, and the coordinates are correct. + std::stringstream compareParametersString; + + std::string clipA("0, 500, 480, 200"); + std::string clipB("0, 380, 480, 40"); + + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipA)); + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipB)); + + END_TEST; +} + +int UtcDaliActorPropertyScissorClippingActorNested01(void) +{ + // This test checks that an actor is correctly setup for clipping. + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor nested"); + TestApplication application; + + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + + const Vector2 stageSize(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT); + const Vector2 imageSize(16.0f, 16.0f); + + /* Create a nest of 2 scissors to test nesting (intersecting clips). + + A is drawn first - with scissor clipping on + B is drawn second - also with scissor clipping on + C is the generated clipping region, the intersection ( A ∩ B ) + + ┏━━━━━━━┓ ┌───────┐ + ┃ B ┃ │ B │ + ┌───╂┄┄┄┐ ┃ ┌┄┄┄╆━━━┓ │ + │ ┃ ┊ ┃ ━━━━━> ┊ ┃ C ┃ │ + │ ┗━━━┿━━━┛ ┊ ┗━━━╃───┘ + │ A │ ┊ A ┊ + └───────┘ └┄┄┄┄┄┄┄┘ + + We then reposition B around each corner of A to test the 4 overlap combinations (thus testing intersecting works correctly). + */ // Create a clipping actor. Actor clippingActorA = CreateActorWithContent16x16(); // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system. // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test. - clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - application.GetScene().Add( clippingActorA ); + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + clippingActorA.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + application.GetScene().Add(clippingActorA); // Create a child clipping actor. Actor clippingActorB = CreateActorWithContent16x16(); - clippingActorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - clippingActorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - clippingActorB.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorA.Add( clippingActorB ); + clippingActorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + clippingActorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + clippingActorB.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + clippingActorA.Add(clippingActorB); // positionModifiers is an array of positions to position B around. // expect is an array of expected scissor clip coordinate results. - const Vector2 positionModifiers[4] = { Vector2( 1.0f, 1.0f ), Vector2( -1.0f, 1.0f ), Vector2( -1.0f, -1.0f ), Vector2( 1.0f, -1.0f ) }; - const Vector4 expect[4] = { Vector4( 240, 392, 8, 8 ), Vector4( 232, 392, 8, 8 ), Vector4( 232, 400, 8, 8 ), Vector4( 240, 400, 8, 8 ) }; + const Vector2 positionModifiers[4] = {Vector2(1.0f, 1.0f), Vector2(-1.0f, 1.0f), Vector2(-1.0f, -1.0f), Vector2(1.0f, -1.0f)}; + const Vector4 expect[4] = {Vector4(240, 392, 8, 8), Vector4(232, 392, 8, 8), Vector4(232, 400, 8, 8), Vector4(240, 400, 8, 8)}; // Loop through each overlap combination. - for( unsigned int test = 0u; test < 4u; ++test ) + for(unsigned int test = 0u; test < 4u; ++test) { // Position the child clipping actor so it intersects with the 1st clipping actor. This changes each loop. - const Vector2 position = ( imageSize / 2.0f ) * positionModifiers[test]; - clippingActorB.SetProperty( Actor::Property::POSITION, Vector2( position.x, position.y )); + const Vector2 position = (imageSize / 2.0f) * positionModifiers[test]; + clippingActorB.SetProperty(Actor::Property::POSITION, Vector2(position.x, position.y)); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, scissorTrace ); + GenerateTrace(application, enabledDisableTrace, scissorTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check scissor test was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST) + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); // Check the scissor was set, and the coordinates are correct. - const Vector4& expectResults( expect[test] ); + const Vector4& expectResults(expect[test]); std::stringstream compareParametersString; compareParametersString << expectResults.x << ", " << expectResults.y << ", " << expectResults.z << ", " << expectResults.w; - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", compareParametersString.str() ) ); // Compare with the expected result + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with the expected result } END_TEST; @@ -4662,12 +4849,12 @@ int UtcDaliActorPropertyScissorClippingActorNested01(void) int UtcDaliActorPropertyScissorClippingActorNested02(void) { // This test checks that an actor is correctly setup for clipping. - tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor nested" ); + tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor nested"); TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); /* Create a nest of 2 scissors and siblings of the parent. @@ -4679,71 +4866,73 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) B E */ - const Vector2 stageSize( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ); - const Vector2 sizeA{ stageSize.width, stageSize.height * 0.25f }; - const Vector2 sizeB{ stageSize.width, stageSize.height * 0.05f }; - const Vector2 sizeC{ stageSize.width, stageSize.height * 0.25f }; - const Vector2 sizeD{ stageSize.width, stageSize.height * 0.25f }; - const Vector2 sizeE{ stageSize.width, stageSize.height * 0.05f }; + const Vector2 stageSize(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT); + const Vector2 sizeA{stageSize.width, stageSize.height * 0.25f}; + const Vector2 sizeB{stageSize.width, stageSize.height * 0.05f}; + const Vector2 sizeC{stageSize.width, stageSize.height * 0.25f}; + const Vector2 sizeD{stageSize.width, stageSize.height * 0.25f}; + const Vector2 sizeE{stageSize.width, stageSize.height * 0.05f}; // Create a clipping actors. - Actor clippingActorA = CreateActorWithContent( sizeA.width, sizeA.height ); - Actor clippingActorB = CreateActorWithContent( sizeB.width, sizeB.height ); - Actor clippingActorC = CreateActorWithContent( sizeC.width, sizeC.height ); - Actor clippingActorD = CreateActorWithContent( sizeD.width, sizeD.height ); - Actor clippingActorE = CreateActorWithContent( sizeE.width, sizeE.height ); - - clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - - clippingActorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorB.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - - clippingActorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorC.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - - clippingActorD.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorD.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorD.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - - clippingActorE.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); - clippingActorE.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - - clippingActorA.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, -200.0f, 0.0f )); - clippingActorB.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); - clippingActorC.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 100.0f, 0.0f )); - clippingActorD.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); - clippingActorE.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); - - application.GetScene().Add( clippingActorA ); - clippingActorA.Add( clippingActorB ); - application.GetScene().Add( clippingActorC ); - application.GetScene().Add( clippingActorD ); - clippingActorD.Add( clippingActorE ); + Actor clippingActorA = CreateActorWithContent(sizeA.width, sizeA.height); + Actor clippingActorB = CreateActorWithContent(sizeB.width, sizeB.height); + Actor clippingActorC = CreateActorWithContent(sizeC.width, sizeC.height); + Actor clippingActorD = CreateActorWithContent(sizeD.width, sizeD.height); + Actor clippingActorE = CreateActorWithContent(sizeE.width, sizeE.height); + + clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + clippingActorA.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + + clippingActorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + clippingActorB.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + + clippingActorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + clippingActorC.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + + clippingActorD.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorD.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + clippingActorD.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); + + clippingActorE.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT); + clippingActorE.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT); + + clippingActorA.SetProperty(Actor::Property::POSITION, Vector3(0.0f, -200.0f, 0.0f)); + clippingActorB.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f)); + clippingActorC.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 100.0f, 0.0f)); + clippingActorD.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f)); + clippingActorE.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f)); + + application.GetScene().Add(clippingActorA); + clippingActorA.Add(clippingActorB); + application.GetScene().Add(clippingActorC); + application.GetScene().Add(clippingActorD); + clippingActorD.Add(clippingActorE); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, scissorTrace ); + GenerateTrace(application, enabledDisableTrace, scissorTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check scissor test was enabled. - DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST) + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); // Check the scissor was set, and the coordinates are correct. - std::string clipA( "0, 500, 480, 200" ); - std::string clipB( "0, 580, 480, 40" ); - std::string clipC( "0, 200, 480, 200" ); - std::string clipD( "0, 300, 480, 200" ); + std::string clipA("0, 500, 480, 200"); + std::string clipB("0, 580, 480, 40"); + std::string clipC("0, 200, 480, 200"); + std::string clipD("0, 300, 480, 200"); - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipA ) ); - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipB ) ); - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipC ) ); - DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipD ) ); - DALI_TEST_CHECK( scissorTrace.CountMethod( "Scissor" ) == 4 ); // Scissor rect should not be changed in clippingActorE case. So count should be 4. + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipA)); + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipB)); + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipC)); + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipD)); + DALI_TEST_EQUALS(scissorTrace.CountMethod("Scissor"), 4, TEST_LOCATION); // Scissor rect should not be changed in clippingActorE case. So count should be 4. END_TEST; } @@ -4751,203 +4940,266 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) int UtcDaliActorPropertyClippingActorWithRendererOverride(void) { // This test checks that an actor with clipping will be ignored if overridden by the Renderer properties. - tet_infoline( "Testing Actor::Property::CLIPPING_MODE actor with renderer override" ); + tet_infoline("Testing Actor::Property::CLIPPING_MODE actor with renderer override"); TestApplication application; - TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); - TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); - TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); // Create a clipping actor. Actor actorDepth1Clip = CreateActorWithContent16x16(); - actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - application.GetScene().Add( actorDepth1Clip ); + actorDepth1Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN); + application.GetScene().Add(actorDepth1Clip); // Turn the RenderMode to just "COLOR" at the Renderer level to ignore the clippingMode. - actorDepth1Clip.GetRendererAt( 0 ).SetProperty( Renderer::Property::RENDER_MODE, RenderMode::COLOR ); + actorDepth1Clip.GetRendererAt(0).SetProperty(Renderer::Property::RENDER_MODE, RenderMode::COLOR); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, stencilTrace ); + GenerateTrace(application, enabledDisableTrace, stencilTrace); // Check we are writing to the color buffer. - CheckColorMask( glAbstraction, true ); + CheckColorMask(glAbstraction, true); // Check the stencil buffer was not enabled. - DALI_TEST_CHECK( !enabledDisableTrace.FindMethodAndParams( "Enable", "2960" ) ); // 2960 is GL_STENCIL_TEST + std::ostringstream stencil; + stencil << std::hex << GL_STENCIL_TEST; + DALI_TEST_CHECK(!enabledDisableTrace.FindMethodAndParams("Enable", stencil.str())); // Check stencil functions are not called. - DALI_TEST_CHECK( !stencilTrace.FindMethod( "StencilFunc" ) ); - DALI_TEST_CHECK( !stencilTrace.FindMethod( "StencilMask" ) ); - DALI_TEST_CHECK( !stencilTrace.FindMethod( "StencilOp" ) ); + DALI_TEST_CHECK(!stencilTrace.FindMethod("StencilFunc")); + // TODO: Temporarily commented out the line below when caching is disabled. Will need to add it back. + // DALI_TEST_CHECK(!stencilTrace.FindMethod("StencilMask")); + DALI_TEST_CHECK(!stencilTrace.FindMethod("StencilOp")); // Check that scissor clipping is overriden by the renderer properties. TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); - actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); + actorDepth1Clip.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX); // Gather the call trace. - GenerateTrace( application, enabledDisableTrace, scissorTrace ); + GenerateTrace(application, enabledDisableTrace, scissorTrace); // Check the stencil buffer was not enabled. - DALI_TEST_CHECK( !enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) ); // 3089 = 0xC11 (GL_SCISSOR_TEST) + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(!enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); + + DALI_TEST_CHECK(!scissorTrace.FindMethod("StencilFunc")); + + END_TEST; +} + +int UtcDaliActorPropertyClippingActorCulled(void) +{ + // This test checks that child actors are clipped by an culled parent actor. + tet_infoline("Testing child actors are clipped by an culled parent actor"); + TestApplication application; + + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& scissorTrace = glAbstraction.GetScissorTrace(); + TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace(); + + const Vector2 actorSize(160.0f, 160.0f); + + // Create a clipping actor. + Actor clippingActorA = CreateRenderableActor(); + clippingActorA[Actor::Property::SIZE] = actorSize; + + // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system. + // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test. + clippingActorA[Actor::Property::PARENT_ORIGIN] = ParentOrigin::BOTTOM_LEFT; + clippingActorA[Actor::Property::ANCHOR_POINT] = AnchorPoint::BOTTOM_LEFT; + clippingActorA[Actor::Property::CLIPPING_MODE] = ClippingMode::CLIP_TO_BOUNDING_BOX; + application.GetScene().Add(clippingActorA); + + // Create a child actor + Actor childActor = CreateRenderableActor(); + childActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::BOTTOM_LEFT; + childActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::BOTTOM_LEFT; + childActor[Actor::Property::SIZE] = Vector2(50.0f, 50.0f); + childActor[Actor::Property::INHERIT_POSITION] = false; + + // Gather the call trace. + GenerateTrace(application, enabledDisableTrace, scissorTrace); + + // Check scissor test was enabled. + std::ostringstream scissor; + scissor << std::hex << GL_SCISSOR_TEST; + DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str())); + + // Check the scissor was set, and the coordinates are correct. + std::stringstream compareParametersString; + compareParametersString << "0, 0, " << actorSize.x << ", " << actorSize.y; + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 0, 0, 16, 16 + + // Move the clipping actor out of screen + clippingActorA[Actor::Property::POSITION] = Vector2(2000.0f, 2000.0f); - DALI_TEST_CHECK( !scissorTrace.FindMethod( "StencilFunc" ) ); + // Gather the call trace. + GenerateTrace(application, enabledDisableTrace, scissorTrace); + + // Check the scissor was set, and the coordinates are correct. + compareParametersString.str(std::string()); + compareParametersString.clear(); + compareParametersString << 2000 << ", " << 0 << ", " << 0 << ", " << 0; + DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Clipping area should be empty. END_TEST; } int UtcDaliGetPropertyN(void) { - tet_infoline( "Testing Actor::GetProperty returns a non valid value if property index is out of range" ); + tet_infoline("Testing Actor::GetProperty returns a non valid value if property index is out of range"); TestApplication application; Actor actor = Actor::New(); unsigned int propertyCount = actor.GetPropertyCount(); - DALI_TEST_EQUALS( actor.GetProperty( Property::Index(propertyCount)).GetType(), Property::NONE, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Property::Index(propertyCount)).GetType(), Property::NONE, TEST_LOCATION); END_TEST; } int UtcDaliActorRaiseLower(void) { - tet_infoline( "UtcDaliActor Raise and Lower test\n" ); + tet_infoline("UtcDaliActor Raise and Lower test\n"); TestApplication application; - Debug::Filter::SetGlobalLogLevel( Debug::Verbose ); + Debug::Filter::SetGlobalLogLevel(Debug::Verbose); - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - stage.Add( actorA ); - stage.Add( actorB ); - stage.Add( actorC ); + stage.Add(actorA); + stage.Add(actorB); + stage.Add(actorC); ResetTouchCallbacks(); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Testing Raising of Actor\n" ); + tet_printf("Testing Raising of Actor\n"); - int preActorOrder( 0 ); - int postActorOrder( 0 ); + int preActorOrder(0); + int postActorOrder(0); - Property::Value value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER ); - value.Get( preActorOrder ); + Property::Value value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER); + value.Get(preActorOrder); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.Raise(); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); // Ensure sort order is calculated before next touch event application.SendNotification(); - value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER ); - value.Get( postActorOrder ); + value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER); + value.Get(postActorOrder); - tet_printf( "Raised ActorB from (%d) to (%d) \n", preActorOrder, postActorOrder ); + tet_printf("Raised ActorB from (%d) to (%d) \n", preActorOrder, postActorOrder); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true , TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Testing Lowering of Actor\n" ); + tet_printf("Testing Lowering of Actor\n"); - value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER ); - value.Get( preActorOrder ); + value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER); + value.Get(preActorOrder); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.Lower(); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); application.SendNotification(); // ensure sort order calculated before next touch event - value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER ); - value.Get( postActorOrder ); + value = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER); + value.Get(postActorOrder); - tet_printf( "Lowered ActorB from (%d) to (%d) \n", preActorOrder, postActorOrder ); + tet_printf("Lowered ActorB from (%d) to (%d) \n", preActorOrder, postActorOrder); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false , TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - Debug::Filter::SetGlobalLogLevel( Debug::NoLogging ); + Debug::Filter::SetGlobalLogLevel(Debug::NoLogging); END_TEST; } int UtcDaliActorRaiseToTopLowerToBottom(void) { - tet_infoline( "UtcDaliActorRaiseToTop and LowerToBottom test \n" ); + tet_infoline("UtcDaliActorRaiseToTop and LowerToBottom test \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); @@ -4956,13 +5208,13 @@ int UtcDaliActorRaiseToTopLowerToBottom(void) // Set up renderers to add to Actors, float value 1, 2, 3 assigned to each // enables checking of which actor the uniform is assigned too Shader shaderA = CreateShader(); - shaderA.RegisterProperty( "uRendererColor",1.f); + shaderA.RegisterProperty("uRendererColor", 1.f); Shader shaderB = CreateShader(); - shaderB.RegisterProperty( "uRendererColor", 2.f ); + shaderB.RegisterProperty("uRendererColor", 2.f); Shader shaderC = CreateShader(); - shaderC.RegisterProperty( "uRendererColor", 3.f ); + shaderC.RegisterProperty("uRendererColor", 3.f); Geometry geometry = CreateQuadGeometry(); @@ -4976,35 +5228,35 @@ int UtcDaliActorRaiseToTopLowerToBottom(void) Renderer rendererC = Renderer::New(geometry, shaderC); actorC.AddRenderer(rendererC); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - stage.Add( actorA ); - stage.Add( actorB ); - stage.Add( actorC ); + stage.Add(actorA); + stage.Add(actorB); + stage.Add(actorC); ResetTouchCallbacks(); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); // Set up gl abstraction trace so can query the set uniform order TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); @@ -5016,160 +5268,156 @@ int UtcDaliActorRaiseToTopLowerToBottom(void) application.SendNotification(); application.Render(); - tet_printf( "Trace Output:%s \n", glSetUniformStack.GetTraceString().c_str() ); - + tet_printf("Trace Output:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - int indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - int indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - int indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + int indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + int indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + int indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - bool CBA = ( indexC > indexB) && ( indexB > indexA ); + bool CBA = (indexC > indexB) && (indexB > indexA); - DALI_TEST_EQUALS( CBA, true, TEST_LOCATION ); + DALI_TEST_EQUALS(CBA, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "RaiseToTop ActorA\n" ); + tet_printf("RaiseToTop ActorA\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorA.RaiseToTop(); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); application.SendNotification(); // ensure sorting order is calculated before next touch event - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - glAbstraction.ResetSetUniformCallStack(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); + glSetUniformStack.Reset(); application.SendNotification(); application.Render(); - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - tet_infoline( "Testing A above C and B at bottom\n" ); - bool ACB = ( indexA > indexC) && ( indexC > indexB ); + tet_infoline("Testing A above C and B at bottom\n"); + bool ACB = (indexA > indexC) && (indexC > indexB); - DALI_TEST_EQUALS( ACB, true, TEST_LOCATION ); + DALI_TEST_EQUALS(ACB, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "RaiseToTop ActorB\n" ); + tet_printf("RaiseToTop ActorB\n"); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.RaiseToTop(); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); application.SendNotification(); // Ensure sort order is calculated before next touch event - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - glAbstraction.ResetSetUniformCallStack(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); + glSetUniformStack.Reset(); application.SendNotification(); application.Render(); - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - tet_infoline( "Testing B above A and C at bottom\n" ); - bool BAC = ( indexB > indexA ) && ( indexA > indexC ); + tet_infoline("Testing B above A and C at bottom\n"); + bool BAC = (indexB > indexA) && (indexA > indexC); - DALI_TEST_EQUALS( BAC, true, TEST_LOCATION ); + DALI_TEST_EQUALS(BAC, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "LowerToBottom ActorA then ActorB leaving Actor C at Top\n" ); + tet_printf("LowerToBottom ActorA then ActorB leaving Actor C at Top\n"); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorA.LowerToBottom(); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); application.SendNotification(); application.Render(); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.LowerToBottom(); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - glAbstraction.ResetSetUniformCallStack(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); + glSetUniformStack.Reset(); application.SendNotification(); application.Render(); - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - tet_infoline( "Testing C above A and B at bottom\n" ); - bool CAB = ( indexC > indexA ) && ( indexA > indexB ); + tet_infoline("Testing C above A and B at bottom\n"); + bool CAB = (indexC > indexA) && (indexA > indexB); - DALI_TEST_EQUALS( CAB, true, TEST_LOCATION ); + DALI_TEST_EQUALS(CAB, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); @@ -5178,107 +5426,218 @@ int UtcDaliActorRaiseToTopLowerToBottom(void) int UtcDaliActorRaiseAbove(void) { - tet_infoline( "UtcDaliActor RaiseToAbove test \n" ); + tet_infoline("UtcDaliActor RaiseToAbove test \n"); + + TestApplication application; + + Integration::Scene stage(application.GetScene()); + + Actor actorA = Actor::New(); + Actor actorB = Actor::New(); + Actor actorC = Actor::New(); + + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + + stage.Add(actorA); + stage.Add(actorB); + stage.Add(actorC); + + ResetTouchCallbacks(); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); + + // connect to actor touch signals, will use touch callbacks to determine which actor is on top. + // Only top actor will get touched. + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); + + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); + + Dali::Integration::Point point; + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); + Dali::Integration::TouchEvent touchEvent; + touchEvent.AddPoint(point); + + application.ProcessEvent(touchEvent); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); + + ResetTouchCallbacks(); + + tet_printf("Raise actor B Above Actor C\n"); + + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorB.RaiseAbove(actorC); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); + + // Ensure sorting happens at end of Core::ProcessEvents() before next touch + application.SendNotification(); + application.ProcessEvent(touchEvent); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); + + ResetTouchCallbacks(); + + tet_printf("Raise actor A Above Actor B\n"); + + orderChangedSignal = false; + + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.RaiseAbove(actorB); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); + + // Ensure sorting happens at end of Core::ProcessEvents() before next touch + application.SendNotification(); + + application.ProcessEvent(touchEvent); // process a touch event on ordered actors. + + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); + + ResetTouchCallbacks(); + + END_TEST; +} + +int UtcDaliActorRaiseAbove2(void) +{ + tet_infoline("UtcDaliActor RaiseToAbove test using SIBLING_ORDER property\n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - stage.Add( actorA ); - stage.Add( actorB ); - stage.Add( actorC ); + stage.Add(actorA); + stage.Add(actorB); + stage.Add(actorC); ResetTouchCallbacks(); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Raise actor B Above Actor C\n" ); + tet_printf("Raise actor B Above Actor C\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorB.RaiseAbove( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + int newOrder = actorC[DevelActor::Property::SIBLING_ORDER]; + actorB[DevelActor::Property::SIBLING_ORDER] = newOrder; + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Raise actor A Above Actor B\n" ); + tet_printf("Raise actor A Above Actor B\n"); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.RaiseAbove( actorB ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + newOrder = actorB[DevelActor::Property::SIBLING_ORDER]; + actorA[DevelActor::Property::SIBLING_ORDER] = newOrder; + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); - application.ProcessEvent( touchEvent ); // process a touch event on ordered actors. + application.ProcessEvent(touchEvent); // process a touch event on ordered actors. - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); @@ -5287,22 +5646,22 @@ int UtcDaliActorRaiseAbove(void) int UtcDaliActorLowerBelow(void) { - tet_infoline( "UtcDaliActor LowerBelow test \n" ); + tet_infoline("UtcDaliActor LowerBelow test \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); // Set up renderers to add to Actors, float value 1, 2, 3 assigned to each // enables checking of which actor the uniform is assigned too Shader shaderA = CreateShader(); - shaderA.RegisterProperty( "uRendererColor",1.f); + shaderA.RegisterProperty("uRendererColor", 1.f); Shader shaderB = CreateShader(); - shaderB.RegisterProperty( "uRendererColor", 2.f ); + shaderB.RegisterProperty("uRendererColor", 2.f); Shader shaderC = CreateShader(); - shaderC.RegisterProperty( "uRendererColor", 3.f ); + shaderC.RegisterProperty("uRendererColor", 3.f); Actor actorA = Actor::New(); Actor actorB = Actor::New(); @@ -5320,40 +5679,40 @@ int UtcDaliActorLowerBelow(void) Renderer rendererC = Renderer::New(geometry, shaderC); actorC.AddRenderer(rendererC); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); Actor container = Actor::New(); - container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - container.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); - stage.Add( container ); + container.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + container.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS); + stage.Add(container); - container.Add( actorA ); - container.Add( actorB ); - container.Add( actorC ); + container.Add(actorA); + container.Add(actorB); + container.Add(actorC); ResetTouchCallbacks(); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( container ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(container).Connect(&application, f); // Set up gl abstraction trace so can query the set uniform order TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); @@ -5366,253 +5725,467 @@ int UtcDaliActorLowerBelow(void) application.SendNotification(); application.Render(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); - - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - int indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - int indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - int indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + int indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + int indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + int indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - tet_infoline( "Testing C above B and A at bottom\n" ); - bool CBA = ( indexC > indexB) && ( indexB > indexA ); + tet_infoline("Testing C above B and A at bottom\n"); + bool CBA = (indexC > indexB) && (indexB > indexA); - DALI_TEST_EQUALS( CBA, true, TEST_LOCATION ); + DALI_TEST_EQUALS(CBA, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - tet_infoline( "UtcDaliActor Test Set up completed \n" ); + tet_infoline("UtcDaliActor Test Set up completed \n"); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Lower actor C below Actor B ( actor B and A on same level due to insertion order) so C is below both \n" ); + tet_printf("Lower actor C below Actor B ( actor B and A on same level due to insertion order) so C is below both \n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorC.LowerBelow( actorB ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorC, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorC.LowerBelow(actorB); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorC, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); // touch event + application.ProcessEvent(touchEvent); // touch event - glAbstraction.ResetSetUniformCallStack(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); + glSetUniformStack.Reset(); application.SendNotification(); application.Render(); - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - tet_infoline( "Testing render order is A, C, B" ); - DALI_TEST_EQUALS( indexC > indexA, true, TEST_LOCATION ); - DALI_TEST_EQUALS( indexB > indexC, true, TEST_LOCATION ); + tet_infoline("Testing render order is A, C, B"); + DALI_TEST_EQUALS(indexC > indexA, true, TEST_LOCATION); + DALI_TEST_EQUALS(indexB > indexC, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Lower actor C below Actor A leaving B on top\n" ); + tet_printf("Lower actor C below Actor A leaving B on top\n"); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorC.LowerBelow( actorA ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorC, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorC.LowerBelow(actorA); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorC, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - glAbstraction.ResetSetUniformCallStack(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); + glSetUniformStack.Reset(); application.Render(); - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - DALI_TEST_EQUALS( indexA > indexC, true, TEST_LOCATION ); - DALI_TEST_EQUALS( indexB > indexA, true, TEST_LOCATION ); + DALI_TEST_EQUALS(indexA > indexC, true, TEST_LOCATION); + DALI_TEST_EQUALS(indexB > indexA, true, TEST_LOCATION); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Lower actor B below Actor C leaving A on top\n" ); + tet_printf("Lower actor B below Actor C leaving A on top\n"); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorB.LowerBelow( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorB.LowerBelow(actorC); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - glAbstraction.ResetSetUniformCallStack(); - glSetUniformStack = glAbstraction.GetSetUniformTrace(); + glSetUniformStack.Reset(); application.Render(); - tet_printf( "Trace:%s \n", glSetUniformStack.GetTraceString().c_str() ); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); // Test order of uniforms in stack - indexC = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "3" ); - indexB = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "2" ); - indexA = glSetUniformStack.FindIndexFromMethodAndParams( "uRendererColor", "1" ); + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); - DALI_TEST_EQUALS( indexC > indexB, true, TEST_LOCATION ); - DALI_TEST_EQUALS( indexA > indexC, true, TEST_LOCATION ); + DALI_TEST_EQUALS(indexC > indexB, true, TEST_LOCATION); + DALI_TEST_EQUALS(indexA > indexC, true, TEST_LOCATION); END_TEST; } +int UtcDaliActorLowerBelow2(void) +{ + tet_infoline("UtcDaliActor LowerBelow test using SIBLING_ORDER property\n"); + + TestApplication application; + + Integration::Scene stage(application.GetScene()); + + // Set up renderers to add to Actors, float value 1, 2, 3 assigned to each + // enables checking of which actor the uniform is assigned too + Shader shaderA = CreateShader(); + shaderA.RegisterProperty("uRendererColor", 1.f); + + Shader shaderB = CreateShader(); + shaderB.RegisterProperty("uRendererColor", 2.f); + + Shader shaderC = CreateShader(); + shaderC.RegisterProperty("uRendererColor", 3.f); + + Actor actorA = Actor::New(); + Actor actorB = Actor::New(); + Actor actorC = Actor::New(); + + // Add renderers to Actors so ( uRendererColor, 1 ) is A, ( uRendererColor, 2 ) is B, and ( uRendererColor, 3 ) is C, + Geometry geometry = CreateQuadGeometry(); + + Renderer rendererA = Renderer::New(geometry, shaderA); + actorA.AddRenderer(rendererA); + + Renderer rendererB = Renderer::New(geometry, shaderB); + actorB.AddRenderer(rendererB); + + Renderer rendererC = Renderer::New(geometry, shaderC); + actorC.AddRenderer(rendererC); + + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + + Actor container = Actor::New(); + container.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + container.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS); + stage.Add(container); + + container.Add(actorA); + container.Add(actorB); + container.Add(actorC); + + ResetTouchCallbacks(); + + // Connect ChildOrderChangedSignal + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(container).Connect(&application, f); + + // Set up gl abstraction trace so can query the set uniform order + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + glAbstraction.EnableSetUniformCallTrace(true); + glAbstraction.ResetSetUniformCallStack(); + TraceCallStack& glSetUniformStack = glAbstraction.GetSetUniformTrace(); + + glAbstraction.ResetSetUniformCallStack(); + + application.SendNotification(); + application.Render(); + + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); + + // Test order of uniforms in stack + int indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + int indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + int indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); + + tet_infoline("Testing C above B and A at bottom\n"); + bool CBA = (indexC > indexB) && (indexB > indexA); + + DALI_TEST_EQUALS(CBA, true, TEST_LOCATION); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); + + // connect to actor touch signals, will use touch callbacks to determine which actor is on top. + // Only top actor will get touched. + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); + + Dali::Integration::Point point; + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); + Dali::Integration::TouchEvent touchEvent; + touchEvent.AddPoint(point); + + tet_infoline("UtcDaliActor Test Set up completed \n"); + + application.ProcessEvent(touchEvent); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); + + ResetTouchCallbacks(); + + tet_printf("Lower actor C below Actor B ( actor B and A on same level due to insertion order) so C is below both \n"); + + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorC[DevelActor::Property::SIBLING_ORDER] = 1; + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorC, TEST_LOCATION); + + // Ensure sorting happens at end of Core::ProcessEvents() before next touch + application.SendNotification(); + application.Render(); + + application.ProcessEvent(touchEvent); // touch event + + glSetUniformStack.Reset(); + + application.SendNotification(); + application.Render(); + + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); + + // Test order of uniforms in stack + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); + + tet_infoline("Testing render order is A, C, B"); + DALI_TEST_EQUALS(indexC > indexA, true, TEST_LOCATION); + DALI_TEST_EQUALS(indexB > indexC, true, TEST_LOCATION); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); + + ResetTouchCallbacks(); + + tet_printf("Lower actor C below Actor A leaving B on top\n"); + + orderChangedSignal = false; + + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorC[DevelActor::Property::SIBLING_ORDER] = 0; + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorC, TEST_LOCATION); + + // Ensure sorting happens at end of Core::ProcessEvents() before next touch + application.SendNotification(); + application.Render(); + + application.ProcessEvent(touchEvent); + + glSetUniformStack.Reset(); + + application.Render(); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); + + // Test order of uniforms in stack + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); + + DALI_TEST_EQUALS(indexA > indexC, true, TEST_LOCATION); + DALI_TEST_EQUALS(indexB > indexA, true, TEST_LOCATION); + + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); + + ResetTouchCallbacks(); + + tet_printf("Lower actor B below Actor C leaving A on top\n"); + + orderChangedSignal = false; + + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorB[DevelActor::Property::SIBLING_ORDER] = 0; + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorB, TEST_LOCATION); + + // Ensure sorting happens at end of Core::ProcessEvents() before next touch + application.SendNotification(); + application.Render(); + + application.ProcessEvent(touchEvent); + + glSetUniformStack.Reset(); + + application.Render(); + tet_printf("Trace:%s \n", glSetUniformStack.GetTraceString().c_str()); + + // Test order of uniforms in stack + indexC = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "3.000000"); + indexB = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "2.000000"); + indexA = glSetUniformStack.FindIndexFromMethodAndParams("uRendererColor", "1.000000"); + + DALI_TEST_EQUALS(indexC > indexB, true, TEST_LOCATION); + DALI_TEST_EQUALS(indexA > indexC, true, TEST_LOCATION); + + END_TEST; +} int UtcDaliActorRaiseAboveDifferentParentsN(void) { - tet_infoline( "UtcDaliActor RaiseToAbove test with actor and target actor having different parents \n" ); + tet_infoline("UtcDaliActor RaiseToAbove test with actor and target actor having different parents \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor parentA = Actor::New(); Actor parentB = Actor::New(); - parentA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - parentA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); - parentB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - parentB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + parentA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + parentA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); + parentB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + parentB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - parentA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - parentA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + parentA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + parentA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - parentB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - parentB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + parentB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + parentB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - stage.Add( parentA ); - stage.Add( parentB ); + stage.Add(parentA); + stage.Add(parentB); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - parentA.Add( actorA ); - parentA.Add( actorB ); + parentA.Add(actorA); + parentA.Add(actorB); - tet_printf( "Actor C added to different parent from A and B \n" ); - parentB.Add( actorC ); + tet_printf("Actor C added to different parent from A and B \n"); + parentB.Add(actorC); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); ResetTouchCallbacks(); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - tet_printf( "Raise actor A Above Actor C which have different parents\n" ); + tet_printf("Raise actor A Above Actor C which have different parents\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.RaiseAbove( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.RaiseAbove(actorC); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); - application.ProcessEvent( touchEvent ); // touch event + application.ProcessEvent(touchEvent); // touch event - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); @@ -5621,657 +6194,656 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void) int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void) { - tet_infoline( "UtcDaliActor Test raiseAbove and lowerBelow api when target Actor has no parent \n" ); + tet_infoline("UtcDaliActor Test raiseAbove and lowerBelow api when target Actor has no parent \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); ResetTouchCallbacks(); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - tet_printf( "Raise actor A Above Actor C which have no parents\n" ); + tet_printf("Raise actor A Above Actor C which have no parents\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.RaiseAbove( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.RaiseAbove(actorC); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Not parented so RaiseAbove should show no effect\n" ); + tet_printf("Not parented so RaiseAbove should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - stage.Add ( actorB ); - tet_printf( "Lower actor A below Actor C when only A is not on stage \n" ); + stage.Add(actorB); + tet_printf("Lower actor A below Actor C when only A is not on stage \n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.LowerBelow( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.LowerBelow(actorC); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Actor A not parented so LowerBelow should show no effect\n" ); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + tet_printf("Actor A not parented so LowerBelow should show no effect\n"); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - tet_printf( "Adding Actor A to stage, will be on top\n" ); + tet_printf("Adding Actor A to stage, will be on top\n"); - stage.Add ( actorA ); + stage.Add(actorA); application.SendNotification(); application.Render(); - tet_printf( "Raise actor B Above Actor C when only B has a parent\n" ); + tet_printf("Raise actor B Above Actor C when only B has a parent\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorB.RaiseAbove( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorB.RaiseAbove(actorC); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "C not parented so RaiseAbove should show no effect\n" ); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + tet_printf("C not parented so RaiseAbove should show no effect\n"); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - tet_printf( "Lower actor A below Actor C when only A has a parent\n" ); + tet_printf("Lower actor A below Actor C when only A has a parent\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.LowerBelow( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.LowerBelow(actorC); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "C not parented so LowerBelow should show no effect\n" ); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + tet_printf("C not parented so LowerBelow should show no effect\n"); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - stage.Add ( actorC ); + stage.Add(actorC); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.RaiseAbove( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.RaiseAbove(actorC); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); // Ensure sorting happens at end of Core::ProcessEvents() before next touch application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Raise actor A Above Actor C, now both have same parent \n" ); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + tet_printf("Raise actor A Above Actor C, now both have same parent \n"); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); END_TEST; } int UtcDaliActorTestAllAPIwhenActorNotParented(void) { - tet_infoline( "UtcDaliActor Test all raise/lower api when actor has no parent \n" ); + tet_infoline("UtcDaliActor Test all raise/lower api when actor has no parent \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); ResetTouchCallbacks(); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - stage.Add ( actorA ); - tet_printf( "Raise actor B Above Actor C but B not parented\n" ); + stage.Add(actorA); + tet_printf("Raise actor B Above Actor C but B not parented\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.Raise(); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Not parented so RaiseAbove should show no effect\n" ); + tet_printf("Not parented so RaiseAbove should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); - tet_printf( "Raise actor B Above Actor C but B not parented\n" ); + tet_printf("Raise actor B Above Actor C but B not parented\n"); ResetTouchCallbacks(); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorC.Lower(); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Sort actor tree before next touch event application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Not parented so RaiseAbove should show no effect\n" ); + tet_printf("Not parented so RaiseAbove should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - tet_printf( "Lower actor C below B but C not parented\n" ); + tet_printf("Lower actor C below B but C not parented\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.Lower(); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Sort actor tree before next touch event application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Not parented so Lower should show no effect\n" ); + tet_printf("Not parented so Lower should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - tet_printf( "Raise actor B to top\n" ); + tet_printf("Raise actor B to top\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorB.RaiseToTop(); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); // Sort actor tree before next touch event application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Not parented so RaiseToTop should show no effect\n" ); + tet_printf("Not parented so RaiseToTop should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - tet_printf( "Add ActorB to stage so only Actor C not parented\n" ); + tet_printf("Add ActorB to stage so only Actor C not parented\n"); - stage.Add ( actorB ); + stage.Add(actorB); - tet_printf( "Lower actor C to Bottom, B stays at top\n" ); + tet_printf("Lower actor C to Bottom, B stays at top\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); actorC.LowerToBottom(); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_printf( "Not parented so LowerToBottom should show no effect\n" ); + tet_printf("Not parented so LowerToBottom should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); ResetTouchCallbacks(); END_TEST; } - int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void) { - tet_infoline( "UtcDaliActor RaiseToAbove and test with actor provided as target resulting in a no operation \n" ); + tet_infoline("UtcDaliActor RaiseToAbove and test with actor provided as target resulting in a no operation \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); - actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorA.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorA.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorB.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorB.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - actorC.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); - actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); + actorC.SetProperty(Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT"); + actorC.SetProperty(Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT"); - stage.Add( actorA ); - stage.Add( actorB ); - stage.Add( actorC ); + stage.Add(actorA); + stage.Add(actorB); + stage.Add(actorC); // connect to actor touch signals, will use touch callbacks to determine which actor is on top. // Only top actor will get touched. - actorA.TouchedSignal().Connect( TestTouchCallback ); - actorB.TouchedSignal().Connect( TestTouchCallback2 ); - actorC.TouchedSignal().Connect( TestTouchCallback3 ); + actorA.TouchedSignal().Connect(TestTouchCallback); + actorB.TouchedSignal().Connect(TestTouchCallback2); + actorC.TouchedSignal().Connect(TestTouchCallback3); ResetTouchCallbacks(); // Connect ChildOrderChangedSignal - bool orderChangedSignal( false ); - Actor orderChangedActor; - ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor ); - DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ; + bool orderChangedSignal(false); + Actor orderChangedActor; + ChildOrderChangedFunctor f(orderChangedSignal, orderChangedActor); + DevelActor::ChildOrderChangedSignal(stage.GetRootLayer()).Connect(&application, f); application.SendNotification(); application.Render(); Dali::Integration::Point point; - point.SetDeviceId( 1 ); - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.f, 10.f ) ); + point.SetDeviceId(1); + point.SetState(PointState::DOWN); + point.SetScreenPosition(Vector2(10.f, 10.f)); Dali::Integration::TouchEvent touchEvent; - touchEvent.AddPoint( point ); + touchEvent.AddPoint(point); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true, TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); - tet_infoline( "Raise actor A Above Actor A which is the same actor!!\n" ); + tet_infoline("Raise actor A Above Actor A which is the same actor!!\n"); - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.RaiseAbove( actorA ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.RaiseAbove(actorA); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_infoline( "No target is source Actor so RaiseAbove should show no effect\n" ); + tet_infoline("No target is source Actor so RaiseAbove should show no effect\n"); - DALI_TEST_EQUALS( gTouchCallBackCalled, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, true , TEST_LOCATION ); + DALI_TEST_EQUALS(gTouchCallBackCalled, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, true, TEST_LOCATION); ResetTouchCallbacks(); orderChangedSignal = false; - DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION ); - actorA.RaiseAbove( actorC ); - DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION ); + DALI_TEST_EQUALS(orderChangedSignal, false, TEST_LOCATION); + actorA.RaiseAbove(actorC); + DALI_TEST_EQUALS(orderChangedSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(orderChangedActor, actorA, TEST_LOCATION); application.SendNotification(); application.Render(); - application.ProcessEvent( touchEvent ); + application.ProcessEvent(touchEvent); - tet_infoline( "Raise actor A Above Actor C which will now be successful \n" ); - DALI_TEST_EQUALS( gTouchCallBackCalled, true, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled2, false, TEST_LOCATION ); - DALI_TEST_EQUALS( gTouchCallBackCalled3, false , TEST_LOCATION ); + tet_infoline("Raise actor A Above Actor C which will now be successful \n"); + DALI_TEST_EQUALS(gTouchCallBackCalled, true, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled2, false, TEST_LOCATION); + DALI_TEST_EQUALS(gTouchCallBackCalled3, false, TEST_LOCATION); END_TEST; } int UtcDaliActorGetScreenPosition(void) { - tet_infoline( "UtcDaliActorGetScreenPosition Get screen coordinates of Actor \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Get screen coordinates of Actor \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); - Vector2 size2( 10.0f, 20.0f ); - actorA.SetProperty( Actor::Property::SIZE, size2 ); + Vector2 size2(10.0f, 20.0f); + actorA.SetProperty(Actor::Property::SIZE, size2); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + actorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "UtcDaliActorGetScreenPosition Center Anchor Point and 0,0 position \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Center Anchor Point and 0,0 position \n"); - stage.Add( actorA ); + stage.Add(actorA); application.SendNotification(); application.Render(); - Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + Vector3 actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + Vector2 actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::CENTER \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position %f %f \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::CENTER \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position %f %f \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 0lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 0lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0lu, TEST_LOCATION); - tet_infoline( "UtcDaliActorGetScreenPosition Top Left Anchor Point and 0,0 position \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Top Left Anchor Point and 0,0 position \n"); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 0lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 0lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0lu, TEST_LOCATION); - tet_infoline( "UtcDaliActorGetScreenPosition Bottom right Anchor Point and 0,0 position \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Bottom right Anchor Point and 0,0 position \n"); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 0lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 0lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0lu, TEST_LOCATION); - tet_infoline( "UtcDaliActorGetScreenPosition Bottom right Anchor Point and 30,0 position \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Bottom right Anchor Point and 30,0 position \n"); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 0.0 )); + actorA.SetProperty(Actor::Property::POSITION, Vector2(30.0, 0.0)); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 30lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 30lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0lu, TEST_LOCATION); - tet_infoline( "UtcDaliActorGetScreenPosition Bottom right Anchor Point and 30,420 position \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Bottom right Anchor Point and 30,420 position \n"); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 420.0 )); + actorA.SetProperty(Actor::Property::POSITION, Vector2(30.0, 420.0)); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - DALI_TEST_EQUALS( actorScreenPosition.x, 30lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 420lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 30lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 420lu, TEST_LOCATION); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 420.0\n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 420.0 \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 420.0\n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 420.0 \n", actorScreenPosition.x, actorScreenPosition.y); - tet_infoline( "UtcDaliActorGetScreenPosition Scale parent and check child's screen position \n" ); + tet_infoline("UtcDaliActorGetScreenPosition Scale parent and check child's screen position \n"); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 30.0 )); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actorA.SetProperty(Actor::Property::POSITION, Vector2(30.0, 30.0)); Actor actorB = Actor::New(); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - actorB.SetProperty( Actor::Property::SIZE, size2 ); - actorB.SetProperty( Actor::Property::POSITION, Vector2( 10.f, 10.f )); - actorA.Add( actorB ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actorB.SetProperty(Actor::Property::SIZE, size2); + actorB.SetProperty(Actor::Property::POSITION, Vector2(10.f, 10.f)); + actorA.Add(actorB); - actorA.SetProperty( Actor::Property::SCALE, 2.0f ); + actorA.SetProperty(Actor::Property::SCALE, 2.0f); application.SendNotification(); application.Render(); - actorScreenPosition = actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorScreenPosition = actorB.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - DALI_TEST_EQUALS( actorScreenPosition.x, 50lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 50lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 50lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 50lu, TEST_LOCATION); END_TEST; } int UtcDaliActorGetScreenPositionAfterScaling(void) { - tet_infoline( "UtcDaliActorGetScreenPositionAfterScaling Get screen coordinates of Actor \n" ); + tet_infoline("UtcDaliActorGetScreenPositionAfterScaling Get screen coordinates of Actor \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); - Vector2 size2( 10.0f, 20.0f ); - actorA.SetProperty( Actor::Property::SIZE, size2 ); - actorA.SetProperty( Actor::Property::SCALE, 1.5f ); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + Vector2 size2(10.0f, 20.0f); + actorA.SetProperty(Actor::Property::SIZE, size2); + actorA.SetProperty(Actor::Property::SCALE, 1.5f); + actorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "UtcDaliActorGetScreenPositionAfterScaling TopRight Anchor Point, scale 1.5f and 0,0 position \n" ); + tet_infoline("UtcDaliActorGetScreenPositionAfterScaling TopRight Anchor Point, scale 1.5f and 0,0 position \n"); - stage.Add( actorA ); + stage.Add(actorA); application.SendNotification(); application.Render(); - Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + Vector3 actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + Vector2 actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 0lu , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0lu , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 0lu, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0lu, TEST_LOCATION); - tet_infoline( "UtcDaliActorGetScreenPositionAfterScaling BOTTOM_RIGHT Anchor Point, scale 1.5f and 0,0 position \n" ); + tet_infoline("UtcDaliActorGetScreenPositionAfterScaling BOTTOM_RIGHT Anchor Point, scale 1.5f and 0,0 position \n"); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x , 0.0f , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0.0f , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 0.0f, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0.0f, TEST_LOCATION); END_TEST; } int UtcDaliActorGetScreenPositionWithDifferentParentOrigin(void) { - tet_infoline( "UtcDaliActorGetScreenPositionWithDifferentParentOrigin Changes parent origin which should not effect result \n" ); + tet_infoline("UtcDaliActorGetScreenPositionWithDifferentParentOrigin Changes parent origin which should not effect result \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); Actor actorA = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - Vector2 size2( 10.0f, 20.0f ); - actorA.SetProperty( Actor::Property::SIZE, size2 ); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Vector2 size2(10.0f, 20.0f); + actorA.SetProperty(Actor::Property::SIZE, size2); + actorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( " TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); + tet_infoline(" TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n"); - stage.Add( actorA ); + stage.Add(actorA); application.SendNotification(); application.Render(); - Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + Vector3 actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + Vector2 actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 240.0f , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 400.0f , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 240.0f, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 400.0f, TEST_LOCATION); - tet_infoline( " BOTTOM_RIGHT Anchor Point, ParentOrigin::TOP_RIGHT and 0,0 position \n" ); + tet_infoline(" BOTTOM_RIGHT Anchor Point, ParentOrigin::TOP_RIGHT and 0,0 position \n"); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT ParentOrigin::TOP_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT ParentOrigin::TOP_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x , 480.0f , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 0.0f , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 480.0f, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 0.0f, TEST_LOCATION); END_TEST; END_TEST; @@ -6279,188 +6851,188 @@ int UtcDaliActorGetScreenPositionWithDifferentParentOrigin(void) int UtcDaliActorGetScreenPositionWithChildActors(void) { - tet_infoline( "UtcDaliActorGetScreenPositionWithChildActors Check screen position with a tree of actors \n" ); + tet_infoline("UtcDaliActorGetScreenPositionWithChildActors Check screen position with a tree of actors \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); - tet_infoline( "Create Child Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); + tet_infoline("Create Child Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n"); Actor actorA = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - Vector2 size1( 10.0f, 20.0f ); - actorA.SetProperty( Actor::Property::SIZE, size1 ); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Vector2 size1(10.0f, 20.0f); + actorA.SetProperty(Actor::Property::SIZE, size1); + actorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "Create Parent Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); + tet_infoline("Create Parent Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n"); Actor parentActorA = Actor::New(); - parentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - parentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - Vector2 size2( 30.0f, 60.0f ); - parentActorA.SetProperty( Actor::Property::SIZE, size2 ); - parentActorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + parentActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + parentActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Vector2 size2(30.0f, 60.0f); + parentActorA.SetProperty(Actor::Property::SIZE, size2); + parentActorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "Add child 1 to Parent 1 and check screen position \n" ); + tet_infoline("Add child 1 to Parent 1 and check screen position \n"); - stage.Add( parentActorA ); - parentActorA.Add ( actorA ); + stage.Add(parentActorA); + parentActorA.Add(actorA); application.SendNotification(); application.Render(); - Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + Vector3 actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + Vector2 actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 255.0f , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 430.0f , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 255.0f, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 430.0f, TEST_LOCATION); - tet_infoline( "Test 2\n"); + tet_infoline("Test 2\n"); - tet_infoline( "change parent anchor point and parent origin then check screen position \n" ); + tet_infoline("change parent anchor point and parent origin then check screen position \n"); - parentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); - parentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + parentActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT); + parentActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); application.SendNotification(); application.Render(); - actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_LEFT ParentOrigin::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::BOTTOM_LEFT ParentOrigin::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 15.0f , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, -30.0f , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 15.0f, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, -30.0f, TEST_LOCATION); END_TEST; } int UtcDaliActorGetScreenPositionWithChildActors02(void) { - tet_infoline( "UtcDaliActorGetScreenPositionWithChildActors02 Check screen position with a tree of actors \n" ); + tet_infoline("UtcDaliActorGetScreenPositionWithChildActors02 Check screen position with a tree of actors \n"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); - tet_infoline( "Create Child Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); + tet_infoline("Create Child Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n"); Actor actorA = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - Vector2 size1( 10.0f, 20.0f ); - actorA.SetProperty( Actor::Property::SIZE, size1 ); - actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Vector2 size1(10.0f, 20.0f); + actorA.SetProperty(Actor::Property::SIZE, size1); + actorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "Create Parent Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); + tet_infoline("Create Parent Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n"); Actor parentActorA = Actor::New(); - parentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - parentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - Vector2 size2( 30.0f, 60.0f ); - parentActorA.SetProperty( Actor::Property::SIZE, size2 ); - parentActorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + parentActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + parentActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + Vector2 size2(30.0f, 60.0f); + parentActorA.SetProperty(Actor::Property::SIZE, size2); + parentActorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "Create Grand Parent Actor 1 BOTTOM_LEFT Anchor Point, ParentOrigin::BOTTOM_LEFT and 0,0 position \n" ); + tet_infoline("Create Grand Parent Actor 1 BOTTOM_LEFT Anchor Point, ParentOrigin::BOTTOM_LEFT and 0,0 position \n"); Actor grandParentActorA = Actor::New(); - grandParentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); - grandParentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); - Vector2 size3( 60.0f, 120.0f ); - grandParentActorA.SetProperty( Actor::Property::SIZE, size3 ); - grandParentActorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); + grandParentActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT); + grandParentActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT); + Vector2 size3(60.0f, 120.0f); + grandParentActorA.SetProperty(Actor::Property::SIZE, size3); + grandParentActorA.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f)); - tet_infoline( "Add Parent 1 to Grand Parent 1 \n" ); + tet_infoline("Add Parent 1 to Grand Parent 1 \n"); - stage.Add( grandParentActorA ); - grandParentActorA.Add ( parentActorA ); + stage.Add(grandParentActorA); + grandParentActorA.Add(parentActorA); - tet_infoline( "Add child 1 to Parent 1 and check screen position \n" ); + tet_infoline("Add child 1 to Parent 1 and check screen position \n"); - parentActorA.Add ( actorA ); + parentActorA.Add(actorA); application.SendNotification(); application.Render(); - Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >(); - Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(); + Vector3 actorWorldPosition = actorA.GetProperty(Actor::Property::WORLD_POSITION).Get(); + Vector2 actorScreenPosition = actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(); - tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y ); - tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y ); + tet_printf("Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y); + tet_printf("Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y); - DALI_TEST_EQUALS( actorScreenPosition.x, 45.0f , TEST_LOCATION ); - DALI_TEST_EQUALS( actorScreenPosition.y, 770.0f , TEST_LOCATION ); + DALI_TEST_EQUALS(actorScreenPosition.x, 45.0f, TEST_LOCATION); + DALI_TEST_EQUALS(actorScreenPosition.y, 770.0f, TEST_LOCATION); END_TEST; } int UtcDaliActorGetScreenPositionPositionUsesAnchorPointFalse(void) { - tet_infoline( "UtcDaliActorGetScreenPositionPositionUsesAnchorPointFalse Check screen position where the position does not use the anchor point" ); + tet_infoline("UtcDaliActorGetScreenPositionPositionUsesAnchorPointFalse Check screen position where the position does not use the anchor point"); TestApplication application; - Integration::Scene stage( application.GetScene() ); + Integration::Scene stage(application.GetScene()); - tet_infoline( "Create an actor with AnchorPoint::TOP_LEFT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" ); + tet_infoline("Create an actor with AnchorPoint::TOP_LEFT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false"); Actor actorA = Actor::New(); - actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); - actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorA.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - actorA.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 20.0f ) ); - stage.Add( actorA ); + actorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actorA.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + actorA.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 20.0f)); + stage.Add(actorA); - tet_infoline( "Create an Actor with AnchorPoint::BOTTOM_RIGHT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" ); + tet_infoline("Create an Actor with AnchorPoint::BOTTOM_RIGHT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false"); Actor actorB = Actor::New(); - actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); - actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - Vector2 actorBSize( 30.0f, 60.0f ); - actorB.SetProperty( Actor::Property::SIZE, actorBSize ); - stage.Add( actorB ); + actorB.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); + actorB.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actorB.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + Vector2 actorBSize(30.0f, 60.0f); + actorB.SetProperty(Actor::Property::SIZE, actorBSize); + stage.Add(actorB); - tet_infoline( "Create an actor with AnchorPoint::CENTER, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" ); + tet_infoline("Create an actor with AnchorPoint::CENTER, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false"); Actor actorC = Actor::New(); - actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - Vector2 actorCSize( 60.0f, 120.0f ); - actorC.SetProperty( Actor::Property::SIZE, actorCSize ); - stage.Add( actorC ); + actorC.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actorC.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actorC.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + Vector2 actorCSize(60.0f, 120.0f); + actorC.SetProperty(Actor::Property::SIZE, actorCSize); + stage.Add(actorC); application.SendNotification(); application.Render(); - tet_infoline( "Despite differing sizes and anchor-points, the screen position for all actors is the same"); + tet_infoline("Despite differing sizes and anchor-points, the screen position for all actors is the same"); - Vector2 center( stage.GetSize() * 0.5f ); + Vector2 center(stage.GetSize() * 0.5f); - DALI_TEST_EQUALS( actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION ); - DALI_TEST_EQUALS( actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION ); - DALI_TEST_EQUALS( actorC.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION ); + DALI_TEST_EQUALS(actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(), center, TEST_LOCATION); + DALI_TEST_EQUALS(actorB.GetProperty(Actor::Property::SCREEN_POSITION).Get(), center, TEST_LOCATION); + DALI_TEST_EQUALS(actorC.GetProperty(Actor::Property::SCREEN_POSITION).Get(), center, TEST_LOCATION); - tet_infoline( "Add scale to all actors" ); + tet_infoline("Add scale to all actors"); - actorA.SetProperty( Actor::Property::SCALE, 2.0f ); - actorB.SetProperty( Actor::Property::SCALE, 2.0f ); - actorC.SetProperty( Actor::Property::SCALE, 2.0f ); + actorA.SetProperty(Actor::Property::SCALE, 2.0f); + actorB.SetProperty(Actor::Property::SCALE, 2.0f); + actorC.SetProperty(Actor::Property::SCALE, 2.0f); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center /* TOP_LEFT Anchor */, TEST_LOCATION ); - DALI_TEST_EQUALS( actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorBSize /* BOTTOM_RIGHT Anchor */, TEST_LOCATION ); - DALI_TEST_EQUALS( actorC.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorCSize * 0.5f /* CENTER Anchor*/, TEST_LOCATION ); + DALI_TEST_EQUALS(actorA.GetProperty(Actor::Property::SCREEN_POSITION).Get(), center /* TOP_LEFT Anchor */, TEST_LOCATION); + DALI_TEST_EQUALS(actorB.GetProperty(Actor::Property::SCREEN_POSITION).Get(), center - actorBSize /* BOTTOM_RIGHT Anchor */, TEST_LOCATION); + DALI_TEST_EQUALS(actorC.GetProperty(Actor::Property::SCREEN_POSITION).Get(), center - actorCSize * 0.5f /* CENTER Anchor*/, TEST_LOCATION); END_TEST; } @@ -6468,28 +7040,28 @@ int UtcDaliActorGetScreenPositionPositionUsesAnchorPointFalse(void) int utcDaliActorPositionUsesAnchorPoint(void) { TestApplication application; - tet_infoline( "Check default behaviour\n" ); + tet_infoline("Check default behaviour\n"); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - application.GetScene().Add( actor ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + application.GetScene().Add(actor); application.SendNotification(); application.Render(); - tet_infoline( "Check that the world position is in the center\n" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + tet_infoline("Check that the world position is in the center\n"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Set the position uses anchor point property to false\n" ); - actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); + tet_infoline("Set the position uses anchor point property to false\n"); + actor.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); application.SendNotification(); application.Render(); - tet_infoline( "Check that the world position has changed appropriately\n" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + tet_infoline("Check that the world position has changed appropriately\n"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(50.0f, 50.0f, 0.0f), TEST_LOCATION); END_TEST; } @@ -6497,33 +7069,33 @@ int utcDaliActorPositionUsesAnchorPoint(void) int utcDaliActorPositionUsesAnchorPointCheckScale(void) { TestApplication application; - tet_infoline( "Check that the scale is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); + tet_infoline("Check that the scale is adjusted appropriately when setting the positionUsesAnchorPoint to false\n"); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::SCALE, 2.0f ); - actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - application.GetScene().Add( actor ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::SCALE, 2.0f); + actor.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + application.GetScene().Add(actor); application.SendNotification(); application.Render(); - tet_infoline( "Check the world position is the same as it would be without a scale\n" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + tet_infoline("Check the world position is the same as it would be without a scale\n"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(50.0f, 50.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + tet_infoline("Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 100.0f, 100.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(100.0f, 100.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + tet_infoline("Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION); END_TEST; } @@ -6531,33 +7103,33 @@ int utcDaliActorPositionUsesAnchorPointCheckScale(void) int utcDaliActorPositionUsesAnchorPointCheckRotation(void) { TestApplication application; - tet_infoline( "Check that the rotation is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); + tet_infoline("Check that the rotation is adjusted appropriately when setting the positionUsesAnchorPoint to false\n"); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) ); - actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - application.GetScene().Add( actor ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(Degree(90.0f), Vector3::ZAXIS)); + actor.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + application.GetScene().Add(actor); application.SendNotification(); application.Render(); - tet_infoline( "Check the world position is the same as it would be without a rotation\n" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + tet_infoline("Check the world position is the same as it would be without a rotation\n"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(50.0f, 50.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + tet_infoline("Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( -50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(-50.0f, 50.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + tet_infoline("Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 150.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(150.0f, 50.0f, 0.0f), TEST_LOCATION); END_TEST; } @@ -6565,34 +7137,34 @@ int utcDaliActorPositionUsesAnchorPointCheckRotation(void) int utcDaliActorPositionUsesAnchorPointCheckScaleAndRotation(void) { TestApplication application; - tet_infoline( "Check that the scale and rotation is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); + tet_infoline("Check that the scale and rotation is adjusted appropriately when setting the positionUsesAnchorPoint to false\n"); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) ); - actor.SetProperty( Actor::Property::SCALE, 2.0f ); - actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - application.GetScene().Add( actor ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(Degree(90.0f), Vector3::ZAXIS)); + actor.SetProperty(Actor::Property::SCALE, 2.0f); + actor.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + application.GetScene().Add(actor); application.SendNotification(); application.Render(); - tet_infoline( "Check the world position is the same as it would be without a scale and rotation\n" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + tet_infoline("Check the world position is the same as it would be without a scale and rotation\n"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(50.0f, 50.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + tet_infoline("Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( -100.0f, 100.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(-100.0f, 100.0f, 0.0f), TEST_LOCATION); - tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + tet_infoline("Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 200.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), Vector3(200.0f, 0.0f, 0.0f), TEST_LOCATION); END_TEST; } @@ -6600,41 +7172,41 @@ int utcDaliActorPositionUsesAnchorPointCheckScaleAndRotation(void) int utcDaliActorPositionUsesAnchorPointOnlyInheritPosition(void) { TestApplication application; - tet_infoline( "Check that if not inheriting scale and position, then the position is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); + tet_infoline("Check that if not inheriting scale and position, then the position is adjusted appropriately when setting the positionUsesAnchorPoint to false\n"); Actor parent = Actor::New(); - application.GetScene().Add( parent ); - Vector2 stageSize( application.GetScene().GetSize() ); + application.GetScene().Add(parent); + Vector2 stageSize(application.GetScene().GetSize()); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::INHERIT_SCALE, false ); - actor.SetProperty( Actor::Property::INHERIT_ORIENTATION, false ); - actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); - parent.Add( actor ); + actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::INHERIT_SCALE, false); + actor.SetProperty(Actor::Property::INHERIT_ORIENTATION, false); + actor.SetProperty(Actor::Property::POSITION_USES_ANCHOR_POINT, false); + parent.Add(actor); application.SendNotification(); application.Render(); - const Vector3 expectedWorldPosition( -stageSize.width * 0.5f + 50.0f, -stageSize.height * 0.5f + 50.0f, 0.0f ); + const Vector3 expectedWorldPosition(-stageSize.width * 0.5f + 50.0f, -stageSize.height * 0.5f + 50.0f, 0.0f); - tet_infoline( "Check the world position is in the right place\n" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), expectedWorldPosition, TEST_LOCATION ); + tet_infoline("Check the world position is in the right place\n"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), expectedWorldPosition, TEST_LOCATION); - tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure world position hasn't changed" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + tet_infoline("Change the Anchor Point to TOP_LEFT and ensure world position hasn't changed"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), expectedWorldPosition, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), expectedWorldPosition, TEST_LOCATION); - tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure world position hasn't changed" ); - actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + tet_infoline("Change the Anchor Point to BOTTOM_RIGHT and ensure world position hasn't changed"); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), expectedWorldPosition, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::WORLD_POSITION), expectedWorldPosition, TEST_LOCATION); END_TEST; } @@ -6642,34 +7214,34 @@ int utcDaliActorPositionUsesAnchorPointOnlyInheritPosition(void) int utcDaliActorVisibilityChangeSignalSelf(void) { TestApplication application; - tet_infoline( "Check that the visibility change signal is called when the visibility changes for the actor itself" ); + tet_infoline("Check that the visibility change signal is called when the visibility changes for the actor itself"); Actor actor = Actor::New(); VisibilityChangedFunctorData data; - DevelActor::VisibilityChangedSignal( actor ).Connect( &application, VisibilityChangedFunctor( data ) ); + DevelActor::VisibilityChangedSignal(actor).Connect(&application, VisibilityChangedFunctor(data)); - actor.SetProperty( Actor::Property::VISIBLE, false ); + actor.SetProperty(Actor::Property::VISIBLE, false); - data.Check( true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION ); + data.Check(true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION); - tet_infoline( "Ensure functor is not called if we attempt to change the visibility to what it already is at" ); + tet_infoline("Ensure functor is not called if we attempt to change the visibility to what it already is at"); data.Reset(); - actor.SetProperty( Actor::Property::VISIBLE, false ); - data.Check( false /* not called */, TEST_LOCATION ); + actor.SetProperty(Actor::Property::VISIBLE, false); + data.Check(false /* not called */, TEST_LOCATION); - tet_infoline( "Change the visibility using properties, ensure called" ); + tet_infoline("Change the visibility using properties, ensure called"); data.Reset(); - actor.SetProperty( Actor::Property::VISIBLE, true ); - data.Check( true /* called */, actor, true /* visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION ); + actor.SetProperty(Actor::Property::VISIBLE, true); + data.Check(true /* called */, actor, true /* visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION); - tet_infoline( "Set the visibility to current using properties, ensure not called" ); + tet_infoline("Set the visibility to current using properties, ensure not called"); data.Reset(); - actor.SetProperty( Actor::Property::VISIBLE, true ); - data.Check( false /* not called */, TEST_LOCATION ); + actor.SetProperty(Actor::Property::VISIBLE, true); + data.Check(false /* not called */, TEST_LOCATION); END_TEST; } @@ -6677,49 +7249,49 @@ int utcDaliActorVisibilityChangeSignalSelf(void) int utcDaliActorVisibilityChangeSignalChildren(void) { TestApplication application; - tet_infoline( "Check that the visibility change signal is called for the children when the visibility changes for the parent" ); + tet_infoline("Check that the visibility change signal is called for the children when the visibility changes for the parent"); Actor parent = Actor::New(); - Actor child = Actor::New(); - parent.Add( child ); + Actor child = Actor::New(); + parent.Add(child); Actor grandChild = Actor::New(); - child.Add( grandChild ); + child.Add(grandChild); VisibilityChangedFunctorData parentData; VisibilityChangedFunctorData childData; VisibilityChangedFunctorData grandChildData; - tet_infoline( "Only connect the child and grandchild, ensure they are called and not the parent" ); - DevelActor::VisibilityChangedSignal( child ).Connect( &application, VisibilityChangedFunctor( childData ) ); - DevelActor::VisibilityChangedSignal( grandChild ).Connect( &application, VisibilityChangedFunctor( grandChildData ) ); + tet_infoline("Only connect the child and grandchild, ensure they are called and not the parent"); + DevelActor::VisibilityChangedSignal(child).Connect(&application, VisibilityChangedFunctor(childData)); + DevelActor::VisibilityChangedSignal(grandChild).Connect(&application, VisibilityChangedFunctor(grandChildData)); - parent.SetProperty( Actor::Property::VISIBLE, false ); - parentData.Check( false /* not called */, TEST_LOCATION ); - childData.Check( true /* called */, child, false /* not visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); - grandChildData.Check( true /* called */, grandChild, false /* not visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); + parent.SetProperty(Actor::Property::VISIBLE, false); + parentData.Check(false /* not called */, TEST_LOCATION); + childData.Check(true /* called */, child, false /* not visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION); + grandChildData.Check(true /* called */, grandChild, false /* not visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION); - tet_infoline( "Connect to the parent's signal as well and ensure all three are called" ); + tet_infoline("Connect to the parent's signal as well and ensure all three are called"); parentData.Reset(); childData.Reset(); grandChildData.Reset(); - DevelActor::VisibilityChangedSignal( parent ).Connect( &application, VisibilityChangedFunctor( parentData ) ); + DevelActor::VisibilityChangedSignal(parent).Connect(&application, VisibilityChangedFunctor(parentData)); - parent.SetProperty( Actor::Property::VISIBLE, true ); - parentData.Check( true /* called */, parent, true /* visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION ); - childData.Check( true /* called */, child, true /* visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); - grandChildData.Check( true /* called */, grandChild, true /* visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); + parent.SetProperty(Actor::Property::VISIBLE, true); + parentData.Check(true /* called */, parent, true /* visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION); + childData.Check(true /* called */, child, true /* visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION); + grandChildData.Check(true /* called */, grandChild, true /* visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION); - tet_infoline( "Ensure none of the functors are called if we attempt to change the visibility to what it already is at" ); + tet_infoline("Ensure none of the functors are called if we attempt to change the visibility to what it already is at"); parentData.Reset(); childData.Reset(); grandChildData.Reset(); - parent.SetProperty( Actor::Property::VISIBLE, true ); - parentData.Check( false /* not called */, TEST_LOCATION ); - childData.Check( false /* not called */, TEST_LOCATION ); - grandChildData.Check( false /* not called */, TEST_LOCATION ); + parent.SetProperty(Actor::Property::VISIBLE, true); + parentData.Check(false /* not called */, TEST_LOCATION); + childData.Check(false /* not called */, TEST_LOCATION); + grandChildData.Check(false /* not called */, TEST_LOCATION); END_TEST; } @@ -6727,75 +7299,73 @@ int utcDaliActorVisibilityChangeSignalChildren(void) int utcDaliActorVisibilityChangeSignalAfterAnimation(void) { TestApplication application; - tet_infoline( "Check that the visibility change signal is emitted when the visibility changes when an animation starts" ); + tet_infoline("Check that the visibility change signal is emitted when the visibility changes when an animation starts"); Actor actor = Actor::New(); - application.GetScene().Add( actor ); + application.GetScene().Add(actor); application.SendNotification(); application.Render(); VisibilityChangedFunctorData data; - DevelActor::VisibilityChangedSignal( actor ).Connect( &application, VisibilityChangedFunctor( data ) ); + DevelActor::VisibilityChangedSignal(actor).Connect(&application, VisibilityChangedFunctor(data)); - Animation animation = Animation::New( 1.0f ); - animation.AnimateTo( Property( actor, Actor::Property::VISIBLE ), false ); + 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( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); + data.Check(false, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::VISIBLE), true, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::VISIBLE), true, TEST_LOCATION); - tet_infoline( "Play the animation and check the property value" ); + 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 ); + data.Check(true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::VISIBLE), false, TEST_LOCATION); - tet_infoline( "Animation not currently finished, so the current visibility should still be true" ); - DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION ); + tet_infoline("Animation not currently finished, so the current visibility should still be true"); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::VISIBLE), true, TEST_LOCATION); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation - DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty(Actor::Property::VISIBLE), false, TEST_LOCATION); END_TEST; } - int utcDaliActorVisibilityChangeSignalByName(void) { TestApplication application; - tet_infoline( "Check that the visibility change signal is called when the visibility changes for the actor itself" ); + tet_infoline("Check that the visibility change signal is called when the visibility changes for the actor itself"); Actor actor = Actor::New(); - bool signalCalled=false; - actor.ConnectSignal( &application, "visibilityChanged", VisibilityChangedVoidFunctor(signalCalled) ); - DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); - actor.SetProperty( Actor::Property::VISIBLE, false ); - DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION ); + bool signalCalled = false; + actor.ConnectSignal(&application, "visibilityChanged", VisibilityChangedVoidFunctor(signalCalled)); + DALI_TEST_EQUALS(signalCalled, false, TEST_LOCATION); + actor.SetProperty(Actor::Property::VISIBLE, false); + DALI_TEST_EQUALS(signalCalled, true, TEST_LOCATION); - tet_infoline( "Ensure functor is not called if we attempt to change the visibility to what it already is at" ); + tet_infoline("Ensure functor is not called if we attempt to change the visibility to what it already is at"); signalCalled = false; - actor.SetProperty( Actor::Property::VISIBLE, false ); - DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); + actor.SetProperty(Actor::Property::VISIBLE, false); + DALI_TEST_EQUALS(signalCalled, false, TEST_LOCATION); - tet_infoline( "Change the visibility using properties, ensure called" ); - actor.SetProperty( Actor::Property::VISIBLE, true ); - DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION ); + tet_infoline("Change the visibility using properties, ensure called"); + actor.SetProperty(Actor::Property::VISIBLE, true); + DALI_TEST_EQUALS(signalCalled, true, TEST_LOCATION); - tet_infoline( "Set the visibility to current using properties, ensure not called" ); + tet_infoline("Set the visibility to current using properties, ensure not called"); signalCalled = false; - actor.SetProperty( Actor::Property::VISIBLE, true ); - DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); + actor.SetProperty(Actor::Property::VISIBLE, true); + DALI_TEST_EQUALS(signalCalled, false, TEST_LOCATION); END_TEST; } - -static void LayoutDirectionChanged( Actor actor, LayoutDirection::Type type ) +static void LayoutDirectionChanged(Actor actor, LayoutDirection::Type type) { gLayoutDirectionType = type; } @@ -6803,101 +7373,100 @@ static void LayoutDirectionChanged( Actor actor, LayoutDirection::Type type ) int UtcDaliActorLayoutDirectionProperty(void) { TestApplication application; - tet_infoline( "Check layout direction property" ); + tet_infoline("Check layout direction property"); Actor actor0 = Actor::New(); - DALI_TEST_EQUALS( actor0.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - application.GetScene().Add( actor0 ); + DALI_TEST_EQUALS(actor0.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + application.GetScene().Add(actor0); application.SendNotification(); application.Render(); Actor actor1 = Actor::New(); - DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor1.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor2 = Actor::New(); - DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor2.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor3 = Actor::New(); - DALI_TEST_EQUALS( actor3.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor3.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor4 = Actor::New(); - DALI_TEST_EQUALS( actor4.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor4.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor5 = Actor::New(); - DALI_TEST_EQUALS( actor5.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor5.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor6 = Actor::New(); - DALI_TEST_EQUALS( actor6.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor6.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor7 = Actor::New(); - DALI_TEST_EQUALS( actor7.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor7.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor8 = Actor::New(); - DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); Actor actor9 = Actor::New(); - DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor9.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); - actor1.Add( actor2 ); + actor1.Add(actor2); gLayoutDirectionType = LayoutDirection::LEFT_TO_RIGHT; - actor2.LayoutDirectionChangedSignal().Connect( LayoutDirectionChanged ); + actor2.LayoutDirectionChangedSignal().Connect(LayoutDirectionChanged); - DALI_TEST_EQUALS( actor1.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), true, TEST_LOCATION ); - actor1.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); - DALI_TEST_EQUALS( actor1.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), false, TEST_LOCATION ); + DALI_TEST_EQUALS(actor1.GetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION), true, TEST_LOCATION); + actor1.SetProperty(Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT); + DALI_TEST_EQUALS(actor1.GetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION), false, TEST_LOCATION); - DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( gLayoutDirectionType, LayoutDirection::RIGHT_TO_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS(actor1.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(actor2.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(gLayoutDirectionType, LayoutDirection::RIGHT_TO_LEFT, TEST_LOCATION); - actor1.SetProperty( Actor::Property::INHERIT_LAYOUT_DIRECTION, true ); - actor0.Add( actor1 ); - DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + actor1.SetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION, true); + actor0.Add(actor1); + DALI_TEST_EQUALS(actor1.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actor2.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); - application.GetScene().Add( actor3 ); - actor3.Add( actor4 ); - actor4.Add( actor5 ); - actor5.Add( actor6 ); - actor5.Add( actor7 ); - actor7.Add( actor8 ); - actor8.Add( actor9 ); - actor3.SetProperty( Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT" ); - actor5.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT ); + application.GetScene().Add(actor3); + actor3.Add(actor4); + actor4.Add(actor5); + actor5.Add(actor6); + actor5.Add(actor7); + actor7.Add(actor8); + actor8.Add(actor9); + actor3.SetProperty(Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT"); + actor5.SetProperty(Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT); - DALI_TEST_EQUALS( actor8.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), true, TEST_LOCATION ); - actor8.SetProperty( Actor::Property::INHERIT_LAYOUT_DIRECTION, false ); - DALI_TEST_EQUALS( actor8.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), false, TEST_LOCATION ); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION), true, TEST_LOCATION); + actor8.SetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION, false); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION), false, TEST_LOCATION); - actor7.SetProperty( Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT" ); + actor7.SetProperty(Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT"); - DALI_TEST_EQUALS( actor3.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor4.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor5.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor6.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor7.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS(actor3.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(actor4.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(actor5.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actor6.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actor7.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actor9.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); - actor8.SetProperty( Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT" ); - DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); + actor8.SetProperty(Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT"); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(actor9.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); - actor7.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT ); - DALI_TEST_EQUALS( actor7.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); + actor7.SetProperty(Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT); + DALI_TEST_EQUALS(actor7.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); + DALI_TEST_EQUALS(actor9.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::RIGHT_TO_LEFT), TEST_LOCATION); - actor8.SetProperty( Actor::Property::INHERIT_LAYOUT_DIRECTION, true ); - DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); + actor8.SetProperty(Actor::Property::INHERIT_LAYOUT_DIRECTION, true); + DALI_TEST_EQUALS(actor8.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actor9.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); END_TEST; } - struct LayoutDirectionFunctor { LayoutDirectionFunctor(bool& signalCalled) - : mSignalCalled( signalCalled ) + : mSignalCalled(signalCalled) { } LayoutDirectionFunctor(const LayoutDirectionFunctor& rhs) - : mSignalCalled( rhs.mSignalCalled ) + : mSignalCalled(rhs.mSignalCalled) { } @@ -6912,107 +7481,106 @@ struct LayoutDirectionFunctor int UtcDaliActorLayoutDirectionSignal(void) { TestApplication application; - tet_infoline( "Check changing layout direction property sends a signal" ); + tet_infoline("Check changing layout direction property sends a signal"); Actor actor = Actor::New(); - DALI_TEST_EQUALS( actor.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION ); - application.GetScene().Add( actor ); - bool signalCalled = false; + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::LAYOUT_DIRECTION), static_cast(LayoutDirection::LEFT_TO_RIGHT), TEST_LOCATION); + application.GetScene().Add(actor); + bool signalCalled = false; LayoutDirectionFunctor layoutDirectionFunctor(signalCalled); - actor.ConnectSignal( &application, "layoutDirectionChanged", layoutDirectionFunctor ); - DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); + actor.ConnectSignal(&application, "layoutDirectionChanged", layoutDirectionFunctor); + DALI_TEST_EQUALS(signalCalled, false, TEST_LOCATION); // Test that writing the same value doesn't send a signal - actor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT ); - DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); + actor.SetProperty(Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT); + DALI_TEST_EQUALS(signalCalled, false, TEST_LOCATION); // Test that writing a different value sends the signal signalCalled = false; - actor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); - DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION ); + actor.SetProperty(Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT); + DALI_TEST_EQUALS(signalCalled, true, TEST_LOCATION); signalCalled = false; - actor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); - DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); + actor.SetProperty(Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT); + DALI_TEST_EQUALS(signalCalled, false, TEST_LOCATION); END_TEST; } struct ChildAddedSignalCheck { - ChildAddedSignalCheck( bool& signalReceived, Actor& childHandle ) - : mSignalReceived( signalReceived ), - mChildHandle( childHandle ) + ChildAddedSignalCheck(bool& signalReceived, Actor& childHandle) + : mSignalReceived(signalReceived), + mChildHandle(childHandle) { } - void operator() ( Actor childHandle ) + void operator()(Actor childHandle) { mSignalReceived = true; - mChildHandle = childHandle; + mChildHandle = childHandle; } - void operator() () + void operator()() { mSignalReceived = true; - mChildHandle = Actor(); + mChildHandle = Actor(); } - bool& mSignalReceived; + bool& mSignalReceived; Actor& mChildHandle; }; int UtcDaliChildAddedSignalP1(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool signalReceived=false; + bool signalReceived = false; Actor childActor; - ChildAddedSignalCheck signal( signalReceived, childActor ); - DevelActor::ChildAddedSignal( stage.GetRootLayer() ).Connect( &application, signal ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + ChildAddedSignalCheck signal(signalReceived, childActor); + DevelActor::ChildAddedSignal(stage.GetRootLayer()).Connect(&application, signal); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); auto actorA = Actor::New(); - stage.Add( actorA ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor, actorA, TEST_LOCATION ); + stage.Add(actorA); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(childActor, actorA, TEST_LOCATION); signalReceived = false; auto actorB = Actor::New(); - stage.Add( actorB ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor, actorB, TEST_LOCATION ); + stage.Add(actorB); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(childActor, actorB, TEST_LOCATION); END_TEST; } - int UtcDaliChildAddedSignalP2(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool signalReceived=false; + bool signalReceived = false; Actor childActor; - ChildAddedSignalCheck signal( signalReceived, childActor ); - tet_infoline( "Connect to childAdded signal by name" ); + ChildAddedSignalCheck signal(signalReceived, childActor); + tet_infoline("Connect to childAdded signal by name"); - stage.GetRootLayer().ConnectSignal( &application, "childAdded", signal ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + stage.GetRootLayer().ConnectSignal(&application, "childAdded", signal); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); auto actorA = Actor::New(); - stage.Add( actorA ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); + stage.Add(actorA); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); // Can't test which actor was added; signal signature is void() when connecting via name. signalReceived = false; auto actorB = Actor::New(); - stage.Add( actorB ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); + stage.Add(actorB); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); END_TEST; } @@ -7020,80 +7588,79 @@ int UtcDaliChildAddedSignalP2(void) int UtcDaliChildAddedSignalN(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool signalReceived=false; + bool signalReceived = false; Actor childActor; - ChildAddedSignalCheck signal( signalReceived, childActor ); - DevelActor::ChildAddedSignal( stage.GetRootLayer() ).Connect( &application, signal ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + ChildAddedSignalCheck signal(signalReceived, childActor); + DevelActor::ChildAddedSignal(stage.GetRootLayer()).Connect(&application, signal); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); auto actorA = Actor::New(); - stage.Add( actorA ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor, actorA, TEST_LOCATION ); + stage.Add(actorA); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(childActor, actorA, TEST_LOCATION); signalReceived = false; auto actorB = Actor::New(); - actorA.Add( actorB ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + actorA.Add(actorB); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); END_TEST; } - struct ChildRemovedSignalCheck { - ChildRemovedSignalCheck( bool& signalReceived, Actor& childHandle ) - : mSignalReceived( signalReceived ), - mChildHandle( childHandle ) + ChildRemovedSignalCheck(bool& signalReceived, Actor& childHandle) + : mSignalReceived(signalReceived), + mChildHandle(childHandle) { } - void operator() ( Actor childHandle ) + void operator()(Actor childHandle) { mSignalReceived = true; - mChildHandle = childHandle; + mChildHandle = childHandle; } - void operator() () + void operator()() { mSignalReceived = true; } - bool& mSignalReceived; + bool& mSignalReceived; Actor& mChildHandle; }; int UtcDaliChildRemovedSignalP1(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool signalReceived=false; + bool signalReceived = false; Actor childActor; - ChildRemovedSignalCheck signal( signalReceived, childActor ); - DevelActor::ChildRemovedSignal( stage.GetRootLayer() ).Connect( &application, signal ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + ChildRemovedSignalCheck signal(signalReceived, childActor); + DevelActor::ChildRemovedSignal(stage.GetRootLayer()).Connect(&application, signal); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); auto actorA = Actor::New(); - stage.Add( actorA ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); - DALI_TEST_CHECK( !childActor ); + stage.Add(actorA); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); + DALI_TEST_CHECK(!childActor); - stage.Remove( actorA ); - DALI_TEST_EQUALS( childActor, actorA, TEST_LOCATION ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); + stage.Remove(actorA); + DALI_TEST_EQUALS(childActor, actorA, TEST_LOCATION); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); signalReceived = false; - auto actorB = Actor::New(); - stage.Add( actorB ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + auto actorB = Actor::New(); + stage.Add(actorB); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); - stage.Remove( actorB ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor, actorB, TEST_LOCATION ); + stage.Remove(actorB); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(childActor, actorB, TEST_LOCATION); END_TEST; } @@ -7101,104 +7668,102 @@ int UtcDaliChildRemovedSignalP1(void) int UtcDaliChildRemovedSignalP2(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool signalReceived=false; + bool signalReceived = false; Actor childActor; - ChildAddedSignalCheck signal( signalReceived, childActor ); - tet_infoline( "Connect to childRemoved signal by name" ); + ChildAddedSignalCheck signal(signalReceived, childActor); + tet_infoline("Connect to childRemoved signal by name"); - stage.GetRootLayer().ConnectSignal( &application, "childRemoved", signal ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + stage.GetRootLayer().ConnectSignal(&application, "childRemoved", signal); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); auto actorA = Actor::New(); - stage.Add( actorA ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + stage.Add(actorA); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); - stage.Remove( actorA ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); + stage.Remove(actorA); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); signalReceived = false; - auto actorB = Actor::New(); - stage.Add( actorB ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + auto actorB = Actor::New(); + stage.Add(actorB); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); - stage.Remove( actorB ); - DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION ); + stage.Remove(actorB); + DALI_TEST_EQUALS(signalReceived, true, TEST_LOCATION); END_TEST; } - int UtcDaliChildRemovedSignalN(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool signalReceived=false; + bool signalReceived = false; Actor childActor; - ChildRemovedSignalCheck signal( signalReceived, childActor ); - DevelActor::ChildRemovedSignal( stage.GetRootLayer() ).Connect( &application, signal ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + ChildRemovedSignalCheck signal(signalReceived, childActor); + DevelActor::ChildRemovedSignal(stage.GetRootLayer()).Connect(&application, signal); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); auto actorA = Actor::New(); - stage.Add( actorA ); + stage.Add(actorA); auto actorB = Actor::New(); - actorA.Add( actorB ); + actorA.Add(actorB); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); - DALI_TEST_CHECK( ! childActor ); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); + DALI_TEST_CHECK(!childActor); - actorA.Remove( actorB ); - DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION ); + actorA.Remove(actorB); + DALI_TEST_EQUALS(signalReceived, false, TEST_LOCATION); END_TEST; } - int UtcDaliChildMovedSignalP(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - bool addedASignalReceived = false; - bool removedASignalReceived = false; - bool addedBSignalReceived = false; - bool removedBSignalReceived = false; + bool addedASignalReceived = false; + bool removedASignalReceived = false; + bool addedBSignalReceived = false; + bool removedBSignalReceived = false; Actor childActor; auto actorA = Actor::New(); auto actorB = Actor::New(); - stage.Add( actorA ); - stage.Add( actorB ); + stage.Add(actorA); + stage.Add(actorB); - ChildAddedSignalCheck addedSignalA( addedASignalReceived, childActor ); - ChildRemovedSignalCheck removedSignalA( removedASignalReceived, childActor ); - ChildAddedSignalCheck addedSignalB( addedBSignalReceived, childActor ); - ChildRemovedSignalCheck removedSignalB( removedBSignalReceived, childActor ); + ChildAddedSignalCheck addedSignalA(addedASignalReceived, childActor); + ChildRemovedSignalCheck removedSignalA(removedASignalReceived, childActor); + ChildAddedSignalCheck addedSignalB(addedBSignalReceived, childActor); + ChildRemovedSignalCheck removedSignalB(removedBSignalReceived, childActor); - DevelActor::ChildAddedSignal( actorA ).Connect( &application, addedSignalA ); - DevelActor::ChildRemovedSignal( actorA ).Connect( &application, removedSignalA ); - DevelActor::ChildAddedSignal( actorB ).Connect( &application, addedSignalB ); - DevelActor::ChildRemovedSignal( actorB ).Connect( &application, removedSignalB ); + DevelActor::ChildAddedSignal(actorA).Connect(&application, addedSignalA); + DevelActor::ChildRemovedSignal(actorA).Connect(&application, removedSignalA); + DevelActor::ChildAddedSignal(actorB).Connect(&application, addedSignalB); + DevelActor::ChildRemovedSignal(actorB).Connect(&application, removedSignalB); - DALI_TEST_EQUALS( addedASignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( removedASignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( addedBSignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( removedBSignalReceived, false, TEST_LOCATION ); + DALI_TEST_EQUALS(addedASignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(removedASignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(addedBSignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(removedBSignalReceived, false, TEST_LOCATION); // Create a child of A auto child = Actor::New(); - actorA.Add( child ); + actorA.Add(child); - DALI_TEST_EQUALS( addedASignalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( removedASignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( addedBSignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( removedBSignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor, child, TEST_LOCATION ); + DALI_TEST_EQUALS(addedASignalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(removedASignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(addedBSignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(removedBSignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(childActor, child, TEST_LOCATION); // Move child to B: addedASignalReceived = false; @@ -7206,11 +7771,11 @@ int UtcDaliChildMovedSignalP(void) removedASignalReceived = false; removedBSignalReceived = false; - actorB.Add( child ); // Expect this child to be re-parented - DALI_TEST_EQUALS( addedASignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( removedASignalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( addedBSignalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( removedBSignalReceived, false, TEST_LOCATION ); + actorB.Add(child); // Expect this child to be re-parented + DALI_TEST_EQUALS(addedASignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(removedASignalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(addedBSignalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(removedBSignalReceived, false, TEST_LOCATION); // Move child back to A: addedASignalReceived = false; @@ -7218,12 +7783,66 @@ int UtcDaliChildMovedSignalP(void) removedASignalReceived = false; removedBSignalReceived = false; - actorA.Add( child ); // Expect this child to be re-parented - DALI_TEST_EQUALS( addedASignalReceived, true, TEST_LOCATION ); - DALI_TEST_EQUALS( removedASignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( addedBSignalReceived, false, TEST_LOCATION ); - DALI_TEST_EQUALS( removedBSignalReceived, true, TEST_LOCATION ); + actorA.Add(child); // Expect this child to be re-parented + DALI_TEST_EQUALS(addedASignalReceived, true, TEST_LOCATION); + DALI_TEST_EQUALS(removedASignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(addedBSignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(removedBSignalReceived, true, TEST_LOCATION); + + END_TEST; +} + +int UtcDaliActorSwitchParentP(void) +{ + tet_infoline("Testing Actor::UtcDaliActorSwitchParentP"); + TestApplication application; + + Actor parent1 = Actor::New(); + Actor child = Actor::New(); + + application.GetScene().Add(parent1); + DALI_TEST_EQUALS(parent1.GetChildCount(), 0u, TEST_LOCATION); + + child.OnSceneSignal().Connect(OnSceneCallback); + child.OffSceneSignal().Connect(OffSceneCallback); + + // sanity check + DALI_TEST_CHECK(gOnSceneCallBackCalled == 0); + DALI_TEST_CHECK(gOffSceneCallBackCalled == 0); + + parent1.Add(child); + + DALI_TEST_EQUALS(parent1.GetChildCount(), 1u, TEST_LOCATION); + + DALI_TEST_CHECK(gOnSceneCallBackCalled == 1); + DALI_TEST_CHECK(gOffSceneCallBackCalled == 0); + + Actor parent2 = Actor::New(); + application.GetScene().Add(parent2); + + bool addSignalReceived = false; + ChildAddedSignalCheck addedSignal(addSignalReceived, child); + DevelActor::ChildAddedSignal(application.GetScene().GetRootLayer()).Connect(&application, addedSignal); + DALI_TEST_EQUALS(addSignalReceived, false, TEST_LOCATION); + + bool removedSignalReceived = false; + ChildRemovedSignalCheck removedSignal(removedSignalReceived, child); + DevelActor::ChildRemovedSignal(application.GetScene().GetRootLayer()).Connect(&application, removedSignal); + DALI_TEST_EQUALS(removedSignalReceived, false, TEST_LOCATION); + + DevelActor::SwitchParent(child, parent2); + + DALI_TEST_EQUALS(addSignalReceived, false, TEST_LOCATION); + DALI_TEST_EQUALS(removedSignalReceived, false, TEST_LOCATION); + + DALI_TEST_EQUALS(parent1.GetChildCount(), 0u, TEST_LOCATION); + DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION); + + DALI_TEST_CHECK(gOnSceneCallBackCalled == 1); + DALI_TEST_CHECK(gOffSceneCallBackCalled == 0); + DALI_TEST_CHECK(child.GetProperty(Dali::Actor::Property::CONNECTED_TO_SCENE)); + DALI_TEST_CHECK(child.GetParent() == parent2); END_TEST; } @@ -7231,46 +7850,46 @@ int UtcDaliChildMovedSignalP(void) int utcDaliActorCulled(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - tet_infoline( "Check that the actor is culled if the actor is out of the screen" ); + tet_infoline("Check that the actor is culled if the actor is out of the screen"); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) ); + actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f)); Geometry geometry = CreateQuadGeometry(); - Shader shader = CreateShader(); + Shader shader = CreateShader(); Renderer renderer = Renderer::New(geometry, shader); - actor.AddRenderer( renderer ); + actor.AddRenderer(renderer); - stage.Add( actor ); + stage.Add(actor); application.SendNotification(); - application.Render( 0 ); + application.Render(0); - DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), false, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::CULLED), false, TEST_LOCATION); - PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::CULLED, LessThanCondition( 0.5f ) ); - notification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED ); + PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::CULLED, LessThanCondition(0.5f)); + notification.SetNotifyMode(PropertyNotification::NOTIFY_ON_CHANGED); // Connect NotifySignal - bool propertyNotificationSignal( false ); - PropertyNotification source; - CulledPropertyNotificationFunctor f( propertyNotificationSignal, source ); - notification.NotifySignal().Connect( &application, f ) ; + bool propertyNotificationSignal(false); + PropertyNotification source; + CulledPropertyNotificationFunctor f(propertyNotificationSignal, source); + notification.NotifySignal().Connect(&application, f); - actor.SetProperty( Actor::Property::POSITION, Vector2( 1000.0f, 1000.0f )); + actor.SetProperty(Actor::Property::POSITION, Vector2(1000.0f, 1000.0f)); application.SendNotification(); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), true, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetProperty(Actor::Property::CULLED), true, TEST_LOCATION); - DALI_TEST_EQUALS( propertyNotificationSignal, true, TEST_LOCATION ); - DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( Actor::Property::CULLED ), TEST_LOCATION ); - DALI_TEST_EQUALS( source.GetTarget().GetProperty< bool >( source.GetTargetProperty() ), true, TEST_LOCATION ); + DALI_TEST_EQUALS(propertyNotificationSignal, true, TEST_LOCATION); + DALI_TEST_EQUALS(source.GetTargetProperty(), static_cast(Actor::Property::CULLED), TEST_LOCATION); + DALI_TEST_EQUALS(source.GetTarget().GetProperty(source.GetTargetProperty()), true, TEST_LOCATION); END_TEST; } @@ -7278,18 +7897,18 @@ int utcDaliActorCulled(void) int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - tet_infoline( "Ensure we clear the screen when the last actor is removed" ); + tet_infoline("Ensure we clear the screen when the last actor is removed"); Actor actor = CreateRenderableActor(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - stage.Add( actor ); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + stage.Add(actor); application.SendNotification(); application.Render(); - auto& glAbstraction = application.GetGlAbstraction(); + auto& glAbstraction = application.GetGlAbstraction(); const auto clearCountBefore = glAbstraction.GetClearCountCalled(); actor.Unparent(); @@ -7297,7 +7916,7 @@ int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION ); + DALI_TEST_EQUALS(glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION); END_TEST; } @@ -7305,26 +7924,26 @@ int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void) int utcDaliEnsureRenderWhenMakingLastActorInvisible(void) { TestApplication application; - auto stage = application.GetScene(); + auto stage = application.GetScene(); - tet_infoline( "Ensure we clear the screen when the last actor is made invisible" ); + tet_infoline("Ensure we clear the screen when the last actor is made invisible"); Actor actor = CreateRenderableActor(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - stage.Add( actor ); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + stage.Add(actor); application.SendNotification(); application.Render(); - auto& glAbstraction = application.GetGlAbstraction(); + auto& glAbstraction = application.GetGlAbstraction(); const auto clearCountBefore = glAbstraction.GetClearCountCalled(); - actor.SetProperty( Actor::Property::VISIBLE, false ); + actor.SetProperty(Actor::Property::VISIBLE, false); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION ); + DALI_TEST_EQUALS(glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION); END_TEST; } @@ -7332,197 +7951,330 @@ int utcDaliEnsureRenderWhenMakingLastActorInvisible(void) int utcDaliActorGetSizeAfterAnimation(void) { TestApplication application; - tet_infoline( "Check the actor size before / after an animation is finished" ); + tet_infoline("Check the actor size before / after an animation is finished"); - Vector3 actorSize( 100.0f, 100.0f, 0.0f ); + Vector3 actorSize(100.0f, 100.0f, 0.0f); Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, actorSize ); - actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - application.GetScene().Add( actor ); + actor.SetProperty(Actor::Property::SIZE, actorSize); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); // Size should be updated without rendering. - Vector3 size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + Vector3 size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); application.SendNotification(); application.Render(); // Size and current size should be updated. - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( actorSize.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( actorSize.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actorSize.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); - - Vector3 currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( actorSize.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( actorSize.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( actorSize.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); + + Vector3 currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); // Set size again - actorSize = Vector3( 200.0f, 200.0f, 0.0f ); - actor.SetProperty( Actor::Property::SIZE, actorSize ); + actorSize = Vector3(200.0f, 200.0f, 0.0f); + actor.SetProperty(Actor::Property::SIZE, actorSize); - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); - Vector3 targetValue( 10.0f, 20.0f, 0.0f ); + Vector3 targetValue(10.0f, 20.0f, 0.0f); - Animation animation = Animation::New( 1.0f ); - animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetValue ); + Animation animation = Animation::New(1.0f); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetValue); animation.Play(); // Size should be updated without rendering. - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); targetValue.width = 50.0f; animation.Clear(); - animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetValue.width ); + animation.AnimateTo(Property(actor, Actor::Property::SIZE_WIDTH), targetValue.width); animation.Play(); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); targetValue.height = 70.0f; animation.Clear(); - animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetValue.height ); + animation.AnimateTo(Property(actor, Actor::Property::SIZE_HEIGHT), targetValue.height); animation.Play(); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - Vector3 offset( 10.0f, 20.0f, 0.0f ); + Vector3 offset(10.0f, 20.0f, 0.0f); animation.Clear(); - animation.AnimateBy( Property( actor, Actor::Property::SIZE ), offset ); + animation.AnimateBy(Property(actor, Actor::Property::SIZE), offset); animation.Play(); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation targetValue += offset; - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); offset.width = 20.0f; animation.Clear(); - animation.AnimateBy( Property( actor, Actor::Property::SIZE_WIDTH ), offset.width ); + animation.AnimateBy(Property(actor, Actor::Property::SIZE_WIDTH), offset.width); animation.Play(); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation targetValue.width += offset.width; - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); offset.height = 10.0f; animation.Clear(); - animation.AnimateBy( Property( actor, Actor::Property::SIZE_HEIGHT ), offset.height ); + animation.AnimateBy(Property(actor, Actor::Property::SIZE_HEIGHT), offset.height); animation.Play(); application.SendNotification(); - application.Render( 1100 ); // After the animation + application.Render(1100); // After the animation targetValue.height += offset.height; - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); - DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); // Set size again - actorSize = Vector3( 300.0f, 300.0f, 0.0f ); + actorSize = Vector3(300.0f, 300.0f, 0.0f); - actor.SetProperty( Actor::Property::SIZE, actorSize ); + actor.SetProperty(Actor::Property::SIZE, actorSize); - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); application.SendNotification(); application.Render(); - size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorRelayoutAndAnimation(void) +{ + TestApplication application; + tet_infoline("Check the actor size when relayoutting and playing animation"); + + Vector3 parentSize(300.0f, 300.0f, 0.0f); + Vector3 actorSize(100.0f, 100.0f, 0.0f); + + { + Actor parentA = Actor::New(); + parentA.SetProperty(Actor::Property::SIZE, parentSize); + parentA.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parentA); + + Actor parentB = Actor::New(); + parentB.SetProperty(Actor::Property::SIZE, parentSize); + parentB.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parentB); + + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::SIZE, actorSize); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + parentA.Add(actor); + + Vector3 size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + Vector3 targetValue(200.0f, 200.0f, 0.0f); + + Animation animation = Animation::New(1.0f); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetValue); + animation.Play(); - currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); - DALI_TEST_EQUALS( currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + application.SendNotification(); + application.Render(1100); // After the animation + + // Size and current size should be updated. + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + Vector3 currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + // Trigger relayout + parentB.Add(actor); + + application.SendNotification(); + application.Render(); + + // Size and current size should be same. + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + actor.Unparent(); + parentA.Unparent(); + parentB.Unparent(); + } + + { + Actor parentA = Actor::New(); + parentA.SetProperty(Actor::Property::SIZE, parentSize); + parentA.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parentA); + + Actor parentB = Actor::New(); + parentB.SetProperty(Actor::Property::SIZE, parentSize); + parentB.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parentB); + + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::SIZE, actorSize); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + parentA.Add(actor); + + Vector3 size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + application.SendNotification(); + application.Render(); + + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + Vector3 currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + Vector3 targetValue(200.0f, 200.0f, 0.0f); + + // Make an animation + Animation animation = Animation::New(1.0f); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetValue); + animation.Play(); + + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + application.SendNotification(); + application.Render(1100); // After the animation + + // Size and current size should be updated. + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + // Trigger relayout + parentB.Add(actor); + + application.SendNotification(); + application.Render(); + + // Size and current size should be same. + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + actor.Unparent(); + parentA.Unparent(); + parentB.Unparent(); + } END_TEST; } @@ -7539,15 +8291,17 @@ int utcDaliActorPartialUpdate(void) tet_infoline("Check the damaged area"); - const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() ); + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); std::vector> damagedRects; - Rect clippingRect; + Rect clippingRect; application.SendNotification(); application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); // First render pass, nothing to render, adaptor would just do swap buffer. DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; application.RenderWithPartialUpdate(damagedRects, clippingRect); Actor actor = CreateRenderableActor(); @@ -7644,15 +8398,17 @@ int utcDaliActorPartialUpdateSetColor(void) tet_infoline("Check uniform update"); - const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() ); + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); std::vector> damagedRects; - Rect clippingRect; + Rect clippingRect; application.SendNotification(); application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); // First render pass, nothing to render, adaptor would just do swap buffer. DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; application.RenderWithPartialUpdate(damagedRects, clippingRect); Actor actor = CreateRenderableActor(); @@ -7737,21 +8493,23 @@ int utcDaliActorPartialUpdateSetProperty(void) true, true); - tet_infoline( "Set/Update property with partial update" ); + tet_infoline("Set/Update property with partial update"); const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); std::vector> damagedRects; - Rect clippingRect; + Rect clippingRect; application.SendNotification(); application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); // First render pass, nothing to render, adaptor would just do swap buffer. DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; application.RenderWithPartialUpdate(damagedRects, clippingRect); - Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u); - Actor actor = CreateRenderableActor(image, RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE); + Texture image = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u); + Actor actor = CreateRenderableActor(image, RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE); actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f)); actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f)); @@ -7774,7 +8532,7 @@ int utcDaliActorPartialUpdateSetProperty(void) DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); - Property::Index shadowColorPropertyIndex = actor.GetPropertyIndex( SHADER_SHADOW_COLOR_PROPERTY_NAME ); + Property::Index shadowColorPropertyIndex = actor.GetPropertyIndex(SHADER_SHADOW_COLOR_PROPERTY_NAME); actor.SetProperty(shadowColorPropertyIndex, Vector4(1.0f, 1.0f, 0.0f, 1.0f)); damagedRects.clear(); @@ -7789,10 +8547,20 @@ int utcDaliActorPartialUpdateSetProperty(void) DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + // Should be no damage rects, nothing changed + damagedRects.clear(); + application.SendNotification(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // Should be 1 damage rect due to change in size damagedRects.clear(); + actor.SetProperty(Actor::Property::SIZE, Vector3(26.0f, 26.0f, 0.0f)); + application.SendNotification(); application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + clippingRect = Rect(16, 752, 32, 48); // new clipping rect size increased due to change in actor size DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); application.RenderWithPartialUpdate(damagedRects, clippingRect); DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); @@ -7819,7 +8587,7 @@ int utcDaliActorPartialUpdateTwoActors(void) tet_infoline("Check the damaged rects with partial update and two actors"); - const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() ); + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); Actor actor = CreateRenderableActor(); actor.SetProperty(Actor::Property::POSITION, Vector3(100.0f, 100.0f, 0.0f)); @@ -7850,6 +8618,31 @@ int utcDaliActorPartialUpdateTwoActors(void) DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + // Change a Renderer of actor1 + Geometry geometry = CreateQuadGeometry(); + Shader shader = CreateShader(); + Renderer newRenderer = Renderer::New(geometry, shader); + Renderer renderer = actor.GetRendererAt(0); + + actor.RemoveRenderer(renderer); + actor.AddRenderer(newRenderer); + + damagedRects.clear(); + + application.SendNotification(); + application.PreRenderWithPartialUpdate(TestApplication::DEFAULT_RENDER_INTERVAL, nullptr, damagedRects); + + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(Rect(64, 672, 64, 64), damagedRects[0], TEST_LOCATION); + + // in screen coordinates, adaptor would calculate it using previous frames information + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + END_TEST; } @@ -7863,14 +8656,14 @@ int utcDaliActorPartialUpdateActorsWithSizeHint(void) true, true); - tet_infoline( "Check the damaged rect with partial update and actor size hint" ); + tet_infoline("Check the damaged rect with partial update and actor size hint"); - const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() ); + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); Actor actor = CreateRenderableActor(); - actor.SetProperty(Actor::Property::POSITION, Vector3(75.0f, 150.0f, 0.0f)); - actor.SetProperty(Actor::Property::SIZE, Vector3(75.0f, 150.0f, 0.0f)); - actor.SetProperty(DevelActor::Property::UPDATE_SIZE_HINT, Vector3(150, 300, 0)); + actor.SetProperty(Actor::Property::POSITION, Vector3(64.0f, 64.0f, 0.0f)); + actor.SetProperty(Actor::Property::SIZE, Vector3(32.0f, 32.0f, 0.0f)); + actor.SetProperty(DevelActor::Property::UPDATE_SIZE_HINT, Vector3(64.0f, 64.0f, 0.0f)); actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); application.GetScene().Add(actor); @@ -7880,7 +8673,7 @@ int utcDaliActorPartialUpdateActorsWithSizeHint(void) DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); - Rect clippingRect = Rect(0, 496, 160, 320); + Rect clippingRect = Rect(32, 704, 80, 80); DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); application.RenderWithPartialUpdate(damagedRects, clippingRect); @@ -7893,134 +8686,965 @@ int utcDaliActorPartialUpdateActorsWithSizeHint(void) END_TEST; } -int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void) +int utcDaliActorPartialUpdateAnimation(void) { - TestApplication application; + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); - Actor actor = Actor::New(); - DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get(), false, TEST_LOCATION); - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, true); - DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get(), true, TEST_LOCATION); - DALI_TEST_EQUALS(actor.GetPropertyType(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), Property::BOOLEAN, TEST_LOCATION); - DALI_TEST_EQUALS(actor.IsPropertyWritable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), true, TEST_LOCATION); - DALI_TEST_EQUALS(actor.IsPropertyAnimatable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION); - DALI_TEST_EQUALS(actor.IsPropertyAConstraintInput(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION); - DALI_TEST_EQUALS(actor.GetPropertyName(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), "captureAllTouchAfterStart", TEST_LOCATION); - END_TEST; -} + tet_infoline("Check the damaged area with partial update and animation"); -int UtcDaliActorCaptureAllTouchAfterStartPropertyN(void) -{ - TestApplication application; + TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace(); + drawTrace.Enable(true); + drawTrace.Reset(); - Actor actor = Actor::New(); + Actor actor1 = CreateRenderableActor(); + actor1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor1.SetProperty(Actor::Property::SIZE, Vector3(80.0f, 80.0f, 0.0f)); + application.GetScene().Add(actor1); - // Make sure setting invalid types does not cause a crash - try - { - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, 1.0f); - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector2::ONE); - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector3::ONE); - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector4::ONE); - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Map()); - actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Array()); - tet_result(TET_PASS); - } - catch(...) - { - tet_result(TET_FAIL); - } - END_TEST; -} + Actor actor2 = CreateRenderableActor(); + actor2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor2.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f)); + application.GetScene().Add(actor2); -int UtcDaliActorLowerBelowNegative(void) -{ - TestApplication application; - Dali::Actor instance; - try - { - Dali::Actor arg1; - instance.LowerBelow(arg1); - DALI_TEST_CHECK(false); // Should not get here - } - catch(...) - { - DALI_TEST_CHECK(true); // We expect an assert - } - END_TEST; -} + std::vector> damagedRects; + Rect clippingRect; + Rect expectedRect1, expectedRect2; -int UtcDaliActorRaiseAboveNegative(void) -{ - TestApplication application; - Dali::Actor instance; - try - { - Dali::Actor arg1; - instance.RaiseAbove(arg1); - DALI_TEST_CHECK(false); // Should not get here - } - catch(...) - { - DALI_TEST_CHECK(true); // We expect an assert - } - END_TEST; -} + application.SendNotification(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); -int UtcDaliActorRaiseToTopNegative(void) -{ - TestApplication application; - Dali::Actor instance; - try - { - instance.RaiseToTop(); - DALI_TEST_CHECK(false); // Should not get here - } - catch(...) - { - DALI_TEST_CHECK(true); // We expect an assert - } - END_TEST; -} + DALI_TEST_EQUALS(damagedRects.size(), 2, TEST_LOCATION); -int UtcDaliActorAddRendererNegative(void) -{ - TestApplication application; - Dali::Actor instance; - try - { - Dali::Renderer arg1; - instance.AddRenderer(arg1); - DALI_TEST_CHECK(false); // Should not get here - } - catch(...) - { - DALI_TEST_CHECK(true); // We expect an assert - } - END_TEST; -} + // Aligned by 16 + expectedRect1 = Rect(0, 720, 96, 96); // in screen coordinates, includes 3 last frames updates + expectedRect2 = Rect(0, 784, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(expectedRect1, damagedRects[0], TEST_LOCATION); + DALI_TEST_EQUALS>(expectedRect2, damagedRects[1], TEST_LOCATION); -int UtcDaliActorTouchedSignalNegative(void) -{ - TestApplication application; - Dali::Actor instance; - try - { - instance.TouchedSignal(); - DALI_TEST_CHECK(false); // Should not get here - } - catch(...) - { - DALI_TEST_CHECK(true); // We expect an assert - } - END_TEST; -} + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); -int UtcDaliActorTranslateByNegative(void) -{ - TestApplication application; - Dali::Actor instance; - try + damagedRects.clear(); + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Make an animation + Animation animation = Animation::New(1.0f); + animation.AnimateTo(Property(actor2, Actor::Property::POSITION_X), 160.0f, TimePeriod(0.5f, 0.5f)); + animation.Play(); + + application.SendNotification(); + + damagedRects.clear(); + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + drawTrace.Reset(); + damagedRects.clear(); + + // In animation deley time + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Skip rendering + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION); + + drawTrace.Reset(); + damagedRects.clear(); + + // Also in animation deley time + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.PreRenderWithPartialUpdate(100, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Skip rendering + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION); + + // Unparent 2 actors and make a new actor + actor1.Unparent(); + actor2.Unparent(); + + Actor actor3 = CreateRenderableActor(); + actor3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor3.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f)); + application.GetScene().Add(actor3); + + application.SendNotification(); + + // Started animation + damagedRects.clear(); + application.PreRenderWithPartialUpdate(500, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 5, TEST_LOCATION); + + // The first dirty rect is actor3's. + // We don't know the exact dirty rect of actor2 + DALI_TEST_EQUALS>(expectedRect2, damagedRects[0], TEST_LOCATION); + DALI_TEST_EQUALS>(expectedRect1, damagedRects[1], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Finished animation, but the actor was already unparented + damagedRects.clear(); + application.PreRenderWithPartialUpdate(500, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + DALI_TEST_EQUALS>(expectedRect2, damagedRects[0], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + END_TEST; +} + +int utcDaliActorPartialUpdateChangeVisibility(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with partial update and visibility change"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor actor = CreateRenderableActor(); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f)); + actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f)); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); + + application.SendNotification(); + + std::vector> damagedRects; + Rect clippingRect; + + // 1. Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // 2. Make the Actor invisible + actor.SetProperty(Actor::Property::VISIBLE, false); + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + // 3. Make the Actor visible again + actor.SetProperty(Actor::Property::VISIBLE, true); + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialUpdateOnOffScene(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with partial update and on/off scene"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor actor = CreateRenderableActor(); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f)); + actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f)); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); + + application.SendNotification(); + + std::vector> damagedRects; + Rect clippingRect; + + // 1. Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // 2. Remove the Actor from the Scene + actor.Unparent(); + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + // 3. Add the Actor to the Scene again + application.GetScene().Add(actor); + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialUpdateSkipRendering(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check to skip rendering in case of the empty damaged rect"); + + TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace(); + drawTrace.Enable(true); + drawTrace.Reset(); + + Actor actor1 = CreateRenderableActor(); + actor1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor1.SetProperty(Actor::Property::SIZE, Vector3(80.0f, 80.0f, 0.0f)); + application.GetScene().Add(actor1); + + std::vector> damagedRects; + Rect clippingRect; + Rect expectedRect1; + + application.SendNotification(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + expectedRect1 = Rect(0, 720, 96, 96); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(expectedRect1, damagedRects[0], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION); + + damagedRects.clear(); + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Remove the actor + actor1.Unparent(); + + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS>(expectedRect1, damagedRects[0], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Render again without any change + damagedRects.clear(); + drawTrace.Reset(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + clippingRect = Rect(); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Skip rendering + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION); + + // Add the actor again + application.GetScene().Add(actor1); + + application.SendNotification(); + + damagedRects.clear(); + drawTrace.Reset(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS>(expectedRect1, damagedRects[0], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialUpdate3DNode(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Partial update should be ignored in case of 3d layer of 3d node"); + + TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace(); + drawTrace.Enable(true); + drawTrace.Reset(); + + Actor actor1 = CreateRenderableActor(); + actor1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + actor1.SetProperty(Actor::Property::SIZE, Vector3(80.0f, 80.0f, 0.0f)); + application.GetScene().Add(actor1); + + std::vector> damagedRects; + Rect clippingRect; + + application.SendNotification(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION); + + // Change the layer to 3D + application.GetScene().GetRootLayer().SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_3D); + + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + DALI_TEST_EQUALS>(TestApplication::DEFAULT_SURFACE_RECT, damagedRects[0], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + drawTrace.Reset(); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION); + + // Change the layer to 2D + application.GetScene().GetRootLayer().SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_UI); + + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Make 3D transform + actor1.SetProperty(Actor::Property::ORIENTATION, Quaternion(Degree(90.0f), Vector3::YAXIS)); + + application.SendNotification(); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + DALI_TEST_EQUALS>(TestApplication::DEFAULT_SURFACE_RECT, damagedRects[0], TEST_LOCATION); + + clippingRect = TestApplication::DEFAULT_SURFACE_RECT; + drawTrace.Reset(); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialUpdateNotRenderableActor(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with not renderable parent actor"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor parent = Actor::New(); + parent[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + parent[Actor::Property::POSITION] = Vector3(16.0f, 16.0f, 0.0f); + parent[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + parent.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parent); + + Actor child = CreateRenderableActor(); + child[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + child[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + child.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + parent.Add(child); + + application.SendNotification(); + + std::vector> damagedRects; + + // 1. Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + Rect clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialUpdateChangeTransparency(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with changing transparency"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor actor = CreateRenderableActor(); + actor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + actor[Actor::Property::POSITION] = Vector3(16.0f, 16.0f, 0.0f); + actor[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); + + application.SendNotification(); + + std::vector> damagedRects; + + // Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + Rect clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Make the actor transparent by changing opacity of the Renderer + // It changes a uniform value + Renderer renderer = actor.GetRendererAt(0); + renderer[DevelRenderer::Property::OPACITY] = 0.0f; + + application.SendNotification(); + + // The damaged rect should be same + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // Make the actor opaque again + renderer[DevelRenderer::Property::OPACITY] = 1.0f; + + application.SendNotification(); + + // The damaged rect should not be empty + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Make the actor culled + actor[Actor::Property::SIZE] = Vector3(0.0f, 0.0f, 0.0f); + + application.SendNotification(); + + // The damaged rect should be same + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // Make the actor not culled again + actor[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 16.0f); + + application.SendNotification(); + + // The damaged rect should not be empty + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialUpdateChangeParentOpacity(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with changing parent's opacity"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor parent = Actor::New(); + parent[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + parent[Actor::Property::POSITION] = Vector3(16.0f, 16.0f, 0.0f); + parent[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + parent.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parent); + + Texture texture = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, 16u, 16u); + Actor child = CreateRenderableActor(texture); + child[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + child[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + child.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + parent.Add(child); + + application.SendNotification(); + + std::vector> damagedRects; + + // Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + Rect clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // Change the parent's opacity + parent[Actor::Property::OPACITY] = 0.5f; + + application.SendNotification(); + + // The damaged rect should be same + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + END_TEST; +} + +int utcDaliActorPartialAddRemoveRenderer(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with adding / removing renderer"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor actor = CreateRenderableActor(); + actor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + actor[Actor::Property::POSITION] = Vector3(16.0f, 16.0f, 0.0f); + actor[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); + + application.SendNotification(); + + std::vector> damagedRects; + + // Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + Rect clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Remove the Renderer + Renderer renderer = actor.GetRendererAt(0); + actor.RemoveRenderer(renderer); + + application.SendNotification(); + + // The damaged rect should be the actor area + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + // Add the Renderer again + actor.AddRenderer(renderer); + + application.SendNotification(); + + // The damaged rect should be the actor area + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + DALI_TEST_EQUALS>(clippingRect, damagedRects[0], TEST_LOCATION); + + END_TEST; +} + +int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get(), false, TEST_LOCATION); + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, true); + DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get(), true, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetPropertyType(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), Property::BOOLEAN, TEST_LOCATION); + DALI_TEST_EQUALS(actor.IsPropertyWritable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), true, TEST_LOCATION); + DALI_TEST_EQUALS(actor.IsPropertyAnimatable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION); + DALI_TEST_EQUALS(actor.IsPropertyAConstraintInput(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION); + DALI_TEST_EQUALS(actor.GetPropertyName(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), "captureAllTouchAfterStart", TEST_LOCATION); + END_TEST; +} + +int UtcDaliActorCaptureAllTouchAfterStartPropertyN(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + // Make sure setting invalid types does not cause a crash + try + { + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, 1.0f); + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector2::ONE); + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector3::ONE); + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector4::ONE); + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Map()); + actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Array()); + tet_result(TET_PASS); + } + catch(...) + { + tet_result(TET_FAIL); + } + END_TEST; +} + +int UtcDaliActorTouchAreaOffsetPropertyP(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Rect touchAreaOffset = actor.GetProperty(DevelActor::Property::TOUCH_AREA_OFFSET).Get>(); + DALI_TEST_EQUALS(Rect(0, 0, 0, 0), touchAreaOffset, TEST_LOCATION); + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Rect(10, 20, 30, 40)); + touchAreaOffset = actor.GetProperty(DevelActor::Property::TOUCH_AREA_OFFSET).Get>(); + DALI_TEST_EQUALS(Rect(10, 20, 30, 40), touchAreaOffset, TEST_LOCATION); + END_TEST; +} + +int UtcDaliActorTouchAreaOffsetPropertyN(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + // Make sure setting invalid types does not cause a crash + try + { + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, 1.0f); + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Vector2::ONE); + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Vector3::ONE); + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Vector4::ONE); + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Property::Map()); + actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Property::Array()); + tet_result(TET_PASS); + } + catch(...) + { + tet_result(TET_FAIL); + } + END_TEST; +} + +int UtcDaliActorLowerBelowNegative(void) +{ + TestApplication application; + Dali::Actor instance; + try + { + Dali::Actor arg1; + instance.LowerBelow(arg1); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliActorRaiseAboveNegative(void) +{ + TestApplication application; + Dali::Actor instance; + try + { + Dali::Actor arg1; + instance.RaiseAbove(arg1); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliActorRaiseToTopNegative(void) +{ + TestApplication application; + Dali::Actor instance; + try + { + instance.RaiseToTop(); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliActorAddRendererNegative(void) +{ + TestApplication application; + Dali::Actor instance; + try + { + Dali::Renderer arg1; + instance.AddRenderer(arg1); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliActorTouchedSignalNegative(void) +{ + TestApplication application; + Dali::Actor instance; + try + { + instance.TouchedSignal(); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliActorTranslateByNegative(void) +{ + TestApplication application; + Dali::Actor instance; + try { Dali::Vector3 arg1; instance.TranslateBy(arg1); @@ -8036,7 +9660,7 @@ int UtcDaliActorTranslateByNegative(void) int UtcDaliActorFindChildByIdNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { unsigned int arg1 = 0u; @@ -8053,7 +9677,7 @@ int UtcDaliActorFindChildByIdNegative(void) int UtcDaliActorGetRendererAtNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { unsigned int arg1 = 0u; @@ -8070,7 +9694,7 @@ int UtcDaliActorGetRendererAtNegative(void) int UtcDaliActorHoveredSignalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.HoveredSignal(); @@ -8086,7 +9710,7 @@ int UtcDaliActorHoveredSignalNegative(void) int UtcDaliActorLowerToBottomNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.LowerToBottom(); @@ -8102,7 +9726,7 @@ int UtcDaliActorLowerToBottomNegative(void) int UtcDaliActorOnSceneSignalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.OnSceneSignal(); @@ -8118,7 +9742,7 @@ int UtcDaliActorOnSceneSignalNegative(void) int UtcDaliActorOffSceneSignalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.OffSceneSignal(); @@ -8134,7 +9758,7 @@ int UtcDaliActorOffSceneSignalNegative(void) int UtcDaliActorRemoveRendererNegative01(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { unsigned int arg1 = 0u; @@ -8151,7 +9775,7 @@ int UtcDaliActorRemoveRendererNegative01(void) int UtcDaliActorRemoveRendererNegative02(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Renderer arg1; @@ -8168,7 +9792,7 @@ int UtcDaliActorRemoveRendererNegative02(void) int UtcDaliActorFindChildByNameNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { std::string arg1; @@ -8185,12 +9809,12 @@ int UtcDaliActorFindChildByNameNegative(void) int UtcDaliActorSetResizePolicyNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::ResizePolicy::Type arg1 = ResizePolicy::USE_NATURAL_SIZE; - Dali::Dimension::Type arg2 = Dimension::ALL_DIMENSIONS; - instance.SetResizePolicy(arg1,arg2); + Dali::Dimension::Type arg2 = Dimension::ALL_DIMENSIONS; + instance.SetResizePolicy(arg1, arg2); DALI_TEST_CHECK(false); // Should not get here } catch(...) @@ -8203,7 +9827,7 @@ int UtcDaliActorSetResizePolicyNegative(void) int UtcDaliActorOnRelayoutSignalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.OnRelayoutSignal(); @@ -8219,7 +9843,7 @@ int UtcDaliActorOnRelayoutSignalNegative(void) int UtcDaliActorWheelEventSignalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.WheelEventSignal(); @@ -8235,7 +9859,7 @@ int UtcDaliActorWheelEventSignalNegative(void) int UtcDaliActorGetHeightForWidthNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { float arg1 = 0.0f; @@ -8252,7 +9876,7 @@ int UtcDaliActorGetHeightForWidthNegative(void) int UtcDaliActorGetWidthForHeightNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { float arg1 = 0.0f; @@ -8269,7 +9893,7 @@ int UtcDaliActorGetWidthForHeightNegative(void) int UtcDaliActorLayoutDirectionChangedSignalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.LayoutDirectionChangedSignal(); @@ -8285,7 +9909,7 @@ int UtcDaliActorLayoutDirectionChangedSignalNegative(void) int UtcDaliActorAddNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Actor arg1; @@ -8302,7 +9926,7 @@ int UtcDaliActorAddNegative(void) int UtcDaliActorLowerNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.Lower(); @@ -8318,7 +9942,7 @@ int UtcDaliActorLowerNegative(void) int UtcDaliActorRaiseNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.Raise(); @@ -8334,7 +9958,7 @@ int UtcDaliActorRaiseNegative(void) int UtcDaliActorRemoveNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Actor arg1; @@ -8351,7 +9975,7 @@ int UtcDaliActorRemoveNegative(void) int UtcDaliActorScaleByNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Vector3 arg1; @@ -8368,7 +9992,7 @@ int UtcDaliActorScaleByNegative(void) int UtcDaliActorGetLayerNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.GetLayer(); @@ -8384,7 +10008,7 @@ int UtcDaliActorGetLayerNegative(void) int UtcDaliActorRotateByNegative01(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Quaternion arg1; @@ -8401,12 +10025,12 @@ int UtcDaliActorRotateByNegative01(void) int UtcDaliActorRotateByNegative02(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { - Dali::Radian arg1; + Dali::Radian arg1; Dali::Vector3 arg2; - instance.RotateBy(arg1,arg2); + instance.RotateBy(arg1, arg2); DALI_TEST_CHECK(false); // Should not get here } catch(...) @@ -8419,7 +10043,7 @@ int UtcDaliActorRotateByNegative02(void) int UtcDaliActorUnparentNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.Unparent(); @@ -8435,7 +10059,7 @@ int UtcDaliActorUnparentNegative(void) int UtcDaliActorGetChildAtNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { unsigned int arg1 = 0u; @@ -8452,7 +10076,7 @@ int UtcDaliActorGetChildAtNegative(void) int UtcDaliActorGetChildCountNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.GetChildCount(); @@ -8468,7 +10092,7 @@ int UtcDaliActorGetChildCountNegative(void) int UtcDaliActorGetTargetSizeNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.GetTargetSize(); @@ -8484,14 +10108,14 @@ int UtcDaliActorGetTargetSizeNegative(void) int UtcDaliActorScreenToLocalNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { float arg1 = 0.0f; float arg2 = 0.0f; float arg3 = 0.0f; float arg4 = 0.0f; - instance.ScreenToLocal(arg1,arg2,arg3,arg4); + instance.ScreenToLocal(arg1, arg2, arg3, arg4); DALI_TEST_CHECK(false); // Should not get here } catch(...) @@ -8504,7 +10128,7 @@ int UtcDaliActorScreenToLocalNegative(void) int UtcDaliActorGetNaturalSizeNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.GetNaturalSize(); @@ -8520,7 +10144,7 @@ int UtcDaliActorGetNaturalSizeNegative(void) int UtcDaliActorGetRelayoutSizeNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Dimension::Type arg1 = Dimension::HEIGHT; @@ -8537,7 +10161,7 @@ int UtcDaliActorGetRelayoutSizeNegative(void) int UtcDaliActorGetResizePolicyNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { Dali::Dimension::Type arg1 = Dimension::ALL_DIMENSIONS; @@ -8554,7 +10178,7 @@ int UtcDaliActorGetResizePolicyNegative(void) int UtcDaliActorGetRendererCountNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.GetRendererCount(); @@ -8570,7 +10194,7 @@ int UtcDaliActorGetRendererCountNegative(void) int UtcDaliActorGetParentNegative(void) { TestApplication application; - Dali::Actor instance; + Dali::Actor instance; try { instance.GetParent(); @@ -8582,3 +10206,101 @@ int UtcDaliActorGetParentNegative(void) } END_TEST; } + +int UtcDaliActorPropertyBlendEquation(void) +{ + TestApplication application; + + tet_infoline("Test SetProperty AdvancedBlendEquation"); + + Geometry geometry = CreateQuadGeometry(); + Shader shader = CreateShader(); + Renderer renderer1 = Renderer::New(geometry, shader); + + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::OPACITY, 0.1f); + + actor.AddRenderer(renderer1); + actor.SetProperty(Actor::Property::SIZE, Vector2(400, 400)); + application.GetScene().Add(actor); + + if(!Dali::Capabilities::IsBlendEquationSupported(DevelBlendEquation::SCREEN)) + { + actor.SetProperty(Dali::DevelActor::Property::BLEND_EQUATION, Dali::DevelBlendEquation::SCREEN); + int equation = actor.GetProperty(Dali::DevelActor::Property::BLEND_EQUATION); + DALI_TEST_EQUALS((Dali::DevelBlendEquation::SCREEN == equation), false, TEST_LOCATION); + } + + if(Dali::Capabilities::IsBlendEquationSupported(DevelBlendEquation::SCREEN)) + { + actor.SetProperty(Dali::DevelActor::Property::BLEND_EQUATION, Dali::DevelBlendEquation::SCREEN); + int equation = actor.GetProperty(Dali::DevelActor::Property::BLEND_EQUATION); + DALI_TEST_EQUALS((Dali::DevelBlendEquation::SCREEN == equation), true, TEST_LOCATION); + } + + Renderer renderer2 = Renderer::New(geometry, shader); + actor.AddRenderer(renderer2); + + END_TEST; +} + +int UtcDaliActorRegisterProperty(void) +{ + tet_infoline("Test property registration and uniform map update\n"); + + TestApplication application; + + Geometry geometry = CreateQuadGeometry(); + Shader shader = CreateShader(); + Renderer renderer1 = Renderer::New(geometry, shader); + Renderer renderer2 = Renderer::New(geometry, shader); + + Actor actor1 = Actor::New(); + actor1.AddRenderer(renderer1); + actor1.SetProperty(Actor::Property::SIZE, Vector2(100, 100)); + actor1.RegisterProperty("uCustom", 1); + application.GetScene().Add(actor1); + + Actor actor2 = Actor::New(); + actor2.AddRenderer(renderer2); + actor2.SetProperty(Actor::Property::SIZE, Vector2(100, 100)); + application.GetScene().Add(actor2); + + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + TraceCallStack& callStack = glAbstraction.GetSetUniformTrace(); + glAbstraction.EnableSetUniformCallTrace(true); + + application.SendNotification(); + application.Render(); + + std::stringstream out; + out.str("1"); + std::string params; + + // Test uniform value of the custom property + DALI_TEST_CHECK(callStack.FindMethodAndGetParameters("uCustom", params)); + DALI_TEST_EQUALS(out.str(), params, TEST_LOCATION); + + // Make invisible + actor1[Actor::Property::VISIBLE] = false; + + application.SendNotification(); + application.Render(); + + // Make visible again + actor1[Actor::Property::VISIBLE] = true; + actor1["uCustom"] = 2; + + glAbstraction.ResetSetUniformCallStack(); + + application.SendNotification(); + application.Render(); + + out.str("2"); + + // The uniform value should not be changed + DALI_TEST_CHECK(callStack.FindMethodAndGetParameters("uCustom", params)); + DALI_TEST_EQUALS(out.str(), params, TEST_LOCATION); + + END_TEST; +}