- // CHANGE TO RENDER ONCE,
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
-
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
- END_TEST;
-}
-
-int UtcDaliRenderTaskOnce06(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once GLSync\n"
- "Render once, Call to SetRefreshRate(ONCE) in Finished signal callback triggers "
- "another render & another finished signal\n"
- "PRE: Everything ready\n"
- "POST: exactly 1 finished signal per call to SetRefreshRate(ONCE)");
-
-
- // SETUP A CONTINUOUS 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 );
- ImageActor secondRootActor = 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;
- CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
- application.Render();
- application.GetPlatform().ClearReadyResources();
-
- Stage::GetCurrent().Add(secondRootActor);
-
- RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
- bool finished = false;
-
- ConnectionTracker connectionTracker;
- RenderTaskFinishedRenderAgain renderTaskFinishedRenderAgain( finished );
- newTask.FinishedSignal().Connect( &connectionTracker, renderTaskFinishedRenderAgain );
-
- application.SendNotification();
-
- // START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
- Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj == NULL );
-
- // CHANGE TO RENDER ONCE,
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
-
- sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
- application.SendNotification();
-
- // Expect SetRefreshRate to have been called again
- // Prevent next finished signal calling refresh once again
- RenderTaskFinished renderTaskFinished( finished );
- connectionTracker.DisconnectAll();
- newTask.FinishedSignal().Connect( &connectionTracker, renderTaskFinished );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
- END_TEST;
-}
-
-
-int UtcDaliRenderTaskOnce07(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once GlSync\n"
- "SetRefreshRate(ONCE) again before first finished signal has been sent.\n"
- "PRE: resources ready\n"
- "POST: Only 1 finished signal sent.");
-
- // SETUP A CONTINUOUS 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 );
- ImageActor secondRootActor = 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;
- CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
- application.Render();
- application.GetPlatform().ClearReadyResources();
-
- 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, true, finished, false, false ) );
-
- // CHANGE TO RENDER ONCE,
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
-
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
-
- END_TEST;
-}
-
-
-
-int UtcDaliRenderTaskOnce08(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once GlSync\n"
- "SetRefreshRate(ONCE), resource load failed completes render task.\n"
- "PRE: resources not ready\n"
- "POST: Only 1 finished signal sent.");
-
- // SETUP A CONTINUOUS 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 );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
- Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
- Integration::ResourceId imageRequestId = imageRequest->GetId();
- 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
-
- // CHANGE TO RENDER ONCE,
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
-
- tet_printf(" FailImageLoad\n");
-
- FailImageLoad(application, imageRequestId); // Need to run Update again for this to complete
-
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) ); // nothing to draw
- application.SendNotification();
-
- // Drawing empty framebuffer, so will still get a GL sync
- Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- sync.SetObjectSynced( lastSyncObj, true );
-
- // Expect finished signal, as all resources are complete
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
-
- END_TEST;
-}
-
-
-
-int UtcDaliRenderTaskOnceNoSync01(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once, using loading image\nPRE: Resources not ready, Source not visible\nPOST: Finished signal sent once only");