+
+int UtcDaliRenderTaskOffscreenViewportToLocal(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+ actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ actor.SetSize( 100.0f, 100.0f );
+ actor.SetPosition( 10.0f, 10.0f );
+ Stage::GetCurrent().Add( actor );
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.CreateTask();
+
+ FrameBufferImage newFrameBuffer = FrameBufferImage::New( 10, 10 );
+ task.SetTargetFrameBuffer( newFrameBuffer );
+ task.SetSourceActor( actor );
+ task.SetScreenToFrameBufferMappingActor( actor );
+
+ CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
+ Stage::GetCurrent().Add( offscreenCameraActor );
+ task.SetCameraActor( offscreenCameraActor );
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+ application.Render();
+
+ float localX;
+ float localY;
+
+ float rtLocalX;
+ float rtLocalY;
+
+ float screenX = 50.0f;
+ float screenY = 50.0f;
+
+ DALI_TEST_CHECK( actor.ScreenToLocal(localX, localY, screenX, screenY) );
+
+ DALI_TEST_CHECK( task.ViewportToLocal(actor, screenX, screenY, rtLocalX, rtLocalY ) );
+
+ DALI_TEST_EQUALS(localX, rtLocalX, 0.01f, TEST_LOCATION);
+ DALI_TEST_EQUALS(localY, rtLocalY, 0.01f, TEST_LOCATION);
+
+ 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;
+}
+
+int UtcDaliRenderTaskSetClearEnabled(void)
+{
+ TestApplication application;
+
+ tet_infoline("UtcDaliRenderTaskSetClearEnabled");
+
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+
+ Actor renderableActor = CreateRenderableActorSuccess( application, "aFile.jpg" );
+ Stage::GetCurrent().Add( renderableActor );
+
+ Actor rootActor = Actor::New();
+ Stage::GetCurrent().Add( rootActor );
+
+ CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
+ Stage::GetCurrent().Add( offscreenCameraActor );
+
+ Actor sourceActor = CreateRenderableActorSuccess( application, "aFile.jpg" );
+ Stage::GetCurrent().Add( sourceActor );
+
+ RenderTask newTask = CreateRenderTask( application, offscreenCameraActor, rootActor, sourceActor, RenderTask::REFRESH_ALWAYS, false );
+
+ DALI_TEST_EQUALS( gl.GetClearCountCalled(), 0, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ // glClear should be called twice - default task and the new task.
+ DALI_TEST_EQUALS( gl.GetClearCountCalled(), 2, TEST_LOCATION );
+
+ newTask.SetClearEnabled( false );
+
+ application.SendNotification();
+ application.Render();
+
+ // The count should increase by 1 - default task only.
+ DALI_TEST_EQUALS( gl.GetClearCountCalled(), 3, TEST_LOCATION );
+
+ END_TEST;
+}