bool ActorGetCurrentPosition(Actor &actor,Vector3 vec3SetPosition,enum ActorPositionInputParam ePositionOption)
{
- Dali::Vector3 vec3GetPosition(0.0f, 0.0f, 0.0f);
+ Dali::Vector3 vec3GetPosition(0.0f, 0.0f, 0.0f);
bool bPassed = true;
switch(ePositionOption)
{
{
LOG_E("set and get value mismatched, vec3GetPosition");
bPassed = false;
- }
+ }
break;
- }
+ }
case ACTORPOSITION_MULTI_INPUT_PARAM:
{
vec3GetPosition = Vector3::ZERO;
vec3GetPosition = actor.GetCurrentPosition();
if (vec3GetPosition != vec3SetPosition)
{
- LOG_E("set and get value mismatched, vec3GetPosition");
+ LOG_E("set and get value mismatched, vec3GetPosition");
bPassed = false;
- }
+ }
break;
- }
+ }
default:
{
bPassed = false;
- break;
+ break;
}
}
return bPassed;
switch(OrientationOption)
{
case ACTORROTATION_DEGREE:
- {
+ {
quatGetOrientation = actor.GetCurrentOrientation();
if (quatGetOrientation != quatSetOrientationDgr)
{
LOG_E("set and get value mismatched for rotation");
bPassed = false;
- }
+ }
break;
- }
+ }
case ACTORROTATION_RADIAN:
case ACTORROTATION_QUATERNION:
- {
+ {
quatGetOrientation = actor.GetCurrentOrientation();
if (quatGetOrientation != quatSetOrientation)
{
LOG_E("set and get value mismatched for rotation");
bPassed = false;
- }
+ }
break;
- }
+ }
default:
{
- bPassed = false;
+ bPassed = false;
break;
}
}
bool ActorGetCurrentScale(Actor &actor,Vector3 vec3SetScale,enum ActorScaleInputParam ScaleOption)
{
Dali::Vector3 vec3GetScale = Vector3::ZERO;
- bool bPassed = true;
+ bool bPassed = true;
switch(ScaleOption)
{
case ACTORSCALE_SINGLE_INPUT_PARAM:
- {
+ {
vec3GetScale = actor.GetCurrentScale();
//By setting scale with single param, all x, y, z terms of Vector3 scale is set with the same value
if ((vec3GetScale.x != vec3SetScale.x) || (vec3GetScale.y != vec3SetScale.x) || (vec3GetScale.z != vec3SetScale.x))
{
LOG_E("set and get value mismatched for scale");
- bPassed = false;
- }
+ bPassed = false;
+ }
break;
- }
+ }
case ACTORSCALE_MULTI_INPUT_PARAM:
- {
+ {
vec3GetScale = actor.GetCurrentScale();
if ((vec3GetScale.x != vec3SetScale.x) || (vec3GetScale.y != vec3SetScale.y) || (vec3GetScale.z != vec3SetScale.z))
{
LOG_E("set and get value mismatched for scale");
- bPassed = false;
- }
+ bPassed = false;
+ }
break;
}
case ACTORSCALE_VECTOR_INPUT_PARAM:
- {
+ {
vec3GetScale = actor.GetCurrentScale();
if (vec3GetScale != vec3SetScale)
{
LOG_E("set and get value mismatched for scale");
- bPassed = false;
- }
+ bPassed = false;
+ }
break;
- }
+ }
default:
{
bPassed = false;
- break;
+ break;
}
}
return bPassed;
bool ActorGetCurrentSize(Actor &actor,Vector3 vec3SetSize, enum ActorSizeInputParam SizeOption)
{
bool bPassed = true;
- Dali::Vector3 vec3GetSize = Vector3::ZERO;
+ Dali::Vector3 vec3GetSize = Vector3::ZERO;
switch(SizeOption)
{
case ACTORSIZE_DOUBLE_INPUT_PARAM:
case ACTORSIZE_VECTOR2_INPUT_PARAM:
- {
+ {
vec3GetSize = actor.GetCurrentSize();
if ((vec3GetSize.x != vec3SetSize.x) || (vec3GetSize.y != vec3SetSize.y) )
{
LOG_E("set and get value mismatched for Size");
- bPassed = false;
+ bPassed = false;
}
break;
}
if ((vec3GetSize.x != vec3SetSize.x) || (vec3GetSize.y != vec3SetSize.y) || (vec3GetSize.z != vec3SetSize.z))
{
LOG_E("set and get value mismatched for Size");
- bPassed = false;
+ bPassed = false;
}
break;
}
if (vec3GetSize != vec3SetSize)
{
LOG_E("set and get value mismatched for Size");
- bPassed = false;
- }
+ bPassed = false;
+ }
break;
}
default:
{
- bPassed = false;
- break;
+ bPassed = false;
+ break;
}
}
return bPassed;
}
+PropertyBuffer CreatePropertyBuffer()
+{
+ Property::Map texturedQuadVertexFormat;
+ texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
+ texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
+
+ PropertyBuffer vertexData = PropertyBuffer::New( texturedQuadVertexFormat );
+ return vertexData;
+}
+
+Geometry CreateQuadGeometry(void)
+{
+ PropertyBuffer vertexData = CreatePropertyBuffer();
+ const float halfQuadSize = .5f;
+ struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+ TexturedQuadVertex texturedQuadVertexData[4] = {
+ { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
+ { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
+ { Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f) },
+ { Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
+ vertexData.SetData(texturedQuadVertexData, 4);
+
+ unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+
+ Geometry geometry = Geometry::New();
+ geometry.AddVertexBuffer( vertexData );
+ geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
+
+ return geometry;
+}
/** @} */ //end of dali-core-Actor
/** @} */ //end of dali-core
/**Varrying the input parameter for actor's Size**/
bool ActorGetCurrentSize(Actor &actor,Vector3 vec3SetSize, enum ActorSizeInputParam SizeOption);
+/**Create the property buffer**/
+PropertyBuffer CreatePropertyBuffer();
+
+/**Create the geometry**/
+Geometry CreateQuadGeometry(void);
+
/** @} */ //end of dali-core-Actor
/** @} */ //end of dali-core
//renderer test
DALI_CHECK_FAIL( actor.GetRendererCount() != 0u, "Actor get renderer count mismatch");
- //~ Geometry geometry = Geometry::QUAD();
- //~ Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
- //~ Renderer renderer = Renderer::New(geometry, shader);
- //~ Renderer renderer1 = Renderer::New(geometry, shader);
- //~ DALI_CHECK_FAIL( !renderer, "Renderer::New(geometry, shader) is failed");
- //~ DALI_CHECK_FAIL( !renderer1, "Renderer::New(geometry, shader) is failed");
- //~ actor.AddRenderer( renderer );
- //~ actor.AddRenderer( renderer1 );
- //~ DALI_CHECK_FAIL( actor.GetRendererCount() !=2u, "Actor get renderer count mismatch" );
- //~ DALI_CHECK_FAIL( actor.GetRendererAt(0) != renderer, "Actor get renderer count mismatch" );
- //~ actor.RemoveRenderer(0);
- //~ DALI_CHECK_FAIL( actor.GetRendererCount() !=1u, "Actor get renderer count mismatch" );
- //~ actor.RemoveRenderer(renderer1);
- //~ DALI_CHECK_FAIL( actor.GetRendererCount() !=0u, "Actor get renderer count mismatch" );
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+ Renderer renderer = Renderer::New(geometry, shader);
+ Renderer renderer1 = Renderer::New(geometry, shader);
+ DALI_CHECK_FAIL( !renderer, "Renderer::New(geometry, shader) is failed");
+ DALI_CHECK_FAIL( !renderer1, "Renderer::New(geometry, shader) is failed");
+ actor.AddRenderer( renderer );
+ actor.AddRenderer( renderer1 );
+ DALI_CHECK_FAIL( actor.GetRendererCount() !=2u, "Actor get renderer count mismatch" );
+ DALI_CHECK_FAIL( actor.GetRendererAt(0) != renderer, "Actor get renderer count mismatch" );
+ actor.RemoveRenderer(0);
+ DALI_CHECK_FAIL( actor.GetRendererCount() !=1u, "Actor get renderer count mismatch" );
+ actor.RemoveRenderer(renderer1);
+ DALI_CHECK_FAIL( actor.GetRendererCount() !=0u, "Actor get renderer count mismatch" );
//screen to local test
float localX;
DaliLog::PrintPass();
}
-//~ void RenderTaskSetGetFrameBuffer()
-//~ {
- //~
- //~ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
- //~ RenderTask task = taskList.GetTask( 0u );
- //~ FrameBuffer newFrameBuffer = FrameBuffer::New( 128u, 128u, FrameBuffer::COLOR );
- //~ task.SetFrameBuffer( newFrameBuffer );
- //~ DALI_CHECK_FAIL( task.GetFrameBuffer() != newFrameBuffer, "Set and get frame buffer is failed");
- //~
- //~ DaliLog::PrintPass();
-//~ }
+void RenderTaskSetGetFrameBuffer()
+{
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
+ FrameBuffer newFrameBuffer = FrameBuffer::New( 128u, 128u, FrameBuffer::Attachment::NONE );
+ task.SetFrameBuffer( newFrameBuffer );
+ DALI_CHECK_FAIL( task.GetFrameBuffer() != newFrameBuffer, "Set and get frame buffer for Attachment::NONE is failed");
+
+ newFrameBuffer = FrameBuffer::New( 128u, 128u, FrameBuffer::Attachment::DEPTH );
+ task.SetFrameBuffer( newFrameBuffer );
+ DALI_CHECK_FAIL( task.GetFrameBuffer() != newFrameBuffer, "Set and get frame buffer for Attachment::DEPTH is failed");
+
+ newFrameBuffer = FrameBuffer::New( 128u, 128u, FrameBuffer::Attachment::STENCIL );
+ task.SetFrameBuffer( newFrameBuffer );
+ DALI_CHECK_FAIL( task.GetFrameBuffer() != newFrameBuffer, "Set and get Attachment::STENCIL frame buffer is failed");
+
+ newFrameBuffer = FrameBuffer::New( 128u, 128u, FrameBuffer::Attachment::DEPTH_STENCIL );
+ task.SetFrameBuffer( newFrameBuffer );
+ DALI_CHECK_FAIL( task.GetFrameBuffer() != newFrameBuffer, "Set and get Attachment::DEPTH_STENCIL frame buffer is failed");
+
+ DaliLog::PrintPass();
+}
/** @} */ // end of itc-render-task-testcases
/** @} */ // end of itc-render-task
/** @} */ // end of itc-dali-core
RenderTaskViewportToLocal();
break;
- //~ case RENDER_TASK_SETGETFRAMEBUFFER:
- //~ RenderTaskSetGetFrameBuffer();
- //~ break;
+ case RENDER_TASK_SETGETFRAMEBUFFER:
+ RenderTaskSetGetFrameBuffer();
+ break;
}
}
void VerdictTest()
}
-//~ //& purpose: Checks whether SetFrameBuffer and GetFrameBuffer api works properly
-//~ //& type: auto
-
-//~ /**
-//~ * @testcase ITcRenderTaskSetGetFrameBuffer
-//~ * @since_tizen 3.0
-//~ * @type Positive
-//~ * @description Checks whether SetFrameBuffer and GetFrameBuffer api works properly
-//~ * @scenario Get renderTaskList from current stage \n
-//~ * Create a RenderTask \n
-//~ * Create a framebuffer with COLOR\n
-//~ * Set framebuffer to render task \n
-//~ * Get framebuffer and check with setted one.
-//~ * @apicovered GetRenderTaskList(), SetFrameBuffer( FrameBuffer frameBuffer ), GetFrameBuffer()
-//~ * @passcase If Checks whether SetFrameBuffer and GetFrameBuffer api works properly
-//~ * @failcase If Checks whether SetFrameBuffer and GetFrameBuffer api not work properly
-//~ * @precondition NA
-//~ * @postcondition NA
-//~ */
-//~ int ITcRenderTaskSetGetFrameBuffer(void)
-//~ {
- //~ DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__);
- //~ Application application = Application::New( &gArgc, &gArgv );
- //~ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
- //~ TestApp testApp(application, RENDER_TASK_SETGETFRAMEBUFFER);
- //~ application.MainLoop();
- //~ return test_return_value;
-//~ }
+//& purpose: Checks whether SetFrameBuffer and GetFrameBuffer api works properly
+//& type: auto
+
+/**
+* @testcase ITcRenderTaskSetGetFrameBuffer
+* @since_tizen 3.0
+* @type Positive
+* @description Checks whether SetFrameBuffer and GetFrameBuffer api works properly
+* @scenario Get renderTaskList from current stage \n
+* Create a RenderTask \n
+* Create a framebuffer with COLOR\n
+* Set framebuffer to render task \n
+* Get framebuffer and check with setted one.
+* @apicovered GetRenderTaskList(), SetFrameBuffer( ), GetFrameBuffer(), FrameBuffer::Attachment
+* @passcase If Checks whether SetFrameBuffer and GetFrameBuffer api works properly
+* @failcase If Checks whether SetFrameBuffer and GetFrameBuffer api not work properly
+* @precondition NA
+* @postcondition NA
+*/
+int ITcRenderTaskSetGetFrameBuffer(void)
+{
+ DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__);
+ Application application = Application::New( &gArgc, &gArgv );
+ CHECK_OPEN_GL(SUITE_NAME,__LINE__)
+ TestApp testApp(application, RENDER_TASK_SETGETFRAMEBUFFER);
+ application.MainLoop();
+ return test_return_value;
+}
/** @} */ // end of itc-render-task-testcases
extern int ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen(void);
extern int ITcRenderTaskWorldtoViewport(void);
extern int ITcRenderTaskViewportToLocal(void);
-//~ extern int ITcRenderTaskSetGetFrameBuffer(void);
+extern int ITcRenderTaskSetGetFrameBuffer(void);
extern int ITcResourceImageGetImageSize(void);
extern int ITcResourceImageReload(void);
extern int ITcResourceImageDownCast(void);
{"ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen", ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskWorldtoViewport", ITcRenderTaskWorldtoViewport, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskViewportToLocal", ITcRenderTaskViewportToLocal, ITs_rendertask_startup, ITs_rendertask_cleanup},
- //~ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
+ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcResourceImageGetImageSize", ITcResourceImageGetImageSize, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageReload", ITcResourceImageReload, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageDownCast", ITcResourceImageDownCast, ITs_resource_image_startup, ITs_resource_image_cleanup},
extern int ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen(void);
extern int ITcRenderTaskWorldtoViewport(void);
extern int ITcRenderTaskViewportToLocal(void);
-//~ extern int ITcRenderTaskSetGetFrameBuffer(void);
+extern int ITcRenderTaskSetGetFrameBuffer(void);
extern int ITcResourceImageGetImageSize(void);
extern int ITcResourceImageReload(void);
extern int ITcResourceImageDownCast(void);
{"ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen", ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskWorldtoViewport", ITcRenderTaskWorldtoViewport, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskViewportToLocal", ITcRenderTaskViewportToLocal, ITs_rendertask_startup, ITs_rendertask_cleanup},
- //~ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
+ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcResourceImageGetImageSize", ITcResourceImageGetImageSize, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageReload", ITcResourceImageReload, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageDownCast", ITcResourceImageDownCast, ITs_resource_image_startup, ITs_resource_image_cleanup},
extern int ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen(void);
extern int ITcRenderTaskWorldtoViewport(void);
extern int ITcRenderTaskViewportToLocal(void);
-//~ extern int ITcRenderTaskSetGetFrameBuffer(void);
+extern int ITcRenderTaskSetGetFrameBuffer(void);
extern int ITcResourceImageGetImageSize(void);
extern int ITcResourceImageReload(void);
extern int ITcResourceImageDownCast(void);
{"ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen", ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskWorldtoViewport", ITcRenderTaskWorldtoViewport, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskViewportToLocal", ITcRenderTaskViewportToLocal, ITs_rendertask_startup, ITs_rendertask_cleanup},
- //~ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
+ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcResourceImageGetImageSize", ITcResourceImageGetImageSize, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageReload", ITcResourceImageReload, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageDownCast", ITcResourceImageDownCast, ITs_resource_image_startup, ITs_resource_image_cleanup},
extern int ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen(void);
extern int ITcRenderTaskWorldtoViewport(void);
extern int ITcRenderTaskViewportToLocal(void);
-//~ extern int ITcRenderTaskSetGetFrameBuffer(void);
+extern int ITcRenderTaskSetGetFrameBuffer(void);
extern int ITcResourceImageGetImageSize(void);
extern int ITcResourceImageReload(void);
extern int ITcResourceImageDownCast(void);
{"ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen", ITcRenderTaskSetGetSetScreenToFrameBufferFunctionWithDefaultScreen, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskWorldtoViewport", ITcRenderTaskWorldtoViewport, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcRenderTaskViewportToLocal", ITcRenderTaskViewportToLocal, ITs_rendertask_startup, ITs_rendertask_cleanup},
- //~ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
+ {"ITcRenderTaskSetGetFrameBuffer", ITcRenderTaskSetGetFrameBuffer, ITs_rendertask_startup, ITs_rendertask_cleanup},
{"ITcResourceImageGetImageSize", ITcResourceImageGetImageSize, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageReload", ITcResourceImageReload, ITs_resource_image_startup, ITs_resource_image_cleanup},
{"ITcResourceImageDownCast", ITcResourceImageDownCast, ITs_resource_image_startup, ITs_resource_image_cleanup},