X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Context.cpp;h=0b8e1514c3e5ad62c92c8ddb8899eedd46532f2f;hb=52aff821ed3dc357937e58e70a83260418a194c2;hp=1d5698fbd92f56845e21f926c30f8a3417e5af68;hpb=2748c54a52e7d608faf0691f12f7ec268048fda9;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-Context.cpp b/automated-tests/src/dali/utc-Dali-Context.cpp index 1d5698f..0b8e151 100644 --- a/automated-tests/src/dali/utc-Dali-Context.cpp +++ b/automated-tests/src/dali/utc-Dali-Context.cpp @@ -23,13 +23,11 @@ using namespace Dali; -#include "mesh-builder.h" - namespace { // Size of the VertexAttributeArray enables -// GLES specification states that there's minimum of +// GLES specification states that there's a minimum of 8 const unsigned int TEST_MAX_ATTRIBUTE_CACHE_SIZE = 8; enum TestAttribType @@ -44,42 +42,13 @@ enum TestAttribType ATTRIB_TYPE_LAST }; -// Create bitmap image -static BufferImage CreateBufferImage() +// Create bitmap actor +static Actor CreateBitmapActor() { BufferImage image = BufferImage::New(4,4,Pixel::RGBA8888); - - return image; -} - -static MeshActor CreateMeshActor() -{ - MeshData meshData; - MeshData::VertexContainer vertices; - MeshData::FaceIndices faces; - BoneContainer bones; - ConstructVertices(vertices, 60); - ConstructFaces(vertices, faces); - Material customMaterial = ConstructMaterial(); - meshData.SetData(vertices, faces, bones, customMaterial); - meshData.SetHasNormals(true); - meshData.SetHasTextureCoords(true); - - Mesh mesh = Mesh::New(meshData); - MeshActor actor = MeshActor::New(mesh); - - actor.SetName("Test MeshActor"); - - return actor; -} - - -static ImageActor CreateImageActor() -{ - BufferImage image = CreateBufferImage(); - ImageActor actor = ImageActor::New( image ); + Actor actor = CreateRenderableActor( image ); actor.SetSize( 100.0f, 100.0f ); - actor.SetName("Test ImageActor"); + actor.SetName("Test Image Rendering Actor"); return actor; } @@ -98,10 +67,6 @@ int UtcDaliContextVertexAttribStartup(void) application.Render(); application.Render(); - // context class should initially set the vertex attrib locations to disable - // Make sure it has been modified - DALI_TEST_CHECK(application.GetGlAbstraction().GetVertexAttribArrayChanged()); - // check the locations for (unsigned int i = 0; i < TEST_MAX_ATTRIBUTE_CACHE_SIZE; i++) { @@ -129,9 +94,9 @@ int UtcDaliContextVertexAttribImageRendering(void) application.GetGlAbstraction().ClearVertexAttribArrayChanged(); - // create a test image actor - ImageActor imageActor(CreateImageActor()); - Stage::GetCurrent().Add(imageActor); + // create a test bitmap actor + Actor actor(CreateBitmapActor()); + Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -156,67 +121,3 @@ int UtcDaliContextVertexAttribImageRendering(void) tet_result(TET_PASS); END_TEST; } - -// test to make sure the attribs change when rendering both image and mode actors -int UtcDaliContextVertexAttribImageAndModelRendering(void) -{ - tet_infoline("Testing vertex attrib rendering state in context with images and models"); - - TestApplication application; - - // start up - application.SendNotification(); - application.Render(); - application.Render(); - - // the vertex attribs get modified on startup to set them to disabled - // clear the flag to say they've changed - application.GetGlAbstraction().ClearVertexAttribArrayChanged(); - - // create a test image and mesh actor. - - MeshActor meshActor(CreateMeshActor()); - Stage::GetCurrent().Add(meshActor); - - ImageActor imageActor(CreateImageActor()); - Stage::GetCurrent().Add(imageActor); - - - application.SendNotification(); - application.Render(); - application.Render(); - - // check to make sure the state changes during the rendering of a frame - DALI_TEST_CHECK(application.GetGlAbstraction().GetVertexAttribArrayChanged()); - - // Now check to make sure the state is changing each frame. - application.GetGlAbstraction().ClearVertexAttribArrayChanged(); - - application.Render(); - application.Render(); - application.Render(); - - // make sure the state has changed - DALI_TEST_CHECK(application.GetGlAbstraction().GetVertexAttribArrayChanged()); - - // depending on the order of drawing, one of the attrib locations should be disabled - // Image uses locations 0 & 2 (position, texture) - // Model uses locations 0 & 1 (position, normals) -no textures - // so either location 1 or location 2 should be disabled after drawing. - - // see if mesh was last to draw - if (application.GetGlAbstraction().GetVertexAttribArrayState(ATTRIB_NORMAL)) - { - // texture should be disabled - DALI_TEST_CHECK( application.GetGlAbstraction().GetVertexAttribArrayState(ATTRIB_TEXCOORD) == false) - } - else - { - // image was to draw so, normals should be disabled - DALI_TEST_CHECK( application.GetGlAbstraction().GetVertexAttribArrayState(ATTRIB_NORMAL) == false) - } - - tet_result(TET_PASS); - - END_TEST; -}