+ // CONTINUE PROCESS/RENDER Input, Expected Input, Expected
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskContinuous04(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask Render Continuous using loading image\nPRE: Resource not ready\nPOST:continuous renders, no Finished signal");
+
+ // SETUP AN OFFSCREEN RENDER TASK
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor rootActor = Actor::New();
+ Stage::GetCurrent().Add( rootActor );
+
+ CameraActor offscreenCameraActor = CameraActor::New();
+ Stage::GetCurrent().Add( offscreenCameraActor );
+ Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
+ Integration::ResourceId imageRequestId = imageRequest->GetId();
+ Integration::ResourceTypeId imageType = imageRequest->GetType()->id;
+ Stage::GetCurrent().Add(secondRootActor);
+
+ RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
+ bool finished = false;
+ RenderTaskFinished renderTaskFinished( finished );
+ newTask.FinishedSignal().Connect( &application, renderTaskFinished );
+ application.SendNotification();
+
+ // START PROCESS/RENDER Input, Expected Input, Expected
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
+ // FINISH RESOURCE LOADING - expect 'continuous' renders to start, no finished signal
+ CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskContinous05(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask Render Continuous using Mesh which accesses texture through sampler with loading image\n"
+ "PRE: Resource not ready\nPOST:continuous renders, no Finished signal");
+
+ // SETUP AN OFFSCREEN RENDER TASK
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor rootActor = Actor::New();
+ Stage::GetCurrent().Add( rootActor );
+
+ CameraActor offscreenCameraActor = CameraActor::New();
+ Stage::GetCurrent().Add( offscreenCameraActor );
+
+ Shader shader = CreateShader();
+
+
+ Image image = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
+ Integration::ResourceId imageRequestId = imageRequest->GetId();
+ Integration::ResourceTypeId imageType = imageRequest->GetType()->id;
+ TextureSet textureSet = CreateTextureSet( image );
+
+ Geometry geometry = Geometry::QUAD();
+ Renderer renderer = Renderer::New(geometry, shader);
+ renderer.SetTextures( textureSet );
+ Actor secondRootActor = Actor::New();
+ secondRootActor.AddRenderer(renderer);
+ secondRootActor.SetSize(100, 100);
+ Stage::GetCurrent().Add(secondRootActor);
+
+ RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
+ bool finished = false;
+ RenderTaskFinished renderTaskFinished( finished );
+ newTask.FinishedSignal().Connect( &application, renderTaskFinished );
+ application.SendNotification();
+
+ // START PROCESS/RENDER Input, Expected Input, Expected
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
+ // FINISH RESOURCE LOADING - expect 'continuous' renders to start, no finished signal
+ CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
+
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskOnce01(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask Render Once GlSync, using loading image\nPRE: Resources not ready, Source not visible\nPOST: Finished signal sent once only");
+
+ // SETUP AN OFFSCREEN RENDER TASK
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+ TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor rootActor = Actor::New();
+ Stage::GetCurrent().Add( rootActor );
+
+ CameraActor offscreenCameraActor = CameraActor::New();
+ Stage::GetCurrent().Add( offscreenCameraActor );
+ Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
+ Integration::ResourceId imageRequestId = imageRequest->GetId();
+ Integration::ResourceTypeId imageType = imageRequest->GetType()->id;
+
+ Stage::GetCurrent().Add(secondRootActor);
+
+ RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, true);
+ bool finished = false;
+ RenderTaskFinished renderTaskFinished( finished );
+ newTask.FinishedSignal().Connect( &application, renderTaskFinished );
+ application.SendNotification();
+
+ // START PROCESS/RENDER Input, Expected Input, Expected
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
+ // MAKE SOURCE VISIBLE
+ secondRootActor.SetVisible(true);
+ application.SendNotification();
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
+ // FINISH RESOURCE LOADING - expect no rendering yet
+ CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
+ DALI_TEST_CHECK( lastSyncObj != NULL );
+
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ application.GetPlatform().ClearReadyResources();
+ sync.SetObjectSynced( lastSyncObj, true );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );