#include <stdlib.h>
#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/events/hit-test-algorithm.h>
#include <dali-test-suite-utils.h>
#include <dali/integration-api/debug.h>
#include <test-native-image.h>
+#include <mesh-builder.h>
+
#define BOOLSTR(x) ((x)?"T":"F")
+//& set: DaliRenderTask
using namespace Dali;
test_return_value = TET_PASS;
}
+/**
+ * APIs:
+ *
+ * Constructor, Destructor, DownCast, New, copy constructor, assignment operator
+ *
+ * SetSourceActor 2+ve, 1-ve
+ * GetSourceActor 1+ve, 1-ve
+ * SetExclusive 2+ve, 0-ve
+ * IsExclusive 2+ve, 0-ve
+ * SetInputEnabled 1+ve, 0-ve
+ * GetInputEnabled 1+ve, 0-ve
+ * SetCameraActor 1+ve, 1-ve
+ * GetCameraActor 1+ve, 1-ve
+ * SetTargetFrameBuffer 1+ve, 1-ve
+ * GetTargetFrameBuffer 1+ve, 1-ve
+ * SetScreenToFrameBufferFunction 1+ve, 1-ve
+ * GetScreenToFrameBufferFunction 1+ve, 1-ve
+ * SetScreenToFrameBufferMappingActor 1+ve, 1-ve
+ * GetScreenToFrameBufferMappingActor 1+ve, 1-ve
+ * SetViewportPosition 1+ve
+ * GetCurrentViewportPosition 1+ve
+ * SetViewportSize 1+ve
+ * GetCurrentViewportSize 1+ve
+ * SetViewport 2+ve, 1-ve
+ * GetViewport 2+ve, 1-ve
+ * SetClearColor 1+ve, 1-ve
+ * GetClearColor 1+ve, 1-ve
+ * SetClearEnabled 1+ve, 1-ve
+ * GetClearEnabled 1+ve, 1-ve
+ * SetCullMode
+ * GetCullMode
+ * SetRefreshRate Many
+ * GetRefreshRate 1+ve
+ * FinishedSignal 1+ve
+ */
+
namespace // unnamed namespace
{
return true;
}
-ImageActor CreateLoadingImage(TestApplication& application, std::string filename, ResourceImage::LoadPolicy loadPolicy, Image::ReleasePolicy releasePolicy)
+Actor CreateLoadingActor(TestApplication& application, std::string filename, ResourceImage::LoadPolicy loadPolicy, Image::ReleasePolicy releasePolicy)
{
Image image = ResourceImage::New(filename, loadPolicy, releasePolicy);
DALI_TEST_CHECK( image );
application.SendNotification();
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
- ImageActor actor = ImageActor::New(image);
+ Actor actor = CreateRenderableActor(image);
actor.SetSize( 80, 80 );
application.SendNotification();
application.Render(16);
return actor;
}
+Image CreateLoadingImage(TestApplication& application, std::string filename, ResourceImage::LoadPolicy loadPolicy, Image::ReleasePolicy releasePolicy)
+{
+ Image image = ResourceImage::New(filename, loadPolicy, releasePolicy);
+ DALI_TEST_CHECK( image );
+ application.SendNotification();
+ application.Render(16);
+ DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
+
+ return image;
+}
+
void CompleteImageLoad(TestApplication& application, Integration::ResourceId resourceId, Integration::ResourceTypeId requestType)
{
std::vector<GLuint> ids;
ids.push_back( 23 );
application.GetGlAbstraction().SetNextTextureIds( ids );
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::DISCARD );
+ Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
Integration::ResourcePointer resource(bitmap);
bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, 80, 80, 80, 80);
frameBufferImage = FrameBufferImage::New( 10, 10 );
}
- // Don't draw output framebuffer
+ // Don't draw output framebuffer // '
RenderTask newTask = taskList.CreateTask();
newTask.SetCameraActor( offscreenCamera );
newTask.SetExclusive( true );
newTask.SetRefreshRate( refreshRate );
newTask.SetTargetFrameBuffer( frameBufferImage );
+ newTask.SetProperty( RenderTask::Property::REQUIRES_SYNC, glSync );
return newTask;
}
-bool UpdateRender(TestApplication& application, TraceCallStack& callStack, bool testDrawn, bool& finishedSig, bool testFinished, bool testKeepUpdating )
+bool UpdateRender(TestApplication& application, TraceCallStack& callStack, bool testDrawn, bool& finishedSig, bool testFinished, bool testKeepUpdating, int lineNumber )
{
finishedSig = false;
callStack.Reset();
+
+ tet_printf("TestApplication::UpdateRender().\n");
+
application.Render(16);
application.SendNotification();
bool result = (sigPassed && drawPassed && keepUpdatingPassed);
- tet_printf("UpdateRender: Expected: Draw:%s Signal:%s Keep Updating: %s Actual: Draw:%s Signal:%s KeepUpdating: %s %s\n",
+ tet_printf("UpdateRender: Expected: Draw:%s Signal:%s KeepUpdating: %s Actual: Draw:%s Signal:%s KeepUpdating: %s %s, line %d\n",
BOOLSTR(testDrawn), BOOLSTR(testFinished), BOOLSTR(testKeepUpdating),
BOOLSTR(drawResult), BOOLSTR(finishedSig), BOOLSTR(keepUpdating),
- result ? "Passed":"Failed");
+ result ? "Passed":"Failed",
+ lineNumber );
return result;
}
{
// Check whether the actor is visible and not fully transparent.
if( actor.IsVisible()
- && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT
+ && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT
{
- hittable = true;
+ hittable = true;
}
break;
}
/****************************************************************************************************/
/****************************************************************************************************/
-int UtcDaliRenderTaskDownCast(void)
+int UtcDaliRenderTaskDownCast01(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliRenderTaskSetSourceActor(void)
+int UtcDaliRenderTaskDownCast02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::DownCast()");
+
+ Actor actor = Actor::New();
+
+ RenderTask task = RenderTask::DownCast( actor );
+ DALI_TEST_CHECK( ! task );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskSetSourceActorN(void)
+{
+ TestApplication application;
+ tet_infoline("Testing RenderTask::SetSourceActor() Negative - try with empty actor handle");
+ Stage stage = Stage::GetCurrent();
+
+ Actor srcActor;
+
+ RenderTaskList taskList = stage.GetRenderTaskList();
+ RenderTask renderTask = taskList.CreateTask();
+ renderTask.SetSourceActor(srcActor);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK( ! renderTask.GetSourceActor() );
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskSetSourceActorP01(void)
+{
+ TestApplication application;
+
+ 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);
+ stage.Add( newActor );
+
+ Actor nonRenderableActor = Actor::New();
+ stage.Add( nonRenderableActor );
+
+ // Stop the newActor from being rendered by changing the source actor
+ DALI_TEST_CHECK( nonRenderableActor );
+ task.SetSourceActor( nonRenderableActor );
+ DALI_TEST_CHECK( task.GetSourceActor() != actor );
+ DALI_TEST_CHECK( task.GetSourceActor() == nonRenderableActor );
+
+ // Update & Render nothing!
+ application.GetGlAbstraction().ClearBoundTextures();
+ application.SendNotification();
+ application.Render();
+
+ // Check that nothing was rendered
+ DALI_TEST_EQUALS( boundTextures.size(), 0u, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskSetSourceActorP02(void)
{
TestApplication application;
- tet_infoline("Testing RenderTask::SetSourceActor()");
+ tet_infoline("Testing RenderTask::SetSourceActor() Positive - check that switching source from a non-renderable to a renderable actor causes the texture to be drawn");
Stage stage = Stage::GetCurrent();
application.GetGlAbstraction().SetNextTextureIds( ids );
BufferImage img = BufferImage::New( 1,1 );
- ImageActor newActor = ImageActor::New( img );
+ Actor newActor = CreateRenderableActor( img );
newActor.SetSize(1,1);
stage.Add( newActor );
application.GetGlAbstraction().SetNextTextureIds( ids );
BufferImage img = BufferImage::New( 1,1 );
- ImageActor newActor = ImageActor::New( img );
+ Actor newActor = CreateRenderableActor( img );
newActor.SetSize(1,1);
task.SetSourceActor( newActor );
- // Don't add newActor to stage yet
+ // Don't add newActor to stage yet //'
// Update & Render with the actor initially off-stage
application.GetGlAbstraction().ClearBoundTextures();
application.GetGlAbstraction().SetNextTextureIds( ids );
BufferImage img = BufferImage::New( 1,1 );
- ImageActor newActor = ImageActor::New( img );
+ Actor newActor = CreateRenderableActor( img );
newActor.SetSize(1,1);
stage.Add( newActor );
END_TEST;
}
-int UtcDaliRenderTaskGetSourceActor(void)
+int UtcDaliRenderTaskGetSourceActorP01(void)
{
TestApplication application;
- tet_infoline("Testing RenderTask::GetSourceActor()");
+ tet_infoline("Testing RenderTask::GetSourceActor() Check the default render task has a valid source actor");
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
END_TEST;
}
+int UtcDaliRenderTaskGetSourceActorP02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetSourceActor() Create a new render task, Add a new actor to the stage and set it as the source of the new render task. Get its source actor and check that it is equivalent to what was set.");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.CreateTask();
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+ task.SetSourceActor( actor );
+
+ DALI_TEST_EQUALS( actor, task.GetSourceActor(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetSourceActorN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetSourceActor() Try with empty handle");
+
+ RenderTask task;
+ try
+ {
+ Actor actor = task.GetSourceActor();
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+
+ END_TEST;
+}
+
int UtcDaliRenderTaskSetExclusive(void)
{
TestApplication application;
- tet_infoline("Testing RenderTask::SetExclusive()");
+ tet_infoline("Testing RenderTask::SetExclusive() Check that exclusion works");
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
- // Manipulate the GenTextures behaviour, to identify different ImageActors
+ // Manipulate the GenTextures behaviour, to identify different actors
std::vector<GLuint> ids;
ids.push_back( 8 ); // 8 = actor1
application.GetGlAbstraction().SetNextTextureIds( ids );
BufferImage img1 = BufferImage::New( 1,1 );
- ImageActor actor1 = ImageActor::New( img1 );
+ Actor actor1 = CreateRenderableActor( img1 );
actor1.SetSize(1,1);
Stage::GetCurrent().Add( actor1 );
}
BufferImage img2 = BufferImage::New( 1,1 );
- ImageActor actor2 = ImageActor::New( img2 );
+ Actor actor2 = CreateRenderableActor( img2 );
actor2.SetSize(1,1);
// Force actor2 to be rendered before actor1
}
BufferImage img3 = BufferImage::New( 1,1 );
- ImageActor actor3 = ImageActor::New( img3 );
+ Actor actor3 = CreateRenderableActor( img3 );
actor3.SetSize(1,1);
// Force actor3 to be rendered before actor2
END_TEST;
}
-int UtcDaliRenderTaskIsExclusive(void)
+int UtcDaliRenderTaskSetExclusive02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetExclusive() Check that changing from exclusive to not-exclusive works");
+
+ std::vector<GLuint> ids;
+ ids.push_back( 8 ); // 8 = actor1
+ application.GetGlAbstraction().SetNextTextureIds( ids );
+
+ BufferImage img1 = BufferImage::New( 1,1 );
+ Actor actor1 = CreateRenderableActor( img1 );
+ actor1.SetSize(1,1);
+ Stage::GetCurrent().Add( actor1 );
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.CreateTask();
+
+ task.SetSourceActor( actor1 );
+ task.SetExclusive(true); // Actor should only render once
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
+ drawTrace.Enable(true);
+
+ // Update & Render actor1
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( drawTrace.CountMethod("DrawArrays"), 1, TEST_LOCATION );
+
+ // Set task to non-exclusive - actor1 should render twice:
+ drawTrace.Reset();
+ task.SetExclusive(false);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( drawTrace.CountMethod("DrawArrays"), 2, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskSetExclusiveN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetExclusive() on empty handle");
+
+ RenderTask task;
+ try
+ {
+ task.SetExclusive(true);
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskIsExclusive01(void)
{
TestApplication application;
- tet_infoline("Testing RenderTask::IsExclusive()");
+ tet_infoline("Testing RenderTask::IsExclusive() Check default values are non-exclusive");
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
RenderTask newTask = taskList.CreateTask();
DALI_TEST_CHECK( false == newTask.IsExclusive() );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskIsExclusive02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::IsExclusive() Check the getter returns set values");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+
+ // Not exclusive is the default
+ RenderTask newTask = taskList.CreateTask();
+ DALI_TEST_EQUALS( newTask.IsExclusive(), false, TEST_LOCATION );
+
+ newTask.SetExclusive(true);
+ DALI_TEST_EQUALS( newTask.IsExclusive(), true, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskIsExclusiveN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::IsExclusive() on empty handle");
+
+ RenderTask task;
+ try
+ {
+ bool x = task.IsExclusive();
+ x=x;
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
END_TEST;
}
// Input is enabled by default
RenderTask task = taskList.GetTask( 0u );
- DALI_TEST_CHECK( true == task.GetInputEnabled() );
+ DALI_TEST_EQUALS( true, task.GetInputEnabled(), TEST_LOCATION );
RenderTask newTask = taskList.CreateTask();
- DALI_TEST_CHECK( true == newTask.GetInputEnabled() );
+ DALI_TEST_EQUALS( true, newTask.GetInputEnabled(), TEST_LOCATION );
+
+ newTask.SetInputEnabled(false);
+ DALI_TEST_EQUALS( false, newTask.GetInputEnabled(), TEST_LOCATION );
+
END_TEST;
}
-int UtcDaliRenderTaskSetCameraActor(void)
+int UtcDaliRenderTaskSetCameraActorP(void)
{
TestApplication application;
RenderTask task = taskList.GetTask( 0u );
+ Actor defaultCameraActor = task.GetCameraActor();
+ DALI_TEST_CHECK( defaultCameraActor );
+
+ CameraActor newCameraActor = CameraActor::New();
+ DALI_TEST_CHECK( newCameraActor );
+
+ task.SetCameraActor( newCameraActor );
+ DALI_TEST_CHECK( task.GetCameraActor() != defaultCameraActor );
+ DALI_TEST_EQUALS( task.GetCameraActor(), newCameraActor, TEST_LOCATION );
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskSetCameraActorN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetCameraActor() with empty actor handle");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+
+ RenderTask task = taskList.GetTask( 0u );
+
Actor actor = task.GetCameraActor();
DALI_TEST_CHECK( actor );
- CameraActor newActor = CameraActor::New();
- DALI_TEST_CHECK( newActor );
+ CameraActor cameraActor;
- task.SetCameraActor( newActor );
- DALI_TEST_CHECK( task.GetCameraActor() != actor );
- DALI_TEST_CHECK( task.GetCameraActor() == newActor );
+ task.SetCameraActor( cameraActor );
+ DALI_TEST_EQUALS( (bool)task.GetCameraActor(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( task.GetCameraActor(), cameraActor, TEST_LOCATION );
END_TEST;
}
-int UtcDaliRenderTaskGetCameraActor(void)
+
+int UtcDaliRenderTaskGetCameraActorP(void)
{
TestApplication application;
RenderTask task = taskList.GetTask( 0u );
- Actor actor = task.GetCameraActor();
+ CameraActor actor = task.GetCameraActor();
DALI_TEST_CHECK( actor );
+ DALI_TEST_EQUALS( actor.GetProjectionMode(), Dali::Camera::PERSPECTIVE_PROJECTION, TEST_LOCATION );
+ DALI_TEST_GREATER( actor.GetFieldOfView(), 0.0f, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetCameraActorN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetCameraActor() with empty handle");
+ RenderTask task;
+
+ try
+ {
+ Actor actor = task.GetCameraActor();
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
- RenderTask newTask = taskList.CreateTask();
- DALI_TEST_CHECK( actor == newTask.GetCameraActor() );
END_TEST;
}
-int UtcDaliRenderTaskSetTargetFrameBuffer(void)
+int UtcDaliRenderTaskSetTargetFrameBufferP(void)
{
TestApplication application;
RenderTask task = taskList.GetTask( 0u );
- // By default render-tasks do not render off-screen
- FrameBufferImage image = task.GetTargetFrameBuffer();
- DALI_TEST_CHECK( !image );
-
FrameBufferImage newImage = FrameBufferImage::New();
-
task.SetTargetFrameBuffer( newImage );
DALI_TEST_CHECK( task.GetTargetFrameBuffer() == newImage );
END_TEST;
}
-int UtcDaliRenderTaskGetTargetFrameBuffer(void)
+int UtcDaliRenderTaskSetTargetFrameBufferN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetTargetFrameBuffer()");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+
+ RenderTask task = taskList.GetTask( 0u );
+ FrameBufferImage newImage; // Empty handle
+ task.SetTargetFrameBuffer( newImage );
+ DALI_TEST_EQUALS( (bool)task.GetTargetFrameBuffer(), false, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetTargetFrameBufferP(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetTargetFrameBuffer()");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+
+ RenderTask newTask = taskList.CreateTask();
+ FrameBufferImage fb = FrameBufferImage::New(128, 128, Pixel::RGBA8888);
+ newTask.SetTargetFrameBuffer( fb );
+ DALI_TEST_EQUALS( newTask.GetTargetFrameBuffer(), fb, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetTargetFrameBufferN(void)
{
TestApplication application;
FrameBufferImage image = task.GetTargetFrameBuffer();
DALI_TEST_CHECK( !image );
- RenderTask newTask = taskList.CreateTask();
- DALI_TEST_CHECK( !newTask.GetTargetFrameBuffer() );
END_TEST;
}
-int UtcDaliRenderTaskSetScreenToFrameBufferFunction(void)
+int UtcDaliRenderTaskSetScreenToFrameBufferFunctionP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliRenderTaskGetScreenToFrameBufferFunction(void)
+int UtcDaliRenderTaskSetScreenToFrameBufferFunctionN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetScreenToFrameBufferFunction()");
+
+ RenderTask task; // Empty handle
+ try
+ {
+ task.SetScreenToFrameBufferFunction( TestScreenToFrameBufferFunction );
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetScreenToFrameBufferFunctionP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliRenderTaskGetScreenToFrameBufferFunctionN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetScreenToFrameBufferFunction() on empty handle");
+
+ RenderTask task;
+ try
+ {
+ RenderTask::ScreenToFrameBufferFunction func = task.GetScreenToFrameBufferFunction();
+ func=func;
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
-int UtcDaliRenderTaskGetScreenToFrameBufferMappingActor(void)
+int UtcDaliRenderTaskGetScreenToFrameBufferMappingActorP(void)
{
TestApplication application;
tet_infoline("Testing RenderTask::GetScreenToFrameBufferMappingActor ");
Actor mappingActor = Actor::New();
renderTask.SetScreenToFrameBufferMappingActor(mappingActor);
- DALI_TEST_CHECK( mappingActor == renderTask.GetScreenToFrameBufferMappingActor() );
+ DALI_TEST_EQUALS( mappingActor, renderTask.GetScreenToFrameBufferMappingActor(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliRenderTaskSetViewport(void)
+
+int UtcDaliRenderTaskGetScreenToFrameBufferMappingActorN(void)
{
TestApplication application;
+ tet_infoline("Testing RenderTask::GetScreenToFrameBufferMappingActor with empty task handle");
- tet_infoline("Testing RenderTask::SetViewport()");
+ RenderTask task;
+ try
+ {
+ Actor mappingActor;
+ task.SetScreenToFrameBufferMappingActor(mappingActor);
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetScreenToFrameBufferMappingActor02N(void)
+{
+ TestApplication application;
+ tet_infoline("Testing RenderTask::GetScreenToFrameBufferMappingActor with empty task handle");
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask renderTask = taskList.CreateTask();
+ Actor actor;
+ renderTask.SetScreenToFrameBufferMappingActor(actor);
- RenderTask task = taskList.GetTask( 0u );
+ DALI_TEST_EQUALS( (bool)renderTask.GetScreenToFrameBufferMappingActor(), false, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetViewportP01(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetViewport() on default task");
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
Viewport viewport = task.GetViewport();
// By default the viewport should match the stage width/height
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
+ DALI_TEST_CHECK( viewport == expectedViewport );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetViewportP02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetViewport() on new task");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.CreateTask();
+ Viewport viewport = task.GetViewport();
+ // By default the viewport should match the stage width/height
Vector2 stageSize = Stage::GetCurrent().GetSize();
Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
DALI_TEST_CHECK( viewport == expectedViewport );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetViewportN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetViewport() on empty handle");
+
+ RenderTask task;
+ try
+ {
+ Viewport viewport = task.GetViewport();
+ viewport = viewport;
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskSetViewportP(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetViewport()");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
Viewport newViewport( 0, 0, stageSize.width * 0.5f, stageSize.height * 0.5f );
task.SetViewport( newViewport );
END_TEST;
}
-int UtcDaliRenderTaskGetViewport(void)
+int UtcDaliRenderTaskSetViewportN(void)
{
TestApplication application;
- tet_infoline("Testing RenderTask::GetViewport()");
+ tet_infoline("Testing RenderTask::SetViewport()");
RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
- RenderTask task = taskList.GetTask( 0u );
-
- Viewport viewport = task.GetViewport();
-
- // By default the viewport should match the stage width/height
-
- Vector2 stageSize = Stage::GetCurrent().GetSize();
- Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
- DALI_TEST_CHECK( viewport == expectedViewport );
+ RenderTask task;
+ try
+ {
+ Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Viewport newViewport( 0, 0, stageSize.width * 0.5f, stageSize.height * 0.5f );
+ task.SetViewport( newViewport );
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
- RenderTask newTask = taskList.CreateTask();
- DALI_TEST_CHECK( newTask.GetViewport() == expectedViewport );
END_TEST;
}
+
int UtcDaliRenderTaskSetViewportPosition(void)
{
TestApplication application;
// Set by Property test
Vector2 newPosition2(32.0f, 32.0f);
- task.SetProperty( RenderTask::Property::ViewportPosition, newPosition2 );
+ task.SetProperty( RenderTask::Property::VIEWPORT_POSITION, newPosition2 );
// Update
application.SendNotification();
Vector2 newPosition3(64.0f, 0.0f);
Animation animation = Animation::New(1.0f);
- animation.AnimateTo( Property( task, RenderTask::Property::ViewportPosition ), newPosition3, AlphaFunctions::Linear );
+ animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, AlphaFunction::LINEAR );
animation.Play();
// Perform 1000ms worth of updates at which point animation should have completed.
// Set by Property test
Vector2 newSize2(50.0f, 50.0f);
- task.SetProperty( RenderTask::Property::ViewportSize, newSize2 );
+ task.SetProperty( RenderTask::Property::VIEWPORT_SIZE, newSize2 );
// Update
application.SendNotification();
Vector2 newSize3(10.0f, 10.0f);
Animation animation = Animation::New(1.0f);
- animation.AnimateTo( Property( task, RenderTask::Property::ViewportSize ), newSize3, AlphaFunctions::Linear );
+ animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, AlphaFunction::LINEAR );
animation.Play();
// Perform 1000ms worth of updates at which point animation should have completed.
END_TEST;
}
-int UtcDaliRenderTaskSetClearColor(void)
+int UtcDaliRenderTaskSetClearColorP(void)
{
TestApplication application;
DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION );
- task.SetProperty( RenderTask::Property::ClearColor, testColor2 );
+ task.SetProperty( RenderTask::Property::CLEAR_COLOR, testColor2 );
// Wait a frame.
Wait(application);
END_TEST;
}
-int UtcDaliRenderTaskGetClearColor(void)
+int UtcDaliRenderTaskSetClearColorN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetClearColor() on empty handle");
+
+ RenderTask task;
+ try
+ {
+ task.SetClearColor( Vector4::ZERO );
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetClearColorP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliRenderTaskSetClearEnabled(void)
+int UtcDaliRenderTaskGetClearColorN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetClearColor()");
+
+ RenderTask task;
+ try
+ {
+ Vector4 color = task.GetClearColor();
+ color = color;
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskSetClearEnabledP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliRenderTaskGetClearEnabled(void)
+int UtcDaliRenderTaskSetClearEnabledN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetClearEnabled() with empty handle");
+
+ RenderTask task;
+ try
+ {
+ task.SetClearEnabled(true);
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetClearEnabledP(void)
{
TestApplication application;
END_TEST;
}
+
+int UtcDaliRenderTaskGetClearEnabledN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetClearEnabled() with empty handle");
+
+ RenderTask task;
+ try
+ {
+ bool x = task.GetClearEnabled();
+ x=x;
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskSetCullModeP(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetCullMode()");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
+ DALI_TEST_EQUALS( task.GetCullMode(), true, TEST_LOCATION );
+
+ task.SetCullMode( false );
+
+ DALI_TEST_EQUALS( task.GetCullMode(), false, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskSetCullModeN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::SetCullMode() on empty handle");
+
+ RenderTask task;
+ try
+ {
+ task.SetCullMode( false );
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetCullModeP(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetCullMode()");
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
+ DALI_TEST_EQUALS( task.GetCullMode(), true, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliRenderTaskGetCullModeN(void)
+{
+ TestApplication application;
+
+ tet_infoline("Testing RenderTask::GetCullMode() with empty handle");
+
+ RenderTask task;
+ try
+ {
+ bool x = task.GetCullMode();
+ x=x;
+ }
+ catch (Dali::DaliException(e))
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "RenderTask handle is empty", TEST_LOCATION);
+ }
+ END_TEST;
+}
+
+
int UtcDaliRenderTaskSetRefreshRate(void)
{
TestApplication application;
Stage::GetCurrent().Add( offscreenCameraActor );
BufferImage image = BufferImage::New( 10, 10 );
- ImageActor rootActor = ImageActor::New( image );
+ image.Update();
+ Actor rootActor = CreateRenderableActor( image );
rootActor.SetSize( 10, 10 );
Stage::GetCurrent().Add( rootActor );
NativeImageInterfacePtr testNativeImagePtr = TestNativeImage::New(10, 10);
FrameBufferImage frameBufferImage = FrameBufferImage::New( *testNativeImagePtr.Get() );
- // Flush all outstanding messages
- application.SendNotification();
- application.Render();
-
RenderTask newTask = taskList.CreateTask();
newTask.SetCameraActor( offscreenCameraActor );
newTask.SetSourceActor( rootActor );
newTask.SetExclusive( true );
newTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
newTask.SetTargetFrameBuffer( frameBufferImage );
-
- // Framebuffer doesn't actually get created until Connected, i.e. by previous line
+ newTask.SetProperty( RenderTask::Property::REQUIRES_SYNC, true );
bool finished = false;
RenderTaskFinished renderTaskFinished( finished );
DALI_TEST_CHECK( lastSyncObj != NULL );
application.Render();
- DALI_TEST_EQUALS( (application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
+ DALI_TEST_EQUALS( (Integration::KeepUpdating::Reasons)(application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
application.SendNotification();
DALI_TEST_CHECK( !finished );
application.Render();
- DALI_TEST_EQUALS( (application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
+ DALI_TEST_EQUALS( (Integration::KeepUpdating::Reasons)(application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
application.SendNotification();
DALI_TEST_CHECK( ! finished );
DALI_TEST_CHECK( finished );
finished = false;
- application.Render(); // Double check no more finished signal
- application.SendNotification();
- DALI_TEST_CHECK( ! finished );
+ DALI_TEST_EQUALS( application.GetUpdateStatus(), 0, TEST_LOCATION );
END_TEST;
}
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected, KeepUpdating
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, false, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, false ) );
-
// ADD SOURCE ACTOR TO STAGE - expect continuous renders to start, no finished signal
Stage::GetCurrent().Add(secondRootActor);
application.SendNotification();
// CONTINUE PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
END_TEST;
}
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
application.SendNotification();
- // START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ // START PROCESS/RENDER Input, Expected Input, Expected, KeepUpdating
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, false, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, false ) );
// MAKE SOURCE ACTOR VISIBLE - expect continuous renders to start, no finished signal
secondRootActor.SetVisible(true);
application.SendNotification();
// CONTINUE PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
END_TEST;
}
Stage::GetCurrent().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New();
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
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, false, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, false ) );
// ADD CAMERA ACTOR TO STAGE - expect continuous renders to start, no finished signal
Stage::GetCurrent().Add( offscreenCameraActor );
application.SendNotification();
- // CONTINUE PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ // 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__ ) );
END_TEST;
}
-
-int UtcDaliRenderTaskContinuous04(void)
+int UtcDaliRenderTaskOnce02(void)
{
TestApplication application;
- tet_infoline("Testing RenderTask Render Continuous using loading image\nPRE: Resource not ready\nPOST:continuous renders, no Finished signal");
+ tet_infoline("Testing RenderTask Render Once GlSync, 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 );
+ TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
drawTrace.Enable(true);
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+
+ 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);
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
-
- // 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 ) );
- END_TEST;
+ 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__ ) );
+
+ END_TEST;
}
-
-int UtcDaliRenderTaskOnce01(void)
+int UtcDaliRenderTaskOnce03(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");
+ tet_infoline("Testing RenderTask Render Once GlSync, 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 AN OFFSCREEN RENDER TASK
+ // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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);
+ 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 ) );
-
- // MAKE SOURCE VISIBLE
- secondRootActor.SetVisible(true);
- 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, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
- // FINISH RESOURCE LOADING - expect no rendering yet
+ // 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, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
+ application.GetPlatform().ClearReadyResources();
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
+
+ newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
+ application.SendNotification(); // Input, Expected Input, Expected
+ 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 ) );
- application.GetPlatform().ClearReadyResources();
+ 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__ ) );
sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ 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 UtcDaliRenderTaskOnce02(void)
+
+int UtcDaliRenderTaskOnce04(void)
{
TestApplication application;
-
- tet_infoline("Testing RenderTask Render Once GlSync, using loading image. Switch from render always after ready to render once\n"
+ tet_infoline("Testing RenderTask Render Once GlSync, 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
+ // SETUP AN OFFSCREEN RENDER TASK
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+
+ 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);
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 ) );
+ 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 ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
application.SendNotification(); // Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
+ 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 ) );
- 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, __LINE__ ) );
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ 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 UtcDaliRenderTaskOnce03(void)
+int UtcDaliRenderTaskOnce05(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
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 ) );
+ 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(); // Input, Expected Input, Expected
- 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, __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, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
DALI_TEST_CHECK( lastSyncObj != NULL );
application.GetPlatform().ClearReadyResources();
sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+
+ // Expect: No draw - we've just drawn our render task once, above. No finished signal -
+ // we won't read the gl sync until the next frame. Continue rendering - we're waiting for
+ // the sync
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
+ // Expect: 1 final draw - this Update doesn't update the scene, hence render instructions
+ // from last frame but 1 are still present.
+ // Finished signal should be true - we've just done the sync.
+ // Should now stop rendering and updating - nothing left to do.
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, true, false, __LINE__ ) );
END_TEST;
}
#if 0
-//int UtcDaliRenderTaskOnce04(void)
+//int UtcDaliRenderTaskOnce06(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
// CHANGE TO RENDER ONCE, RESOURCES BECOME NOT READY
newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
ReloadImage(application, secondRootActor.GetImage());
application.SendNotification(); // Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
DALI_TEST_EQUALS( secondRootActor.GetImage().GetLoadingState(), Dali::ResourceLoading, TEST_LOCATION);
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ 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, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
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, __LINE__ ) );
sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, true, __LINE__ ) );
// Finished rendering - expect no more renders, no more signals:
- 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 ) );
- 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 ) );
+ 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__ ) );
+ 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__ ) );
END_TEST;
}
#endif
-int UtcDaliRenderTaskOnce05(void)
+int UtcDaliRenderTaskOnce07(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
// 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, 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 ) );
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
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 ) );
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ 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 UtcDaliRenderTaskOnce06(void)
+int UtcDaliRenderTaskOnce08(void)
{
TestApplication application;
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ sync.GetTrace().Enable(true);
drawTrace.Enable(true);
Actor rootActor = Actor::New();
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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);
+ RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, /*GL-SYNC*/ true);
bool finished = false;
ConnectionTracker connectionTracker;
application.SendNotification();
- // Expect 2 frames to be drawn.
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
DALI_TEST_CHECK( lastSyncObj == NULL );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_EQUALS( sync.GetTrace().CountMethod( "CreateSyncObject" ), 0, TEST_LOCATION );
+
// 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, true, finished, false, true, __LINE__ ) );
lastSyncObj = sync.GetLastSyncObject();
DALI_TEST_CHECK( lastSyncObj != NULL );
+ DALI_TEST_EQUALS( sync.GetNumberOfSyncObjects(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( sync.GetTrace().CountMethod( "CreateSyncObject" ), 1, TEST_LOCATION );
+
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ DALI_TEST_EQUALS( sync.GetNumberOfSyncObjects(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( sync.GetTrace().CountMethod( "CreateSyncObject" ), 1, TEST_LOCATION );
+
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+
+ DALI_TEST_EQUALS( sync.GetNumberOfSyncObjects(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( sync.GetTrace().CountMethod( "CreateSyncObject" ), 1, TEST_LOCATION );
sync.SetObjectSynced( lastSyncObj, true );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
application.SendNotification();
// Expect SetRefreshRate to have been called again
RenderTaskFinished renderTaskFinished( finished );
connectionTracker.DisconnectAll();
newTask.FinishedSignal().Connect( &connectionTracker, renderTaskFinished );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
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 ) );
+ 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 UtcDaliRenderTaskOnce07(void)
+int UtcDaliRenderTaskOnce09(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
// 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 ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, 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__ ) );
newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
application.SendNotification();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ 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 UtcDaliRenderTaskOnce08(void)
+int UtcDaliRenderTaskOnce10(void)
{
TestApplication application;
// SETUP A CONTINUOUS OFFSCREEN RENDER TASK
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
drawTrace.Enable(true);
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ Actor secondRootActor = CreateLoadingActor(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);
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ 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 ) );
- 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, __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 ) ); // 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 );
+ 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, true, finished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
END_TEST;
}
-
-
int UtcDaliRenderTaskOnceNoSync01(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
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 ) );
+ 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 ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
END_TEST;
}
{
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 );
+
+ 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_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");
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
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 ) );
+ 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 ) );
+ 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ 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");
-int UtcDaliRenderTaskOnceNoSync03(void)
+ // 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 );
+
+ 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, 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__ ) );
+
+ lastSyncObj = sync.GetLastSyncObject();
+ DALI_TEST_CHECK( lastSyncObj == NULL );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskOnceNoSync05(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
newTask.FinishedSignal().Connect( &application, renderTaskFinished );
application.SendNotification();
+ TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
+ Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject();
+ DALI_TEST_CHECK( lastSyncObj == NULL );
+
// 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 ) );
+ 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(); // Input, Expected Input, Expected
- 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, __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, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
END_TEST;
}
#if 0
-//int UtcDaliRenderTaskOnceNoSync04(void)
+//int UtcDaliRenderTaskOnceNoSync06(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
// CHANGE TO RENDER ONCE, RESOURCES BECOME NOT READY
newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
ReloadImage(application, secondRootActor.GetImage());
application.SendNotification(); // Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
DALI_TEST_EQUALS( secondRootActor.GetImage().GetLoadingState(), Dali::ResourceLoading, TEST_LOCATION);
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ 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, true, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, true, true, __LINE__ ) );
application.GetPlatform().ClearReadyResources();
- 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 ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true ) );
+ 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__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
END_TEST;
}
#endif
-int UtcDaliRenderTaskOnceNoSync05(void)
+int UtcDaliRenderTaskOnceNoSync07(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
// 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, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
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, true, false ) );
+ 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 UtcDaliRenderTaskOnceNoSync06(void)
+int UtcDaliRenderTaskOnceNoSync08(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
// 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, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
// Expect SetRefreshRate to have been called again
// Prevent next finished signal calling refresh once again
connectionTracker.DisconnectAll();
newTask.FinishedSignal().Connect( &connectionTracker, renderTaskFinished );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ 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 UtcDaliRenderTaskOnceNoSync07(void)
+int UtcDaliRenderTaskOnceNoSync09(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ 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;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true ) );
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) );
// 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, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
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, true, false ) );
+ 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 UtcDaliRenderTaskOnceNoSync08(void)
+int UtcDaliRenderTaskOnceNoSync10(void)
{
TestApplication application;
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor secondRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest();
Integration::ResourceId imageRequestId = imageRequest->GetId();
Stage::GetCurrent().Add(secondRootActor);
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 ) );
+ 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 ) );
- 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, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) );
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
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); // nothing to draw
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, false, __LINE__ ) );
END_TEST;
}
CameraActor offscreenCameraActor = CameraActor::New();
Stage::GetCurrent().Add( offscreenCameraActor );
- ImageActor firstRootActor = CreateLoadingImage(application, "aFile.jpg", ResourceImage::IMMEDIATE, Image::UNUSED);
+ Actor firstRootActor = 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;
// Second render task
FrameBufferImage fbo = firstTask.GetTargetFrameBuffer();
- ImageActor secondRootActor = ImageActor::New( fbo );
+ Actor secondRootActor = CreateRenderableActor( fbo );
Stage::GetCurrent().Add(secondRootActor);
RenderTask secondTask = CreateRenderTask(application, offscreenCameraActor, defaultRootActor, secondRootActor, RenderTask::REFRESH_ONCE, false);
bool secondFinished = false;
application.SendNotification();
// START PROCESS/RENDER Input, Expected Input, Expected
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, firstFinished, false, true ) );
+ 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, false, true ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, firstFinished, false, true, __LINE__ ) );
+ DALI_TEST_CHECK( firstFinished == false );
DALI_TEST_CHECK( secondFinished == false );
- CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, firstFinished, false, true ) );
+ CompleteImageLoad(application, imageRequestId, imageType);
+ 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__ ) );
+ DALI_TEST_CHECK( firstFinished == true );
DALI_TEST_CHECK( secondFinished == false );
- application.GetPlatform().ClearReadyResources();
- DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, firstFinished, true, false ) );
+ DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, secondFinished, true, false, __LINE__ ) );
DALI_TEST_CHECK( secondFinished == true );
END_TEST;
Property::IndexContainer indices;
task.GetPropertyIndices( indices );
- DALI_TEST_CHECK( ! indices.empty() );
- DALI_TEST_EQUALS( indices.size(), task.GetPropertyCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( indices.Size() );
+ DALI_TEST_EQUALS( indices.Size(), task.GetPropertyCount(), TEST_LOCATION );
END_TEST;
}
{
TestApplication application;
- tet_infoline("Testing RenderTask::SignalFinished()");
+ tet_infoline("Testing RenderTask::FinishInvisibleSourceActor()");
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
Stage::GetCurrent().Add( offscreenCameraActor );
BufferImage image = BufferImage::New( 10, 10 );
- ImageActor rootActor = ImageActor::New( image );
+ Actor rootActor = CreateRenderableActor( image );
rootActor.SetSize( 10, 10 );
rootActor.SetVisible(false);
Stage::GetCurrent().Add( rootActor );
newTask.SetExclusive( true );
newTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
newTask.SetTargetFrameBuffer( frameBufferImage );
+ newTask.SetProperty( RenderTask::Property::REQUIRES_SYNC, true );
// Framebuffer doesn't actually get created until Connected, i.e. by previous line
DALI_TEST_CHECK( lastSyncObj != NULL );
application.Render();
- DALI_TEST_EQUALS( (application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
+ DALI_TEST_EQUALS( (Integration::KeepUpdating::Reasons)(application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
application.SendNotification();
DALI_TEST_CHECK( !finished );
application.Render();
- DALI_TEST_EQUALS( (application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
+ DALI_TEST_EQUALS( (Integration::KeepUpdating::Reasons)(application.GetUpdateStatus() & Integration::KeepUpdating::RENDER_TASK_SYNC), Integration::KeepUpdating::RENDER_TASK_SYNC, TEST_LOCATION );
application.SendNotification();
DALI_TEST_CHECK( ! finished );
END_TEST;
}
+int UtcDaliRenderTaskFinishMissingImage(void)
+{
+ TestApplication application;
+
+ // Previously we had bugs where not having a resource ID would cause render-tasks to wait forever
+ tet_infoline("Testing RenderTask::SignalFinished() when an Actor has no Image set");
+
+ Stage stage = Stage::GetCurrent();
+
+ BufferImage image = BufferImage::New( 10, 10 );
+ Actor rootActor = CreateRenderableActor( image );
+ rootActor.SetSize( 10, 10 );
+ stage.Add( rootActor );
+
+ Actor actorWithMissingImage = CreateRenderableActor( Image() );
+ actorWithMissingImage.SetSize( 10, 10 );
+ stage.Add( actorWithMissingImage );
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask newTask = taskList.CreateTask();
+ newTask.SetInputEnabled( false );
+ newTask.SetClearColor( Vector4( 0.f, 0.f, 0.f, 0.f ) );
+ newTask.SetClearEnabled( true );
+ newTask.SetExclusive( true );
+ newTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+
+ bool finished = false;
+ RenderTaskFinished renderTaskFinished( finished );
+ newTask.FinishedSignal().Connect( &application, renderTaskFinished );
+
+ // 1 render to process render task, then 1 before finished msg is sent from update to the event thread.
+ application.SendNotification();
+ application.Render();
+ application.Render();
+
+ application.SendNotification();
+ DALI_TEST_CHECK( finished );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskWorldToViewport(void)
+{
+ TestApplication application( static_cast<size_t>(400), static_cast<size_t>(400) ); // square surface
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+
+ Actor actor = Actor::New();
+ actor.SetSize(100.0f, 100.0f);
+ actor.SetPosition( Vector3(0.0, 0.0, 0.0) );
+
+ actor.SetParentOrigin( Vector3(0.5, 0.5, 0.5) );
+ actor.SetAnchorPoint( Vector3(0.5, 0.5, 0.5) );
+
+ Stage::GetCurrent().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+
+ RenderTask task = taskList.GetTask( 0u );
+
+ CameraActor camera = task.GetCameraActor();
+
+ Vector2 screenSize = task.GetCurrentViewportSize();
+
+ float screenX = 0.0;
+ float screenY = 0.0;
+
+ bool ok = task.WorldToViewport(actor.GetCurrentWorldPosition(), screenX, screenY);
+ DALI_TEST_CHECK(ok == true);
+
+ DALI_TEST_EQUALS(screenX, screenSize.x/2, Math::MACHINE_EPSILON_10000, TEST_LOCATION);
+ DALI_TEST_EQUALS(screenY, screenSize.y/2, Math::MACHINE_EPSILON_10000, TEST_LOCATION);
+
+ Actor actor2 = Actor::New();
+ float actor2Size = 100.f;
+ actor2.SetSize( actor2Size, actor2Size );
+ actor2.SetPosition( Vector3(0.0, 0.0, 0.0) );
+ actor2.SetParentOrigin( Vector3(0.5, 0.5, 0.0) );
+ actor2.SetAnchorPoint( Vector3(0.5, 0.5, 0.0) );
+ Stage::GetCurrent().Add( actor2 );
+ actor2.Add(actor);
+ actor.SetParentOrigin( Vector3(0,0,0) );
+
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+
+ ok = task.WorldToViewport(actor.GetCurrentWorldPosition(), screenX, screenY);
+ DALI_TEST_CHECK(ok == true);
+
+ DALI_TEST_EQUALS(screenX, screenSize.x/2 - actor2Size/2, Math::MACHINE_EPSILON_10000, TEST_LOCATION);
+ DALI_TEST_EQUALS(screenY, screenSize.y/2 - actor2Size/2, Math::MACHINE_EPSILON_10000, TEST_LOCATION);
+
+ END_TEST;
+}
+
+
+int UtcDaliRenderTaskViewportToLocal(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.GetTask( 0u );
+
+ // 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;
+
+}