X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-RenderTask.cpp;h=7e9ad26bf95cbd06010fa85984cd342ebee6214d;hb=462cbee2270984cdca45488f3733d664dcf49187;hp=439a451d0a94445b95d5c96ea3c83cf73e05f176;hpb=a6abdf9eff55d985a6d90e74aae7d122066fc635;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-RenderTask.cpp b/automated-tests/src/dali/utc-Dali-RenderTask.cpp index 439a451..7e9ad26 100644 --- a/automated-tests/src/dali/utc-Dali-RenderTask.cpp +++ b/automated-tests/src/dali/utc-Dali-RenderTask.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1414,21 +1415,30 @@ int UtcDaliRenderTaskSetViewportPosition(void) // Set by Property test Vector2 newPosition2(32.0f, 32.0f); task.SetProperty( RenderTask::Property::VIEWPORT_POSITION, newPosition2 ); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition2, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition, TEST_LOCATION ); // still the old position // Update application.SendNotification(); application.Render(); DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition2, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition2, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition2, TEST_LOCATION ); Vector2 newPosition3(64.0f, 0.0f); Animation animation = Animation::New(1.0f); animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, AlphaFunction::LINEAR ); animation.Play(); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition2, TEST_LOCATION ); + // Perform 1000ms worth of updates at which point animation should have completed. Wait(application, 1000); DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); END_TEST; } @@ -1462,21 +1472,30 @@ int UtcDaliRenderTaskSetViewportSize(void) // Set by Property test Vector2 newSize2(50.0f, 50.0f); task.SetProperty( RenderTask::Property::VIEWPORT_SIZE, newSize2 ); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize2, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize, TEST_LOCATION ); // still the old position // Update application.SendNotification(); application.Render(); DALI_TEST_EQUALS( task.GetCurrentViewportSize(), newSize2, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize2, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize2, TEST_LOCATION ); Vector2 newSize3(10.0f, 10.0f); Animation animation = Animation::New(1.0f); animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, AlphaFunction::LINEAR ); animation.Play(); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize2, TEST_LOCATION ); + // Perform 1000ms worth of updates at which point animation should have completed. Wait(application, 1000); DALI_TEST_EQUALS( task.GetCurrentViewportSize(), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector2 >( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); END_TEST; } @@ -1503,11 +1522,29 @@ int UtcDaliRenderTaskSetClearColorP(void) DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION ); task.SetProperty( RenderTask::Property::CLEAR_COLOR, testColor2 ); + DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor, TEST_LOCATION ); // still the old color // Wait a frame. Wait(application); DALI_TEST_EQUALS( task.GetClearColor(), testColor2, TEST_LOCATION ); + DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION ); + + Vector4 newColor3(10.0f, 10.0f, 20.0f, 30.0f); + Animation animation = Animation::New(1.0f); + animation.AnimateTo( Property( task, RenderTask::Property::CLEAR_COLOR ), newColor3, AlphaFunction::LINEAR ); + animation.Play(); + + DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), testColor2, TEST_LOCATION ); + + // Perform 1000ms worth of updates at which point animation should have completed. + Wait(application, 1000); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< Vector4 >( task, RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION ); + END_TEST; } @@ -2707,3 +2744,22 @@ int UtcDaliRenderTaskViewportToLocal(void) END_TEST; } + +int UtcDaliRenderTaskRequiresSync(void) +{ + TestApplication application; + RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList(); + + RenderTask newTask = taskList.CreateTask(); + newTask.SetProperty( RenderTask::Property::REQUIRES_SYNC, false ); + + DALI_TEST_EQUALS( newTask.GetProperty< bool >( RenderTask::Property::REQUIRES_SYNC ), false, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( newTask, RenderTask::Property::REQUIRES_SYNC ), false, TEST_LOCATION ); + + newTask.SetProperty( RenderTask::Property::REQUIRES_SYNC, true ); + + DALI_TEST_EQUALS( newTask.GetProperty< bool >( RenderTask::Property::REQUIRES_SYNC ), true, TEST_LOCATION ); + DALI_TEST_EQUALS( DevelHandle::GetCurrentProperty< bool >( newTask, RenderTask::Property::REQUIRES_SYNC ), true, TEST_LOCATION ); + + END_TEST; +}