From: Adeel Kazmi Date: Fri, 15 Apr 2016 12:56:54 +0000 (+0100) Subject: (Automated Tests) Use Renderers instead of ImageActor X-Git-Tag: dali_1.1.31~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bde88d6692f40bbd7fe1c27e7baf3b4c8f277f6;p=platform%2Fcore%2Fuifw%2Fdali-core.git (Automated Tests) Use Renderers instead of ImageActor Change-Id: I4cae4197b1deb40b552de225becadab3370ecc3c --- diff --git a/automated-tests/src/dali-devel/CMakeLists.txt b/automated-tests/src/dali-devel/CMakeLists.txt index 7989674..a0091c8 100644 --- a/automated-tests/src/dali-devel/CMakeLists.txt +++ b/automated-tests/src/dali-devel/CMakeLists.txt @@ -31,6 +31,7 @@ SET(TC_SOURCES LIST(APPEND TC_SOURCES ../dali/dali-test-suite-utils/mesh-builder.cpp ../dali/dali-test-suite-utils/dali-test-suite-utils.cpp + ../dali/dali-test-suite-utils/test-actor-utils.cpp ../dali/dali-test-suite-utils/test-harness.cpp ../dali/dali-test-suite-utils/test-application.cpp ../dali/dali-test-suite-utils/test-gesture-manager.cpp diff --git a/automated-tests/src/dali-devel/utc-Dali-Context.cpp b/automated-tests/src/dali-devel/utc-Dali-Context.cpp index e3adc4b..0b8e151 100644 --- a/automated-tests/src/dali-devel/utc-Dali-Context.cpp +++ b/automated-tests/src/dali-devel/utc-Dali-Context.cpp @@ -42,20 +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 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; } @@ -101,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(); diff --git a/automated-tests/src/dali-devel/utc-Dali-HitTestAlgorithm.cpp b/automated-tests/src/dali-devel/utc-Dali-HitTestAlgorithm.cpp index c9edaa4..99d16c4 100644 --- a/automated-tests/src/dali-devel/utc-Dali-HitTestAlgorithm.cpp +++ b/automated-tests/src/dali-devel/utc-Dali-HitTestAlgorithm.cpp @@ -378,7 +378,7 @@ int UtcDaliHitTestAlgorithmStencil(void) stage.Add( layer ); // Create a stencil and add that to the layer - Actor stencil = ImageActor::New(Dali::BufferImage::WHITE() ); + Actor stencil = CreateRenderableActor(Dali::BufferImage::WHITE() ); stencil.SetAnchorPoint( AnchorPoint::TOP_LEFT ); stencil.SetParentOrigin( ParentOrigin::TOP_LEFT ); stencil.SetSize( 50.0f, 50.0f ); @@ -387,7 +387,7 @@ int UtcDaliHitTestAlgorithmStencil(void) layer.Add( stencil ); // Create a renderable actor and add that to the layer - Actor layerHitActor = ImageActor::New( Dali::BufferImage::WHITE() ); + Actor layerHitActor = CreateRenderableActor( Dali::BufferImage::WHITE() ); layerHitActor.SetSize( 100.0f, 100.0f ); layerHitActor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); layerHitActor.SetParentOrigin( ParentOrigin::TOP_LEFT ); diff --git a/automated-tests/src/dali-devel/utc-Dali-Scripting.cpp b/automated-tests/src/dali-devel/utc-Dali-Scripting.cpp index e481b2a..e349e82 100644 --- a/automated-tests/src/dali-devel/utc-Dali-Scripting.cpp +++ b/automated-tests/src/dali-devel/utc-Dali-Scripting.cpp @@ -742,7 +742,7 @@ int UtcDaliScriptingNewActorChildren(void) map[ "position" ] = Vector3::XAXIS; Property::Map child1Map; - child1Map[ "type" ] = "ImageActor"; + child1Map[ "type" ] = "CameraActor"; child1Map[ "position" ] = Vector3::YAXIS; Property::Array childArray; @@ -762,7 +762,7 @@ int UtcDaliScriptingNewActorChildren(void) Actor child1 = handle.GetChildAt(0); DALI_TEST_CHECK( child1 ); - DALI_TEST_CHECK( ImageActor::DownCast( child1 ) ); + DALI_TEST_CHECK( CameraActor::DownCast( child1 ) ); DALI_TEST_EQUALS( child1.GetCurrentPosition(), Vector3::YAXIS, TEST_LOCATION ); DALI_TEST_EQUALS( child1.GetChildCount(), 0u, TEST_LOCATION ); @@ -788,15 +788,15 @@ int UtcDaliScriptingCreatePropertyMapActor(void) Stage::GetCurrent().Remove( actor ); } - // ImageActor Type + // Layer Type { - Actor actor = ImageActor::New(); + Actor actor = Layer::New(); Property::Map map; CreatePropertyMap( actor, map ); DALI_TEST_CHECK( !map.Empty() ); DALI_TEST_CHECK( NULL != map.Find( "type" ) ); - DALI_TEST_EQUALS( map.Find( "type" )->Get< std::string >(), "ImageActor", TEST_LOCATION ); + DALI_TEST_EQUALS( map.Find( "type" )->Get< std::string >(), "Layer", TEST_LOCATION ); Stage::GetCurrent().Remove( actor ); } @@ -868,7 +868,7 @@ int UtcDaliScriptingCreatePropertyMapActor(void) // Children { Actor actor = Actor::New(); - Actor child = ImageActor::New(); + Actor child = Layer::New(); actor.Add( child ); Stage::GetCurrent().Add( actor ); @@ -888,7 +888,7 @@ int UtcDaliScriptingCreatePropertyMapActor(void) Property::Map childMap( children[0].Get< Property::Map >() ); DALI_TEST_CHECK( !childMap.Empty() ); DALI_TEST_CHECK( childMap.Find( "type" ) ); - DALI_TEST_EQUALS( childMap.Find( "type" )->Get< std::string >(), "ImageActor", TEST_LOCATION ); + DALI_TEST_EQUALS( childMap.Find( "type" )->Get< std::string >(), "Layer", TEST_LOCATION ); Stage::GetCurrent().Remove( actor ); } diff --git a/automated-tests/src/dali-internal/CMakeLists.txt b/automated-tests/src/dali-internal/CMakeLists.txt index add738b..4bc9f10 100644 --- a/automated-tests/src/dali-internal/CMakeLists.txt +++ b/automated-tests/src/dali-internal/CMakeLists.txt @@ -17,6 +17,7 @@ SET(TC_SOURCES LIST(APPEND TC_SOURCES ../dali/dali-test-suite-utils/mesh-builder.cpp ../dali/dali-test-suite-utils/test-harness.cpp + ../dali/dali-test-suite-utils/test-actor-utils.cpp ../dali/dali-test-suite-utils/dali-test-suite-utils.cpp ../dali/dali-test-suite-utils/test-application.cpp ../dali/dali-test-suite-utils/test-gesture-manager.cpp diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-Handles.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-Handles.cpp index 9d26c45..94eb7b3 100644 --- a/automated-tests/src/dali-internal/utc-Dali-Internal-Handles.cpp +++ b/automated-tests/src/dali-internal/utc-Dali-Internal-Handles.cpp @@ -48,23 +48,3 @@ int UtcDaliCameraActorConstructorRefObject(void) DALI_TEST_CHECK(!actor); END_TEST; } - -int UtcDaliImageActorConstructorRefObject(void) -{ - TestApplication application; - tet_infoline("Testing Dali::ImageActor::ImageActor(Internal::ImageActor*)"); - - ImageActor actor(NULL); - - DALI_TEST_CHECK(!actor); - END_TEST; -} - -int UtcDaliTextActorConstructorRefObject(void) -{ - TestApplication application; - tet_infoline("Testing Dali::TextActor::TextActor(Internal::TextActor*)"); - ImageActor actor(NULL); - DALI_TEST_CHECK(!actor); - END_TEST; -} diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-ImageFactory.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-ImageFactory.cpp index d0e63ad..66728d5 100644 --- a/automated-tests/src/dali-internal/utc-Dali-Internal-ImageFactory.cpp +++ b/automated-tests/src/dali-internal/utc-Dali-Internal-ImageFactory.cpp @@ -101,7 +101,7 @@ int UtcDaliImageFactoryUseCachedRequest02(void) tet_infoline( "UtcDaliImageFactoryCachedRequest02 - Discard previously requested resource" ); Image image = ResourceImage::New( gTestImageFilename, ResourceImage::IMMEDIATE, Image::UNUSED ); - ImageActor actor = ImageActor::New( image ); + Actor actor = CreateRenderableActor( image ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali/CMakeLists.txt b/automated-tests/src/dali/CMakeLists.txt index a835c38..8932108 100644 --- a/automated-tests/src/dali/CMakeLists.txt +++ b/automated-tests/src/dali/CMakeLists.txt @@ -81,6 +81,7 @@ SET(TC_SOURCES LIST(APPEND TC_SOURCES dali-test-suite-utils/mesh-builder.cpp dali-test-suite-utils/dali-test-suite-utils.cpp + dali-test-suite-utils/test-actor-utils.cpp dali-test-suite-utils/test-harness.cpp dali-test-suite-utils/test-application.cpp dali-test-suite-utils/test-gesture-manager.cpp diff --git a/automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h b/automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h index 8f53384..7222640 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h +++ b/automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h @@ -29,6 +29,7 @@ void tet_infoline(const char*str); void tet_printf(const char *format, ...); #include "test-application.h" +#include "test-actor-utils.h" using namespace Dali; diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.cpp new file mode 100644 index 0000000..2f833c6 --- /dev/null +++ b/automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// HEADER +#include "test-actor-utils.h" +#include "mesh-builder.h" + +// EXTERNAL INCLUDES +#include +#include + +namespace Dali +{ + +namespace +{ +const char * const TEXTURE_UNIFORM_NAME( "sTexture" ); + +const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( + attribute mediump vec2 aPosition;\n + uniform mediump mat4 uMvpMatrix;\n + uniform mediump vec3 uSize;\n + \n + void main()\n + {\n + mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n + vertexPosition.xyz *= uSize;\n + gl_Position = uMvpMatrix * vertexPosition;\n + }\n +); + +const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( + uniform lowp vec4 uColor;\n + \n + void main()\n + {\n + gl_FragColor = uColor;\n + }\n +); + +} // unnamed namespace + +Actor CreateRenderableActor() +{ + return CreateRenderableActor( Image(), VERTEX_SHADER, FRAGMENT_SHADER ); +} + +Actor CreateRenderableActor( Image texture ) +{ + return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER ); +} + +Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader ) +{ + // Create the geometry + Geometry geometry = CreateQuadGeometry(); + + // Create Shader + Shader shader = Shader::New( vertexShader, fragmentShader ); + + // Create renderer from geometry and material + Renderer renderer = Renderer::New( geometry, shader ); + + // Create actor and set renderer + Actor actor = Actor::New(); + actor.AddRenderer( renderer ); + + // If we a texture, then create a texture-set and add to renderer + if( texture ) + { + TextureSet textureSet = TextureSet::New(); + textureSet.SetImage( 0u, texture ); + renderer.SetTextures( textureSet ); + + // Set actor to the size of the texture if set + actor.SetSize( texture.GetWidth(), texture.GetHeight() ); + } + + return actor; +} + +Image GetTexture( Actor actor ) +{ + Image image; + if( actor && actor.GetRendererCount() ) + { + Renderer renderer = actor.GetRendererAt( 0u ); + if( renderer ) + { + TextureSet textureSet = renderer.GetTextures(); + if( textureSet && textureSet.GetTextureCount() ) + { + image = textureSet.GetImage( 0u ); + } + } + } + + return image; +} + +} // namespace Dali diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.h b/automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.h new file mode 100644 index 0000000..c5c5d0a --- /dev/null +++ b/automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.h @@ -0,0 +1,61 @@ +#ifndef __DALI_TEST_ACTOR_UTILS_H__ +#define __DALI_TEST_ACTOR_UTILS_H__ + +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include + +namespace Dali +{ + +class Actor; +class Image; + +/** + * @brief Creates a simple renderable-actor with solid colored quad. + * @return An actor with a renderer. + */ +Actor CreateRenderableActor(); + +/** + * @brief Creates a renderable-actor with a texture. + * @param[in] texture Texture to set. + * @return An actor with a renderer. + */ +Actor CreateRenderableActor( Image texture ); + +/** + * @brief Creates a renderable-actor with a texture and custom shaders. + * @param[in] texture Texture to set. + * @param[in] vertexShader The vertex-shader. + * @param[in] fragmentShader The fragment-shader. + * @return An actor with a renderer. + */ +Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader ); + +/** + * @brief Retrieves the texture used in a renderable actor (if available). + * @return The texture used by the actor. + * @note Assumes the actor only has one renderer, and that renderer only has one texture. + */ +Image GetTexture( Actor actor ); + +} // namespace Dali + +#endif // __DALI_TEST_ACTOR_UTILS_H__ diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 67dd53b..61bdd8d 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -2276,9 +2276,9 @@ int UtcDaliActorSetDrawModeOverlayRender(void) BufferImage imageA = BufferImage::New(16, 16); BufferImage imageB = BufferImage::New(16, 16); BufferImage imageC = BufferImage::New(16, 16); - ImageActor a = ImageActor::New( imageA ); - ImageActor b = ImageActor::New( imageB ); - ImageActor c = ImageActor::New( imageC ); + Actor a = CreateRenderableActor( imageA ); + Actor b = CreateRenderableActor( imageB ); + Actor c = CreateRenderableActor( imageC ); // Render a,b,c as regular non-overlays. so order will be: // a (8) diff --git a/automated-tests/src/dali/utc-Dali-BufferImage.cpp b/automated-tests/src/dali/utc-Dali-BufferImage.cpp index a48cefa..fcac6d8 100644 --- a/automated-tests/src/dali/utc-Dali-BufferImage.cpp +++ b/automated-tests/src/dali/utc-Dali-BufferImage.cpp @@ -96,7 +96,7 @@ int UtcDaliBufferImageNewWithPolicy01(void) application.SendNotification(); DALI_TEST_CHECK( image.GetWidth() == 16); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor( image ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -137,7 +137,7 @@ int UtcDaliBufferImageNewWithPolicy02(void) application.SendNotification(); DALI_TEST_CHECK( image.GetWidth() == 16); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor( image ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -165,13 +165,13 @@ int UtcDaliBufferImageDownCast(void) tet_infoline("Testing Dali::BufferImage::DownCast()"); BufferImage bitmap = BufferImage::New(1, 1, Dali::Pixel::BGRA8888); - ImageActor imageActor = ImageActor::New(bitmap); + Actor actor = CreateRenderableActor( bitmap ); application.SendNotification(); application.Render(16); application.Render(16); application.SendNotification(); - Image image = imageActor.GetImage(); + Image image = GetTexture( actor ); BufferImage bufferImage = BufferImage::DownCast( image ); DALI_TEST_CHECK(bufferImage); @@ -184,13 +184,13 @@ int UtcDaliBufferImageDownCast2(void) tet_infoline("Testing Dali::BufferImage::DownCast()"); Image image = ResourceImage::New("IncorrectImageName"); - ImageActor imageActor = ImageActor::New(image); + Actor actor = CreateRenderableActor( image ); application.SendNotification(); application.Render(16); application.Render(16); application.SendNotification(); - Image image1 = imageActor.GetImage(); + Image image1 = GetTexture( actor ); BufferImage bufferImage = BufferImage::DownCast( image1 ); DALI_TEST_CHECK(!bufferImage); @@ -351,7 +351,7 @@ int UtcDaliBufferImageUpdate01(void) PixelBuffer* buffer = new PixelBuffer[16 * 16]; BufferImage image = BufferImage::New(buffer, 16, 16, Pixel::A8); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor( image ); Stage::GetCurrent().Add(actor); actor.SetVisible(true); @@ -399,7 +399,7 @@ int UtcDaliBufferImageUpdate02(void) PixelBuffer* buffer = new PixelBuffer[16 * 16]; BufferImage image = BufferImage::New(buffer, 16, 16, Pixel::A8); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor( image ); Stage::GetCurrent().Add(actor); actor.SetVisible(true); @@ -454,8 +454,8 @@ int UtcDaliBufferImageUploadedSignal01(void) application.Render(16); application.SendNotification(); - Dali::ImageActor imageActor = ImageActor::New(image); - Stage::GetCurrent().Add(imageActor); + Actor actor = CreateRenderableActor( image ); + Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(16); application.SendNotification(); @@ -485,8 +485,8 @@ int UtcDaliBufferImageUploadedSignal02(void) application.Render(16); application.SendNotification(); - Dali::ImageActor imageActor = ImageActor::New(image); - Stage::GetCurrent().Add(imageActor); + Actor actor = CreateRenderableActor( image ); + Stage::GetCurrent().Add(actor); application.SendNotification(); application.Render(16); application.SendNotification(); diff --git a/automated-tests/src/dali/utc-Dali-CameraActor.cpp b/automated-tests/src/dali/utc-Dali-CameraActor.cpp index 5100ac0..78072fe 100644 --- a/automated-tests/src/dali/utc-Dali-CameraActor.cpp +++ b/automated-tests/src/dali/utc-Dali-CameraActor.cpp @@ -1275,7 +1275,7 @@ int UtcDaliCameraActorModelView(void) BufferImage image = CreateBufferImage(); - ImageActor actor = ImageActor::New( image ); + Actor actor = CreateRenderableActor(image); actor.SetSize( 100.0f, 100.0f ); actor.SetPosition( 20.0f, 30.0f, 40.0f ); actor.SetParentOrigin( ParentOrigin::CENTER ); @@ -1311,9 +1311,9 @@ int UtcDaliCameraActorReadProjectionMatrix(void) application.Render(); application.SendNotification(); Image image = CreateBufferImage(); - ImageActor imageActor = ImageActor::New( image ); - imageActor.SetSize( 100.0f, 100.0f ); - Stage::GetCurrent().Add( imageActor ); + Actor actor = CreateRenderableActor( image, RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE ); + actor.SetSize( 100.0f, 100.0f ); + Stage::GetCurrent().Add( actor ); Matrix projectionMatrix; Matrix viewMatrix; @@ -1321,18 +1321,15 @@ int UtcDaliCameraActorReadProjectionMatrix(void) camera.GetProperty( CameraActor::CameraActor::Property::PROJECTION_MATRIX ).Get( projectionMatrix ); camera.GetProperty( CameraActor::CameraActor::Property::VIEW_MATRIX ).Get( viewMatrix ); - ShaderEffect shaderEffect = ShaderEffect::New( RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE ); - imageActor.SetShaderEffect( shaderEffect ); - - shaderEffect.SetUniform( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME, Matrix::IDENTITY ); - shaderEffect.SetUniform( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME, Matrix::IDENTITY ); + actor.RegisterProperty( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME, Matrix::IDENTITY ); + actor.RegisterProperty( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME, Matrix::IDENTITY ); - Property::Index projectionMatrixPropertyIndex = shaderEffect.GetPropertyIndex( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME ); - Property::Index viewMatrixPropertyIndex = shaderEffect.GetPropertyIndex( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME ); + Property::Index projectionMatrixPropertyIndex = actor.GetPropertyIndex( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME ); + Property::Index viewMatrixPropertyIndex = actor.GetPropertyIndex( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME ); - Constraint projectionMatrixConstraint = Constraint::New( shaderEffect, projectionMatrixPropertyIndex, EqualToConstraint() ); + Constraint projectionMatrixConstraint = Constraint::New( actor, projectionMatrixPropertyIndex, EqualToConstraint() ); projectionMatrixConstraint.AddSource( Source( camera, CameraActor::Property::PROJECTION_MATRIX ) ); - Constraint viewMatrixConstraint = Constraint::New( shaderEffect, viewMatrixPropertyIndex, EqualToConstraint() ); + Constraint viewMatrixConstraint = Constraint::New( actor, viewMatrixPropertyIndex, EqualToConstraint() ); viewMatrixConstraint.AddSource( Source( camera, CameraActor::Property::VIEW_MATRIX ) ); projectionMatrixConstraint.Apply(); diff --git a/automated-tests/src/dali/utc-Dali-FrameBufferImage.cpp b/automated-tests/src/dali/utc-Dali-FrameBufferImage.cpp index 1f2b880..469d32a 100644 --- a/automated-tests/src/dali/utc-Dali-FrameBufferImage.cpp +++ b/automated-tests/src/dali/utc-Dali-FrameBufferImage.cpp @@ -49,7 +49,7 @@ int UtcDaliFrameBufferImageNew01(void) // initialise handle image = FrameBufferImage::New(); // create framebuffer with the same dimensions as the stage - ImageActor actor=ImageActor::New(image); + Actor actor = CreateRenderableActor( image ); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -62,12 +62,6 @@ int UtcDaliFrameBufferImageNew01(void) DALI_TEST_EQUALS((float)image.GetHeight(), stageSize.height, TEST_LOCATION); image = FrameBufferImage::New(16, 16); // create framebuffer with dimensions of 16x16 - actor.SetImage(image); - - application.SendNotification(); - application.Render(); - application.Render(); - application.SendNotification(); DALI_TEST_CHECK( image ); DALI_TEST_EQUALS(image.GetWidth(), 16u, TEST_LOCATION); @@ -139,7 +133,7 @@ int UtcDaliFrameBufferImageAttachments01(void) // initialise handle image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR); // create framebuffer with Color buffer - ImageActor actor=ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -165,7 +159,7 @@ int UtcDaliFrameBufferImageAttachments02(void) // initialise handle image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_DEPTH); // create framebuffer with Color and Depth buffer - ImageActor actor=ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -191,7 +185,7 @@ int UtcDaliFrameBufferImageAttachments03(void) // initialise handle image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_STENCIL); // create framebuffer with Color and Stencil - ImageActor actor=ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -217,7 +211,7 @@ int UtcDaliFrameBufferImageAttachments04(void) // initialise handle image = FrameBufferImage::New(64, 64, Pixel::RGBA8888, RenderBuffer::COLOR_DEPTH_STENCIL); // create framebuffer with Color, Depth and Stencil buffers - ImageActor actor=ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); diff --git a/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp b/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp index 97f1b28..5325c43 100644 --- a/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-HoverProcessing.cpp @@ -959,12 +959,12 @@ int UtcDaliHoverOffscreenRenderTasks(void) // FrameBufferImage for offscreen RenderTask FrameBufferImage frameBufferImage( FrameBufferImage::New( stageSize.width, stageSize.height, Pixel::RGBA8888 ) ); - // Create an image actor to display the FrameBufferImage - ImageActor imageActor ( ImageActor::New( frameBufferImage ) ); - imageActor.SetParentOrigin(ParentOrigin::CENTER); - imageActor.SetSize( stageSize.x, stageSize.y ); - imageActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME - stage.Add( imageActor ); + // Create a renderable actor to display the FrameBufferImage + Actor renderableActor = CreateRenderableActor( frameBufferImage ); + renderableActor.SetParentOrigin(ParentOrigin::CENTER); + renderableActor.SetSize( stageSize.x, stageSize.y ); + renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME + stage.Add( renderableActor ); Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); @@ -1006,15 +1006,14 @@ int UtcDaliHoverMultipleRenderableActors(void) Stage stage ( Stage::GetCurrent() ); Vector2 stageSize ( stage.GetSize() ); - ImageActor parent = ImageActor::New(); + Actor parent = CreateRenderableActor(); parent.SetSize( 100.0f, 100.0f ); parent.SetAnchorPoint(AnchorPoint::TOP_LEFT); stage.Add(parent); - ImageActor actor = ImageActor::New(); + Actor actor = CreateRenderableActor(); actor.SetSize( 100.0f, 100.0f ); actor.SetAnchorPoint(AnchorPoint::TOP_LEFT); - actor.SetSortModifier( 1.0f ); parent.Add(actor); // Render and notify diff --git a/automated-tests/src/dali/utc-Dali-Image.cpp b/automated-tests/src/dali/utc-Dali-Image.cpp index 1c1ba77..6701067 100644 --- a/automated-tests/src/dali/utc-Dali-Image.cpp +++ b/automated-tests/src/dali/utc-Dali-Image.cpp @@ -162,10 +162,10 @@ int UtcDaliImageSignalUploaded(void) image.UploadedSignal().Connect( SignalUploadedHandler ); - Dali::ImageActor imageActor = ImageActor::New(image); - Stage::GetCurrent().Add(imageActor); - imageActor.SetSize(80, 80); - imageActor.SetVisible(true); + Dali::Actor actor = CreateRenderableActor( image ); + Stage::GetCurrent().Add( actor ); + actor.SetSize(80, 80); + actor.SetVisible(true); application.SendNotification(); application.Render(0); @@ -239,10 +239,10 @@ int UtcDaliImageDiscard02(void) { { - ImageActor actor; + Actor actor; { Image image = ResourceImage::New(gTestImageFilename, ImageDimensions( 40, 30 ) ); - actor = ImageActor::New(image); + actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -289,7 +289,7 @@ int UtcDaliImageDiscard03(void) application.GetPlatform().SetClosestImageSize(closestImageSize); Image image = ResourceImage::New(gTestImageFilename); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); @@ -344,7 +344,7 @@ int UtcDaliImageContextLoss(void) // request file loading immediately DALI_TEST_CHECK( platform.WasCalled(TestPlatformAbstraction::LoadResourceFunc) ); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); application.SendNotification(); diff --git a/automated-tests/src/dali/utc-Dali-Layer.cpp b/automated-tests/src/dali/utc-Dali-Layer.cpp index 255caa0..e6c38aa 100644 --- a/automated-tests/src/dali/utc-Dali-Layer.cpp +++ b/automated-tests/src/dali/utc-Dali-Layer.cpp @@ -262,8 +262,8 @@ int UtcDaliLayerSetSortFunction(void) TestApplication application; BufferImage img = BufferImage::New( 1,1 ); // create two transparent actors so there is something to sort - ImageActor actor = ImageActor::New( img ); - ImageActor actor2 = ImageActor::New( img ); + Actor actor = CreateRenderableActor( img ); + Actor actor2 = CreateRenderableActor( img ); actor.SetSize(1,1); actor.SetColor( Vector4(1, 1, 1, 0.5f ) ); // 50% transparent actor2.SetSize(1,1); @@ -558,7 +558,7 @@ int UtcDaliLayerClippingGLCalls(void) // Add at least one renderable actor so the GL calls are actually made BufferImage img = BufferImage::New( 1,1 ); - Actor actor = ImageActor::New( img ); + Actor actor = CreateRenderableActor( img ); stage.Add( actor ); // flush the queue and render once diff --git a/automated-tests/src/dali/utc-Dali-NativeImage.cpp b/automated-tests/src/dali/utc-Dali-NativeImage.cpp index e44c393..2b59b92 100644 --- a/automated-tests/src/dali/utc-Dali-NativeImage.cpp +++ b/automated-tests/src/dali/utc-Dali-NativeImage.cpp @@ -247,9 +247,9 @@ int UtcDaliNativeImageTestCreationFailure(void) nativeImageInterface->SetGlExtensionCreateResult( false ); - ImageActor imageActor = ImageActor::New( nativeImage ); - imageActor.SetParentOrigin( ParentOrigin::CENTER ); - Stage::GetCurrent().Add( imageActor ); + Actor actor = CreateRenderableActor( nativeImage ); + actor.SetParentOrigin( ParentOrigin::CENTER ); + Stage::GetCurrent().Add( actor ); TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); @@ -273,7 +273,7 @@ int UtcDaliNativeImageTestCreationFailure(void) drawTrace.Reset(); nativeImageInterface->SetGlExtensionCreateResult( true ); - imageActor.SetPosition( 0, 0, 1 ); + actor.SetPosition( 0, 0, 1 ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp b/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp index c7a9772..94a762a 100644 --- a/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp +++ b/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp @@ -145,9 +145,9 @@ NinePatchImage CustomizeNinePatch( TestApplication& application, Image image = ResourceImage::New( "blah.#.png" ); - tet_infoline("Assign image to ImageActor"); - ImageActor imageActor = ImageActor::New( image ); - Stage::GetCurrent().Add( imageActor ); + tet_infoline("Assign image to image rendering actor"); + Actor actor = CreateRenderableActor( image ); + Stage::GetCurrent().Add( actor ); tet_infoline("Downcast Image to a nine-patch image\n"); NinePatchImage ninePatchImage = NinePatchImage::DownCast( image ); diff --git a/automated-tests/src/dali/utc-Dali-ObjectRegistry.cpp b/automated-tests/src/dali/utc-Dali-ObjectRegistry.cpp index d49b266..fa110dc 100644 --- a/automated-tests/src/dali/utc-Dali-ObjectRegistry.cpp +++ b/automated-tests/src/dali/utc-Dali-ObjectRegistry.cpp @@ -88,24 +88,6 @@ struct TestCameraActorCallback bool& mSignalVerified; }; -struct TestImageActorCallback -{ - TestImageActorCallback(bool& signalReceived) - : mSignalVerified(signalReceived) - { - } - void operator()(BaseHandle object) - { - tet_infoline("Verifying TestImageActorCallback()"); - ImageActor actor = ImageActor::DownCast(object); - if(actor) - { - mSignalVerified = true; - } - } - bool& mSignalVerified; -}; - struct TestLayerCallback { TestLayerCallback(bool& signalReceived) @@ -241,34 +223,6 @@ int UtcDaliObjectRegistrySignalCameraCreated(void) END_TEST; } -int UtcDaliObjectRegistrySignalImageActorCreated(void) -{ - TestApplication application; - ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); - - static const char* TestImageFilename = "icon_wrt.png"; - Image image = ResourceImage::New(TestImageFilename); - - bool verified = false; - TestImageActorCallback test(verified); - - Dali::RefObject* objectPointer = NULL; - TestObjectDestroyedCallback test2(verified, objectPointer); - - registry.ObjectCreatedSignal().Connect(&application, test); - registry.ObjectDestroyedSignal().Connect(&application, test2); - - { - ImageActor actor = ImageActor::New(image); - DALI_TEST_CHECK( test.mSignalVerified ); - - verified = false; - objectPointer = actor.GetObjectPtr(); - } - DALI_TEST_CHECK( test.mSignalVerified ); - END_TEST; -} - int UtcDaliObjectRegistrySignalLayerCreated(void) { TestApplication application; diff --git a/automated-tests/src/dali/utc-Dali-RenderTask.cpp b/automated-tests/src/dali/utc-Dali-RenderTask.cpp index 9ba74d6..71fbcbc 100644 --- a/automated-tests/src/dali/utc-Dali-RenderTask.cpp +++ b/automated-tests/src/dali/utc-Dali-RenderTask.cpp @@ -170,14 +170,14 @@ bool TestScreenToFrameBufferFunction( Vector2& coordinates ) return true; } -ImageActor CreateLoadingImageActor(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); @@ -432,7 +432,7 @@ int UtcDaliRenderTaskSetSourceActorP01(void) 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 ); @@ -479,7 +479,7 @@ int UtcDaliRenderTaskSetSourceActorP02(void) 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 ); @@ -542,7 +542,7 @@ int UtcDaliRenderTaskSetSourceActorOffStage(void) 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 //' @@ -603,7 +603,7 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void) 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 ); @@ -704,7 +704,7 @@ int UtcDaliRenderTaskSetExclusive(void) RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList(); - // Manipulate the GenTextures behaviour, to identify different ImageActors + // Manipulate the GenTextures behaviour, to identify different actors std::vector ids; ids.push_back( 8 ); // 8 = actor1 @@ -713,7 +713,7 @@ int UtcDaliRenderTaskSetExclusive(void) 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 ); @@ -731,7 +731,7 @@ int UtcDaliRenderTaskSetExclusive(void) } 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 @@ -755,7 +755,7 @@ int UtcDaliRenderTaskSetExclusive(void) } 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 @@ -844,7 +844,7 @@ int UtcDaliRenderTaskSetExclusive02(void) 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 ); @@ -1744,7 +1744,7 @@ int UtcDaliRenderTaskSignalFinished(void) BufferImage image = BufferImage::New( 10, 10 ); image.Update(); - ImageActor rootActor = ImageActor::New( image ); + Actor rootActor = CreateRenderableActor( image ); rootActor.SetSize( 10, 10 ); Stage::GetCurrent().Add( rootActor ); @@ -1823,7 +1823,7 @@ int UtcDaliRenderTaskContinuous01(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -1866,7 +1866,7 @@ int UtcDaliRenderTaskContinuous02(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -1908,7 +1908,7 @@ int UtcDaliRenderTaskContinuous03(void) Stage::GetCurrent().Add( rootActor ); CameraActor offscreenCameraActor = CameraActor::New(); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -1951,7 +1951,7 @@ int UtcDaliRenderTaskContinuous04(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2043,7 +2043,7 @@ int UtcDaliRenderTaskOnce01(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2158,7 +2158,7 @@ int UtcDaliRenderTaskOnce03(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2284,7 +2284,7 @@ int UtcDaliRenderTaskOnce05(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2350,7 +2350,7 @@ int UtcDaliRenderTaskOnce05(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2424,7 +2424,7 @@ int UtcDaliRenderTaskOnce07(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2492,7 +2492,7 @@ int UtcDaliRenderTaskOnce08(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2579,7 +2579,7 @@ int UtcDaliRenderTaskOnce09(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2639,7 +2639,7 @@ int UtcDaliRenderTaskOnce10(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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); @@ -2691,7 +2691,7 @@ int UtcDaliRenderTaskOnceNoSync01(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2785,7 +2785,7 @@ int UtcDaliRenderTaskOnceNoSync03(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2901,7 +2901,7 @@ int UtcDaliRenderTaskOnceNoSync05(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -2955,7 +2955,7 @@ int UtcDaliRenderTaskOnceNoSync05(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -3017,7 +3017,7 @@ int UtcDaliRenderTaskOnceNoSync07(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -3070,7 +3070,7 @@ int UtcDaliRenderTaskOnceNoSync08(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -3129,7 +3129,7 @@ int UtcDaliRenderTaskOnceNoSync09(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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; @@ -3180,7 +3180,7 @@ int UtcDaliRenderTaskOnceNoSync10(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor secondRootActor = CreateLoadingImageActor(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); @@ -3230,7 +3230,7 @@ int UtcDaliRenderTaskOnceChain01(void) CameraActor offscreenCameraActor = CameraActor::New(); Stage::GetCurrent().Add( offscreenCameraActor ); - ImageActor firstRootActor = CreateLoadingImageActor(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; @@ -3244,7 +3244,7 @@ int UtcDaliRenderTaskOnceChain01(void) // 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; @@ -3375,7 +3375,7 @@ int UtcDaliRenderTaskFinishInvisibleSourceActor(void) 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 ); @@ -3451,16 +3451,16 @@ 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 ImageActor has no Image set"); + tet_infoline("Testing RenderTask::SignalFinished() when an Actor has no Image set"); Stage stage = Stage::GetCurrent(); BufferImage image = BufferImage::New( 10, 10 ); - ImageActor rootActor = ImageActor::New( image ); + Actor rootActor = CreateRenderableActor( image ); rootActor.SetSize( 10, 10 ); stage.Add( rootActor ); - ImageActor actorWithMissingImage = ImageActor::New( Image() ); + Actor actorWithMissingImage = CreateRenderableActor( Image() ); actorWithMissingImage.SetSize( 10, 10 ); stage.Add( actorWithMissingImage ); diff --git a/automated-tests/src/dali/utc-Dali-ResourceImage.cpp b/automated-tests/src/dali/utc-Dali-ResourceImage.cpp index df2ee7e..134b112 100644 --- a/automated-tests/src/dali/utc-Dali-ResourceImage.cpp +++ b/automated-tests/src/dali/utc-Dali-ResourceImage.cpp @@ -111,7 +111,7 @@ int UtcDaliResourceImageNewWithPolicies01(void) // request file loading only when actor added to stage DALI_TEST_CHECK( !platform.WasCalled(TestPlatformAbstraction::LoadResourceFunc) ); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); @@ -163,7 +163,7 @@ int UtcDaliResourceImageNewWithPolicies02(void) // request file loading only when actor added to stage DALI_TEST_CHECK( !platform.WasCalled(TestPlatformAbstraction::LoadResourceFunc) ); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); @@ -215,7 +215,7 @@ int UtcDaliResourceImageNewWithPolicies03(void) // request file loading immediately DALI_TEST_CHECK( platform.WasCalled(TestPlatformAbstraction::LoadResourceFunc) ); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); @@ -275,7 +275,7 @@ int UtcDaliResourceImageNewWithPolicies04(void) // request file loading immediately DALI_TEST_CHECK( platform.WasCalled(TestPlatformAbstraction::LoadResourceFunc) ); - ImageActor actor = ImageActor::New(image); + Actor actor = CreateRenderableActor(image); Stage::GetCurrent().Add(actor); diff --git a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp index 2fe2760..cf90160 100644 --- a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp @@ -956,12 +956,12 @@ int UtcDaliTouchOffscreenRenderTasks(void) // FrameBufferImage for offscreen RenderTask FrameBufferImage frameBufferImage( FrameBufferImage::New( stageSize.width, stageSize.height, Pixel::RGBA8888 ) ); - // Create an image actor to display the FrameBufferImage - ImageActor imageActor ( ImageActor::New( frameBufferImage ) ); - imageActor.SetParentOrigin(ParentOrigin::CENTER); - imageActor.SetSize( stageSize.x, stageSize.y ); - imageActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME - stage.Add( imageActor ); + // Create a renderable actor to display the FrameBufferImage + Actor renderableActor = CreateRenderableActor( frameBufferImage ); + renderableActor.SetParentOrigin(ParentOrigin::CENTER); + renderableActor.SetSize( stageSize.x, stageSize.y ); + renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME + stage.Add( renderableActor ); Actor actor = Actor::New(); actor.SetSize(100.0f, 100.0f); @@ -1003,15 +1003,14 @@ int UtcDaliTouchMultipleRenderableActors(void) Stage stage ( Stage::GetCurrent() ); Vector2 stageSize ( stage.GetSize() ); - ImageActor parent = ImageActor::New(); + Actor parent = CreateRenderableActor(); parent.SetSize(100.0f, 100.0f); parent.SetAnchorPoint(AnchorPoint::TOP_LEFT); stage.Add(parent); - ImageActor actor = ImageActor::New(); + Actor actor = CreateRenderableActor(); actor.SetSize(100.0f, 100.0f); actor.SetAnchorPoint(AnchorPoint::TOP_LEFT); - actor.SetSortModifier( 1.0f ); parent.Add(actor); // Render and notify diff --git a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp index a107637..c0fc5cd 100644 --- a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp +++ b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp @@ -597,16 +597,6 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeNameP(void) TypeInfo type; - // image actor - type = registry.GetTypeInfo( "ImageActor" ); - DALI_TEST_CHECK( type ); - DALI_TEST_CHECK( type.GetCreator() ); - DALI_TEST_CHECK( ImageActor::DownCast( type.GetCreator()() ) ); - ImageActor ia = ImageActor::DownCast(type.CreateInstance()); - DALI_TEST_CHECK( ia ); - Stage::GetCurrent().Add( ia ); - application.Render(); - // camera actor type = registry.GetTypeInfo( "CameraActor" ); DALI_TEST_CHECK( type ); @@ -649,8 +639,8 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeNameN(void) int UtcDaliTypeRegistryGetTypeInfoFromTypeIdP(void) { - TypeInfo named_type = TypeRegistry::Get().GetTypeInfo( "ImageActor" ); - TypeInfo typeinfo_type = TypeRegistry::Get().GetTypeInfo( typeid(Dali::ImageActor) ); + TypeInfo named_type = TypeRegistry::Get().GetTypeInfo( "CameraActor" ); + TypeInfo typeinfo_type = TypeRegistry::Get().GetTypeInfo( typeid(Dali::CameraActor) ); DALI_TEST_CHECK( named_type ); DALI_TEST_CHECK( typeinfo_type );