Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-RenderTask.cpp
index e25bf6a..6c6197d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -390,20 +390,12 @@ int UtcDaliRenderTaskSetSourceActorP01(void)
   tet_infoline("Testing RenderTask::SetSourceActor() Positive - check that setting a non-renderable actor stops existing source actor being rendered ");
 
   Stage stage = Stage::GetCurrent();
-
-  const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-
   RenderTaskList taskList = stage.GetRenderTaskList();
-
   RenderTask task = taskList.GetTask( 0u );
 
   Actor actor = task.GetSourceActor();
   DALI_TEST_CHECK( actor );
 
-  std::vector<GLuint> ids;
-  ids.push_back( 7 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
   BufferImage img = BufferImage::New( 1,1 );
   Actor newActor = CreateRenderableActor( img );
   newActor.SetSize(1,1);
@@ -418,13 +410,17 @@ int UtcDaliRenderTaskSetSourceActorP01(void)
   DALI_TEST_CHECK( task.GetSourceActor() != actor );
   DALI_TEST_CHECK( task.GetSourceActor() == nonRenderableActor );
 
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& drawTrace = gl.GetDrawTrace();
+  drawTrace.Enable(true);
+
   // Update & Render nothing!
   application.GetGlAbstraction().ClearBoundTextures();
   application.SendNotification();
   application.Render();
 
   // Check that nothing was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
 
   END_TEST;
 }
@@ -438,8 +434,6 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
 
   Stage stage = Stage::GetCurrent();
 
-  const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-
   RenderTaskList taskList = stage.GetRenderTaskList();
 
   RenderTask task = taskList.GetTask( 0u );
@@ -447,9 +441,6 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
   Actor actor = task.GetSourceActor();
   DALI_TEST_CHECK( actor );
 
-  std::vector<GLuint> ids;
-  ids.push_back( 7 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
 
   BufferImage img = BufferImage::New( 1,1 );
   Actor newActor = CreateRenderableActor( img );
@@ -459,6 +450,10 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
   Actor nonRenderableActor = Actor::New();
   stage.Add( nonRenderableActor );
 
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& drawTrace = gl.GetDrawTrace();
+  drawTrace.Enable(true);
+
   // Stop the newActor from being rendered by changing the source actor
   DALI_TEST_CHECK( nonRenderableActor );
   task.SetSourceActor( nonRenderableActor );
@@ -471,7 +466,8 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
   application.Render();
 
   // Check that nothing was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
+  drawTrace.Reset();
 
   // Set newActor as the new source Actor
   task.SetSourceActor( newActor );
@@ -484,11 +480,7 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
   application.Render();
 
   // Check that the newActor was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 1u, TEST_LOCATION );
-  if ( boundTextures.size() )
-  {
-    DALI_TEST_EQUALS( boundTextures[0], 7u, TEST_LOCATION );
-  }
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
   END_TEST;
 }
 
@@ -499,20 +491,15 @@ int UtcDaliRenderTaskSetSourceActorOffStage(void)
   tet_infoline("Testing RenderTask::SetSourceActor (on/off stage testing)");
 
   Stage stage = Stage::GetCurrent();
-
-  const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-
   RenderTaskList taskList = stage.GetRenderTaskList();
-
   RenderTask task = taskList.GetTask( 0u );
 
   Actor actor = task.GetSourceActor();
   DALI_TEST_CHECK( actor );
 
-  std::vector<GLuint> ids;
-  GLuint expectedTextureId( 3 );
-  ids.push_back( expectedTextureId );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& drawTrace = gl.GetDrawTrace();
+  drawTrace.Enable(true);
 
   BufferImage img = BufferImage::New( 1,1 );
   Actor newActor = CreateRenderableActor( img );
@@ -521,12 +508,11 @@ int UtcDaliRenderTaskSetSourceActorOffStage(void)
   // Don't add newActor to stage yet   //'
 
   // Update & Render with the actor initially off-stage
-  application.GetGlAbstraction().ClearBoundTextures();
   application.SendNotification();
   application.Render();
 
   // Check that nothing was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
 
   // Now add to stage
   stage.Add( newActor );
@@ -537,19 +523,17 @@ int UtcDaliRenderTaskSetSourceActorOffStage(void)
   application.Render();
 
   // Check that the newActor was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 1u, TEST_LOCATION );
-  if ( boundTextures.size() )
-  {
-    DALI_TEST_EQUALS( boundTextures[0], expectedTextureId, TEST_LOCATION );
-  }
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
+  drawTrace.Reset();
 
   // Now remove from stage
   stage.Remove( newActor );
 
   // Update & Render with the actor off-stage
-  application.GetGlAbstraction().ClearBoundTextures();
   application.SendNotification();
   application.Render();
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -560,21 +544,12 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void)
   tet_infoline("Testing RenderTask::SetSourceActor (empty handle case)");
 
   Stage stage = Stage::GetCurrent();
-
-  const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-
   RenderTaskList taskList = stage.GetRenderTaskList();
-
   RenderTask task = taskList.GetTask( 0u );
 
   Actor actor = task.GetSourceActor();
   DALI_TEST_CHECK( actor );
 
-  std::vector<GLuint> ids;
-  GLuint expectedTextureId( 5 );
-  ids.push_back( expectedTextureId );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
   BufferImage img = BufferImage::New( 1,1 );
   Actor newActor = CreateRenderableActor( img );
   newActor.SetSize(1,1);
@@ -587,13 +562,16 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void)
   task.SetSourceActor( Actor() );
   DALI_TEST_CHECK( ! task.GetSourceActor() );
 
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& drawTrace = gl.GetDrawTrace();
+  drawTrace.Enable(true);
+
   // Update & Render nothing!
-  application.GetGlAbstraction().ClearBoundTextures();
   application.SendNotification();
   application.Render();
 
   // Check that nothing was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
 
   // Set with non-empty handle
   task.SetSourceActor( newActor );
@@ -605,11 +583,7 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void)
   application.Render();
 
   // Check that the newActor was rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 1u, TEST_LOCATION );
-  if ( boundTextures.size() )
-  {
-    DALI_TEST_EQUALS( boundTextures[0], expectedTextureId, TEST_LOCATION );
-  }
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
   END_TEST;
 }
 
@@ -696,11 +670,16 @@ int UtcDaliRenderTaskSetExclusive(void)
 
   // Check that the actor1 was rendered
   const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-  DALI_TEST_EQUALS( boundTextures.size(), 1u, TEST_LOCATION );
+  DALI_TEST_GREATER( boundTextures.size(), static_cast<std::vector<GLuint>::size_type>( 0 ), TEST_LOCATION );
 
   if ( boundTextures.size() )
   {
-    DALI_TEST_EQUALS( boundTextures[0], 8u/*unique to actor1*/, TEST_LOCATION );
+    int c = 0;
+    DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
+    if( boundTextures.size() > 1 )
+    {
+      DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
+    }
   }
 
   BufferImage img2 = BufferImage::New( 1,1 );
@@ -719,12 +698,17 @@ int UtcDaliRenderTaskSetExclusive(void)
   application.Render();
 
   // Check that the actors were rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 2u, TEST_LOCATION );
+  DALI_TEST_GREATER( boundTextures.size(), static_cast<std::vector<GLuint>::size_type>( 1 ), TEST_LOCATION );
 
   if ( boundTextures.size() )
   {
-    DALI_TEST_EQUALS( boundTextures[0], 9u/*unique to actor2*/, TEST_LOCATION );
-    DALI_TEST_EQUALS( boundTextures[1], 8u/*unique to actor1*/, TEST_LOCATION );
+    int c = 0;
+    DALI_TEST_EQUALS( boundTextures[c++], 9u/*unique to actor2*/, TEST_LOCATION );
+    if( boundTextures.size() > 2 )
+    {
+      DALI_TEST_EQUALS( boundTextures[c++], 9u/*unique to actor1*/, TEST_LOCATION );
+    }
+    DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
   }
 
   BufferImage img3 = BufferImage::New( 1,1 );
@@ -743,13 +727,18 @@ int UtcDaliRenderTaskSetExclusive(void)
   application.Render();
 
   // Check that the actors were rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 3u, TEST_LOCATION );
+  DALI_TEST_GREATER( boundTextures.size(), static_cast<std::vector<GLuint>::size_type>( 2 ), TEST_LOCATION );
 
   if ( boundTextures.size() )
   {
-    DALI_TEST_EQUALS( boundTextures[0], 10u/*unique to actor3*/, TEST_LOCATION );
-    DALI_TEST_EQUALS( boundTextures[1], 9u/*unique to actor2*/, TEST_LOCATION );
-    DALI_TEST_EQUALS( boundTextures[2], 8u/*unique to actor1*/, TEST_LOCATION );
+    int c = 0;
+    DALI_TEST_EQUALS( boundTextures[c++], 10u/*unique to actor3*/, TEST_LOCATION );
+    if( boundTextures.size() > 3 )
+    {
+      DALI_TEST_EQUALS( boundTextures[c++], 10u/*unique to actor2*/, TEST_LOCATION );
+    }
+    DALI_TEST_EQUALS( boundTextures[c++], 9u/*unique to actor2*/, TEST_LOCATION );
+    DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
   }
 
   // Both actors are now connected to the root node
@@ -1165,9 +1154,9 @@ int UtcDaliRenderTaskGetFrameBufferN(void)
 
   RenderTask task = taskList.GetTask( 0u );
 
-  // By default render-tasks do not render off-screen
+  // A scene creates frame buffer by default
   FrameBuffer frameBuffer = task.GetFrameBuffer();
-  DALI_TEST_CHECK( !frameBuffer );
+  DALI_TEST_CHECK( frameBuffer );
 
   END_TEST;
 }
@@ -1440,21 +1429,47 @@ 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( task.GetCurrentProperty< Vector2 >( 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( task.GetCurrentProperty< Vector2 >( 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( task.GetCurrentProperty< Vector2 >( 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( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
+  // Create another animation which animates by a certain value
+  const Vector2 newPosition4( 75.0f, 45.0f );
+  const Vector2 relativePosition( newPosition4 - newPosition3 );
+  animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( task, RenderTask::Property::VIEWPORT_POSITION ), relativePosition );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition3, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( task.GetCurrentViewportPosition(), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_POSITION ), newPosition4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1488,21 +1503,46 @@ 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( task.GetCurrentProperty< Vector2 >( 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( task.GetCurrentProperty< Vector2 >( 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( task.GetCurrentProperty< Vector2 >( 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( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE  ), newSize3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
+  // Create another animation which animates by a certain value
+  const Vector2 newSize4( 75.0f, 45.0f );
+  const Vector2 relativeSize( newSize4 - newSize3 );
+  animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( task, RenderTask::Property::VIEWPORT_SIZE ), relativeSize );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize3, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( task.GetCurrentViewportSize(), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector2 >( RenderTask::Property::VIEWPORT_SIZE ), newSize4, Math::MACHINE_EPSILON_1, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1529,11 +1569,44 @@ 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( task.GetCurrentProperty< Vector4 >( 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( task.GetCurrentProperty< Vector4 >( 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( task.GetCurrentProperty< Vector4 >( 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( task.GetCurrentProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR  ), newColor3, Math::MACHINE_EPSILON_1, TEST_LOCATION );
+
+  // Create another animation which animates by a certain value
+  const Vector4 newColor4( 0.45f, 0.35f, 0.25f, 0.1f );
+  const Vector4 relativeColor( newColor4 - newColor3 );
+  animation = Animation::New( 1.0f );
+  animation.AnimateBy( Property( task, RenderTask::Property::CLEAR_COLOR ), relativeColor );
+  animation.Play();
+
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor4, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor3, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+
+  // Perform 1000ms worth of updates at which point animation should have completed.
+  Wait(application, 1000);
+  DALI_TEST_EQUALS( task.GetCurrentProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor4, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+  DALI_TEST_EQUALS( task.GetProperty< Vector4 >( RenderTask::Property::CLEAR_COLOR ), newColor4, Math::MACHINE_EPSILON_10, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1856,7 +1929,7 @@ int UtcDaliRenderTaskContinuous01(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
@@ -1894,7 +1967,7 @@ int UtcDaliRenderTaskContinuous02(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
@@ -1934,7 +2007,7 @@ int UtcDaliRenderTaskContinuous03(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
 
@@ -1972,7 +2045,7 @@ int UtcDaliRenderTaskContinuous04(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorFailed(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2003,7 +2076,7 @@ int UtcDaliRenderTaskOnce01(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
 
@@ -2041,7 +2114,7 @@ int UtcDaliRenderTaskOnce02(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2089,7 +2162,7 @@ int UtcDaliRenderTaskOnce03(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2134,7 +2207,7 @@ int UtcDaliRenderTaskOnce04(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2186,7 +2259,7 @@ int UtcDaliRenderTaskOnceNoSync01(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2216,7 +2289,7 @@ int UtcDaliRenderTaskOnceNoSync02(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2260,7 +2333,7 @@ int UtcDaliRenderTaskOnceNoSync03(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2297,7 +2370,7 @@ int UtcDaliRenderTaskOnceNoSync04(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2352,7 +2425,7 @@ int UtcDaliRenderTaskOnceNoSync05(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorFailed(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2392,7 +2465,7 @@ int UtcDaliRenderTaskOnceChain01(void)
   Actor defaultRootActor = Actor::New(); // Root for default RT
   Stage::GetCurrent().Add( defaultRootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor firstRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(firstRootActor);
@@ -2414,15 +2487,14 @@ int UtcDaliRenderTaskOnceChain01(void)
 
   application.SendNotification();
 
+  //Both render tasks are executed.
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,  firstFinished, false, true, __LINE__ ) );
   DALI_TEST_CHECK( firstFinished == false );
   DALI_TEST_CHECK( secondFinished == false );
 
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,  firstFinished, true, true, __LINE__ ) );
+  //Nothing else to render and both render task should have finished now
+  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,  firstFinished, true, false, __LINE__ ) );
   DALI_TEST_CHECK( firstFinished == true );
-  DALI_TEST_CHECK( secondFinished == false );
-
-  DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,  secondFinished, true, false, __LINE__ ) );
   DALI_TEST_CHECK( secondFinished == true );
 
   END_TEST;
@@ -2641,7 +2713,7 @@ int UtcDaliRenderTaskFinishMissingImage(void)
 
 int UtcDaliRenderTaskWorldToViewport(void)
 {
-  TestApplication application( static_cast<size_t>(400), static_cast<size_t>(400) ); // square surface
+  TestApplication application( 400u, 400u ); // square surface
 
   RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
 
@@ -2734,3 +2806,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( newTask.GetCurrentProperty< bool >( 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( newTask.GetCurrentProperty< bool >( RenderTask::Property::REQUIRES_SYNC ), true, TEST_LOCATION );
+
+  END_TEST;
+}