- DALI_TEST_CHECK( lastSyncObj != NULL );
-
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
- sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
-
- END_TEST;
-}
-
-int UtcDaliRenderTaskOnce10(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 );
- 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 = CreateLoadingImageActor(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, false);
- 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__ ) );
-
- // CHANGE TO RENDER ONCE,
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
-
- 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, __LINE__ ) ); // nothing to draw
- application.SendNotification();
-
- // load is now failed so there's nothing more to render in the render task
- // Expect finished signal, as all resources are complete
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
-
- 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");
-
- // 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 );
- ImageActor secondRootActor = CreateLoadingImageActor(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, false);
- 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 immediate 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__ ) );
- application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
- END_TEST;
-}
-
-int UtcDaliRenderTaskOnceNoSync02(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once, using Mesh which accesses texture through sampler with loading image.\n"
- "PRE: Resources not ready\nPOST: Finished signal sent once only");
- // 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 );
-
- Material material = CreateMaterial();
- 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;
- material.AddTexture(image, "sTexture" );
-
- Geometry geometry = CreateQuadGeometry();
- Renderer renderer = Renderer::New(geometry, material);
- Actor secondRootActor = Actor::New();
- secondRootActor.AddRenderer(renderer);
- secondRootActor.SetSize(100, 100);
- Stage::GetCurrent().Add(secondRootActor);
-
- RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, false);
- 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 immediate 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__ ) );
- application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
-
- END_TEST;
-}
-
-int UtcDaliRenderTaskOnceNoSync03(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once, using loading image. Switch from render always after ready to render once\n"
- "PRE: Render task ready, Image not loaded\n"
- "POST: Finished signal sent only once");
-
- // SETUP A CONTINUOUS 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 );
- ImageActor secondRootActor = CreateLoadingImageActor(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, false);
- 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
- CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
- application.GetPlatform().ClearReadyResources();
-
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification(); // Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
- END_TEST;
-}
-
-int UtcDaliRenderTaskOnceNoSync04(void)
-{
- TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once, using Mesh which accesses texture through sampler with loading image.\n"
- "Switch from render always after ready to render once\n"
- "PRE: Render task ready, Image not loaded\n"
- "POST: Finished signal sent only once");
-
- // SETUP A CONTINUOUS 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 );
-
- Material material = CreateMaterial();
- 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;
- material.AddTexture( image, "sTexture" );
-
- Geometry geometry = CreateQuadGeometry();
- Renderer renderer = Renderer::New(geometry, material);
- 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, false);
- 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__ ) );
-
- TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
- Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj == NULL );
-
- // FINISH RESOURCE LOADING
- CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
- application.GetPlatform().ClearReadyResources();
-
- lastSyncObj = sync.GetLastSyncObject();
- DALI_TEST_CHECK( lastSyncObj == NULL );
-
- newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
- application.SendNotification(); // Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );