+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+ application.GetScene().Add(actor);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render(16);
+
+ Renderer renderer = actor.GetRendererAt(0);
+ Shader shader = renderer.GetShader();
+
+ Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
+ DALI_TEST_CHECK(value.GetType() == Property::MAP);
+ const Property::Map* outMap = value.GetMap();
+ std::string fragmentShaderSource = (*outMap)["fragment"].Get<std::string>();
+ std::string vertexShaderSource = (*outMap)["vertex"].Get<std::string>();
+
+ // Compare vertex shader is equal
+ DALI_TEST_EQUALS(customVertexShaderSource, vertexShaderSource, TEST_LOCATION);
+
+ // Check fragment shader changed
+ const char* fragmentPrefix = Dali::NativeImageSourceTest::GetCustomFragmentPrefix();
+ size_t pos = fragmentShaderSource.find(fragmentPrefix);
+
+ DALI_TEST_EQUALS(pos != std::string::npos, true, TEST_LOCATION);
+
+ DALI_TEST_EQUALS(std::string(fragmentPrefix) + customFragmentShaderSource, fragmentShaderSource, TEST_LOCATION);
+
+ // Check whether preMultipliedAlpha is false.
+ // Note : We dont use preMultiplied alpha when app developer using custom shader.
+ auto preMultipliedAlpha = renderer.GetProperty<bool>(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_EQUALS(preMultipliedAlpha, false, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualWithNativeImageRemoved(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Use Native Image as url");
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ NativeImageSourcePtr nativeImageSource = NativeImageSource::New(500, 500, NativeImageSource::COLOR_DEPTH_DEFAULT);
+ ImageUrl imageUrl = Dali::Toolkit::Image::GenerateUrl(nativeImageSource);
+ std::string url = imageUrl.GetUrl();
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, url);
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+ application.GetScene().Add(actor);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+
+ tet_infoline("No delete texture because reference count is not zero");
+ imageUrl.Reset();
+ application.GetScene().Remove(actor);
+ dummyImpl.UnregisterVisual(DummyControl::Property::TEST_VISUAL);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+
+ tet_infoline("Delete texture because reference count is zero");
+ visual.Reset();
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualWithEncodedImageBuffer(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Use Encoded Image Buffer as url");
+
+ EncodedImageBuffer rawBuffer = ConvertFileToEncodedImageBuffer(TEST_LARGE_IMAGE_FILE_NAME);
+ ImageUrl url = Dali::Toolkit::Image::GenerateUrl(rawBuffer);
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, url.GetUrl());
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+ application.GetScene().Add(actor);
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+
+ application.GetScene().Remove(actor);
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualWithEncodedImageBufferRemoved(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Use Encoded Image Buffer as url");
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ EncodedImageBuffer rawBuffer = ConvertFileToEncodedImageBuffer(TEST_LARGE_IMAGE_FILE_NAME);
+ ImageUrl imageUrl = Dali::Toolkit::Image::GenerateUrl(rawBuffer);
+ std::string url = imageUrl.GetUrl();
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, url);
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+ application.GetScene().Add(actor);
+ application.SendNotification();
+
+ // Wait for decode buffer and make texture.
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+
+ tet_infoline("Delete texture because there is no actor to use decoded texture");
+ imageUrl.Reset();
+ application.GetScene().Remove(actor);
+ dummyImpl.UnregisterVisual(DummyControl::Property::TEST_VISUAL);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualTextureReuse1(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request remote image visual with a Property::Map; request a second visual with the same property map - should reuse texture");
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_LARGE_IMAGE_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DETACHED);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor actor = CreateActorWithImageVisual(propertyMap);
+ application.GetScene().Add(actor);
+ application.SendNotification();
+
+ // Wait for image to load
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION);
+ textureTrace.Reset();
+ drawTrace.Reset();
+
+ Actor actor2 = CreateActorWithImageVisual(propertyMap);
+ application.GetScene().Add(actor2);
+
+ application.SendNotification(); // Send messages to update
+ application.Render(); // process update and render
+ application.SendNotification(); // process any signals to event
+
+ DALI_TEST_EQUALS(actor2.GetRendererCount(), 1u, TEST_LOCATION);
+
+ // Testing for texture re-use in gl side is not relevant - we are not using actual graphics
+ // backend here, but test graphics backend.
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawArrays"), 2, TEST_LOCATION);
+
+ tet_infoline("Test that removing 1 actor doesn't delete the texture\n");
+
+ application.GetScene().Remove(actor);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+
+ tet_infoline("Test that removing last actor does delete the texture\n");
+
+ application.GetScene().Remove(actor2); // Detaches remaining ImageVisual
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(actor2.GetRendererCount() == 0u);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualTextureReuse2(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request remote image visual with a Property::Map; request a second visual with the same url but different property map - should create new texture");
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_REMOTE_IMAGE_FILE_NAME);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor actor = CreateActorWithImageVisual(propertyMap);
+ application.GetScene().Add(actor);
+ application.SendNotification();
+
+ // Wait for image to load
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION);
+ textureTrace.Reset();
+ drawTrace.Reset();
+
+ propertyMap.Insert(ImageVisual::Property::SAMPLING_MODE, Dali::SamplingMode::NEAREST);
+ propertyMap.Insert(ImageVisual::Property::DESIRED_WIDTH, 100);
+ propertyMap.Insert(ImageVisual::Property::DESIRED_HEIGHT, 100);
+ Actor actor2 = CreateActorWithImageVisual(propertyMap);
+ application.GetScene().Add(actor2);
+
+ application.SendNotification();
+
+ // Wait for image to load
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor2.GetRendererCount(), 1u, TEST_LOCATION);
+
+ tet_infoline(
+ "Test that 2 draw calls occur with 1 new texture gen/bind, i.e. both "
+ "renderers are using different textures\n");
+
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawArrays"), 2, TEST_LOCATION);
+ TraceCallStack::NamedParams tex1;
+ tex1["texture"] << 1;
+ TraceCallStack::NamedParams tex2;
+ tex2["texture"] << 2;
+ DALI_TEST_EQUALS(textureTrace.FindMethodAndParams("BindTexture", tex1), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethodAndParams("BindTexture", tex2), true, TEST_LOCATION);
+
+ tet_infoline("Test that removing 1 actor deletes it's texture\n");
+
+ application.GetScene().Remove(actor);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION);
+
+ tet_infoline("Test that removing last actor deletes it's texture\n");
+
+ application.GetScene().Remove(actor2);
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(actor2.GetRendererCount() == 0u);
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 2, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualCustomWrapModePixelArea(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request image visual with a Property::Map, test custom wrap mode and pixel area with atlasing");
+
+ static std::vector<UniformData> customUniforms =
+ {
+ UniformData("pixelArea", Property::Type::VECTOR4),
+ UniformData("wrapMode", Property::Type::VECTOR2),
+ };
+
+ TestGraphicsController& graphics = application.GetGraphicsController();
+ graphics.AddCustomUniforms(customUniforms);
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ // Test wrap mode with atlasing. Image with a size smaller than 512*512 will be uploaded as a part of the atlas.
+ const int width = 34;
+ const int height = 34;
+ const Vector4 pixelArea(-0.5f, -0.5f, 2.f, 2.f);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_SMALL_IMAGE_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::DESIRED_WIDTH, width);
+ propertyMap.Insert(ImageVisual::Property::DESIRED_HEIGHT, height);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ propertyMap.Insert(ImageVisual::Property::PIXEL_AREA, pixelArea);
+ propertyMap.Insert(ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT);
+ propertyMap.Insert(ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT);
+ propertyMap.Insert(ImageVisual::Property::ATLASING, true);
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
+ texParameterTrace.Enable(true);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(2000, 2000));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ application.GetScene().Add(actor);
+
+ // loading started
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+
+ // WITH atlasing, the wrapping is handled manually in shader, so the following gl function should not be called
+ std::stringstream out;
+ out << std::hex << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_S << ", " << GL_MIRRORED_REPEAT;
+ DALI_TEST_CHECK(!texParameterTrace.FindMethodAndParams("TexParameteri", out.str()));
+ out.str("");
+ out << std::hex << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_T << ", " << GL_REPEAT;
+ DALI_TEST_CHECK(!texParameterTrace.FindMethodAndParams("TexParameteri", out.str()));
+
+ // test the uniforms which used to handle the wrap mode
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
+
+ Property::Value pixelAreaValue = renderer.GetProperty(renderer.GetPropertyIndex("pixelArea"));
+ DALI_TEST_EQUALS(pixelAreaValue.Get<Vector4>(), pixelArea, TEST_LOCATION);
+ Vector4 pixelAreaUniform;
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("pixelArea", pixelAreaUniform));
+ DALI_TEST_EQUALS(pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
+
+ Property::Value wrapModeValue = renderer.GetProperty(renderer.GetPropertyIndex("wrapMode"));
+ Vector2 wrapMode(WrapMode::MIRRORED_REPEAT - 1, WrapMode::REPEAT - 1);
+ DALI_TEST_EQUALS(wrapModeValue.Get<Vector2>(), wrapMode, TEST_LOCATION);
+ Vector2 wrapModeUniform;
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector2>("wrapMode", wrapModeUniform));
+ DALI_TEST_EQUALS(wrapMode, wrapModeUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
+
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualCustomWrapModeNoAtlas(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request image visual with a Property::Map, test custom wrap mode and pixel area without atlasing");
+
+ static std::vector<UniformData> customUniforms =
+ {
+ UniformData("pixelArea", Property::Type::VECTOR4),
+ };
+
+ TestGraphicsController& graphics = application.GetGraphicsController();
+ graphics.AddCustomUniforms(customUniforms);
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ // Test wrap mode without atlasing. Image with a size bigger than 512*512 will NOT be uploaded as a part of the atlas.
+ const int width = 600;
+ const int height = 600;
+ const Vector4 pixelArea(-0.5f, -0.5f, 2.f, 2.f);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_LARGE_IMAGE_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::DESIRED_WIDTH, width);
+ propertyMap.Insert(ImageVisual::Property::DESIRED_HEIGHT, height);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ propertyMap.Insert(ImageVisual::Property::PIXEL_AREA, pixelArea);
+ propertyMap.Insert(ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT);
+ propertyMap.Insert(ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT);
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ textureTrace.EnableLogging(true);
+ TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
+ texParameterTrace.Enable(true);
+ texParameterTrace.EnableLogging(true);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(2000, 2000));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ application.GetScene().Add(actor);
+
+ // loading started
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+
+ // WITHOUT atlasing, the wrapping is handled by setting gl texture parameters
+ std::stringstream out;
+ out << std::hex << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_S << ", " << GL_MIRRORED_REPEAT;
+ DALI_TEST_CHECK(texParameterTrace.FindMethodAndParams("TexParameteri", out.str()));
+ out.str("");
+ out << std::hex << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_T << ", " << GL_REPEAT;
+ DALI_TEST_CHECK(texParameterTrace.FindMethodAndParams("TexParameteri", out.str()));
+
+ // test the uniforms which used to handle the wrap mode
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
+
+ Property::Value pixelAreaValue = renderer.GetProperty(renderer.GetPropertyIndex("pixelArea"));
+ DALI_TEST_EQUALS(pixelAreaValue.Get<Vector4>(), pixelArea, TEST_LOCATION);
+ Vector4 pixelAreaUniform;
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("pixelArea", pixelAreaUniform));
+ DALI_TEST_EQUALS(pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
+
+ Property::Index wrapModeIndex = renderer.GetPropertyIndex("wrapMode");
+ DALI_TEST_CHECK(wrapModeIndex == Property::INVALID_INDEX);
+
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualAnimateMixColor(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Animate mix color");
+
+ static std::vector<UniformData> customUniforms =
+ {
+ UniformData("mixColor", Property::Type::VECTOR3),
+ };
+
+ TestGraphicsController& graphics = application.GetGraphicsController();
+ graphics.AddCustomUniforms(customUniforms);
+
+ application.GetPlatform().SetClosestImageSize(Vector2(100, 100));
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
+ propertyMap.Insert("mixColor", Color::BLUE);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+
+ DummyControl actor = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(2000, 2000));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ actor.SetProperty(Actor::Property::COLOR, Color::BLACK);
+ application.GetScene().Add(actor);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+ Renderer renderer = actor.GetRendererAt(0);
+
+ // @todo Should we add API to make this code work again?
+ // Property::Index index = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
+
+ Property::Value blendModeValue = renderer.GetProperty(Renderer::Property::BLEND_MODE);
+ DALI_TEST_EQUALS(blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION);
+
+ const Vector4 TARGET_MIX_COLOR(1.0f, 0.0f, 0.0f, 0.5f);
+
+ Property::Map map;
+ map["target"] = "testVisual";
+ map["property"] = "mixColor";
+ map["initialValue"] = Color::MAGENTA;
+ map["targetValue"] = TARGET_MIX_COLOR;
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "LINEAR")
+ .Add("timePeriod", Property::Map().Add("delay", 0.0f).Add("duration", 4.0f));
+
+ Dali::Toolkit::TransitionData transition = TransitionData::New(map);
+
+ Animation animation = dummyImpl.CreateTransition(transition);
+
+ animation.AnimateTo(Property(actor, Actor::Property::COLOR), Color::WHITE);
+ animation.Play();
+
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+ glAbstraction.EnableEnableDisableCallTrace(true);
+ TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace();
+ std::ostringstream blendStr;
+ blendStr << std::hex << GL_BLEND;
+
+ application.SendNotification();
+ application.Render(0); // Ensure animation starts
+ application.Render(2000u); // Halfway point
+ Vector3 testColor(1.0f, 0.0f, 0.5f);
+
+ // uColor.a should be actor's alpha * mixColor.a.
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 0.75f)), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", testColor), true, TEST_LOCATION);
+
+ DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", blendStr.str()));
+
+ glEnableStack.Reset();
+
+ application.SendNotification();
+ application.Render(2000u);
+
+ application.SendNotification();
+ application.Render();
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(actor.GetCurrentProperty<Vector4>(Actor::Property::COLOR), Color::WHITE, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, 0.5f)), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR)), true, TEST_LOCATION);
+
+ // (Don't test for caching of capabilities, toolkit uses Test graphics backend, not actual backend)
+
+ TestMixColor(visual, Visual::Property::MIX_COLOR, TARGET_MIX_COLOR);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualAnimateOpacity(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Animate image visual opacity");
+
+ application.GetPlatform().SetClosestImageSize(Vector2(100, 100));
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
+ propertyMap.Insert("opacity", 0.5f);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+
+ DummyControl actor = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(2000, 2000));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ actor.SetProperty(Actor::Property::COLOR, Color::BLACK);
+ application.GetScene().Add(actor);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+ glAbstraction.EnableEnableDisableCallTrace(true);
+ TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace();
+ std::ostringstream blendStr;
+ blendStr << std::hex << GL_BLEND;
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", blendStr.str()));
+
+ {
+ tet_infoline("Test that the opacity can be increased to full via animation, and that the blend mode is set appropriately at the start and end of the animation.");
+
+ Property::Map map;
+ map["target"] = "testVisual";
+ map["property"] = "opacity";
+ map["targetValue"] = 1.0f;
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "LINEAR")
+ .Add("timePeriod", Property::Map().Add("delay", 0.0f).Add("duration", 4.0f));
+
+ Dali::Toolkit::TransitionData transition = TransitionData::New(map);
+ Animation animation = dummyImpl.CreateTransition(transition);
+ animation.Play();
+
+ glEnableStack.Reset();
+
+ application.SendNotification();
+ application.Render(0); // Ensure animation starts
+ application.Render(2000u); // Halfway point through animation
+ application.SendNotification(); // Handle any signals
+
+ Vector4 color;
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", color));
+ DALI_TEST_EQUALS(color.a, 0.75f, TEST_LOCATION);
+
+ application.Render(2001u); // end
+ application.SendNotification(); // ensure animation finished signal is sent
+
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", color));
+ DALI_TEST_EQUALS(color.a, 1.0f, TEST_LOCATION);
+
+ // (Don't test for caching of capabilities, toolkit uses Test graphics backend, not actual backend)
+ DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Disable", blendStr.str()));
+ }
+
+ {
+ tet_infoline("Test that the opacity can be reduced via animation, and that the blend mode is set appropriately at the start and end of the animation.");
+
+ Property::Map map;
+ map["target"] = "testVisual";
+ map["property"] = Visual::Property::OPACITY;
+ map["targetValue"] = 0.1f;
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "LINEAR")
+ .Add("timePeriod", Property::Map().Add("delay", 0.0f).Add("duration", 4.0f));
+
+ Dali::Toolkit::TransitionData transition = TransitionData::New(map);
+ Animation animation = dummyImpl.CreateTransition(transition);
+ animation.Play();
+
+ glEnableStack.Reset();
+
+ application.SendNotification();
+ application.Render(0); // Ensure animation starts
+ application.Render(2000u); // Halfway point
+ application.SendNotification();
+
+ Vector4 color;
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", color));
+ DALI_TEST_EQUALS(color.a, 0.55f, TEST_LOCATION);
+
+ DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", blendStr.str()));
+
+ glEnableStack.Reset();
+
+ application.Render(2016u); // end
+ application.SendNotification();
+
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", color));
+ DALI_TEST_EQUALS(color.a, 0.1f, TEST_LOCATION);
+
+ // (Don't test for caching of capabilities, toolkit uses Test graphics backend, not actual backend)
+ DALI_TEST_CHECK(!glEnableStack.FindMethodAndParams("Disable", blendStr.str()));
+ }
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualAnimateOpacity02(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Animate image visual opacity");
+
+ application.GetPlatform().SetClosestImageSize(Vector2(100, 100));
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
+ propertyMap.Insert("opacity", 0.5f);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+
+ DummyControl actor = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(2000, 2000));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ actor.SetProperty(Actor::Property::COLOR, Color::BLACK);
+
+ tet_infoline("Test that the opacity doesn't animate when actor not staged");
+
+ Property::Array array;
+
+ Property::Map map;
+ map["target"] = "testVisual";
+ map["property"] = "opacity";
+ map["initialValue"] = 0.0f;
+ map["targetValue"] = 1.0f;
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "LINEAR")
+ .Add("timePeriod", Property::Map().Add("delay", 0.0f).Add("duration", 4.0f));
+
+ Property::Map map2;
+ map2["target"] = "testVisual";
+ map2["property"] = "size";
+ map2["targetValue"] = Vector2(1.0f, 1.0f);
+
+ array.Add(map).Add(map2);
+
+ Dali::Toolkit::TransitionData transition = TransitionData::New(array);
+ Animation animation = dummyImpl.CreateTransition(transition);
+
+ application.GetScene().Add(actor);
+ application.SendNotification();
+ application.Render(0); // Ensure animation starts
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+ Renderer renderer = actor.GetRendererAt(0);
+ Property::Value blendModeValue = renderer.GetProperty(Renderer::Property::BLEND_MODE);
+ DALI_TEST_EQUALS(blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION);
+
+ animation = dummyImpl.CreateTransition(transition);
+ animation.Play();
+
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+ glAbstraction.EnableEnableDisableCallTrace(true);
+ TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace();
+ std::ostringstream blendStr;
+ blendStr << std::hex << GL_BLEND;
+
+ application.SendNotification();
+ application.Render(0); // Ensure animation starts
+ application.Render(2000u); // Halfway point through animation
+ application.SendNotification(); // Handle any signals
+
+ DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", blendStr.str()));
+
+ Vector4 color;
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", color));
+ DALI_TEST_EQUALS(color.a, 0.5f, TEST_LOCATION);
+
+ glEnableStack.Reset();
+
+ application.Render(2001u); // end
+ application.SendNotification(); // ensure animation finished signal is sent
+
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", color));
+ DALI_TEST_EQUALS(color.a, 1.0f, TEST_LOCATION);
+
+ DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Disable", blendStr.str()));
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualAnimatePixelArea(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("ImageVisual animate pixel area");
+
+ static std::vector<UniformData> customUniforms =
+ {
+ UniformData("pixelArea", Property::Type::VECTOR4),
+ };
+
+ TestGraphicsController& graphics = application.GetGraphicsController();
+ graphics.AddCustomUniforms(customUniforms);
+
+ application.GetPlatform().SetClosestImageSize(Vector2(100, 100));
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
+ propertyMap.Insert("mixColor", Color::BLUE);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+
+ DummyControl actor = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(2000, 2000));
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ actor.SetProperty(Actor::Property::COLOR, Color::BLACK);
+ application.GetScene().Add(actor);
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+
+ Renderer renderer = actor.GetRendererAt(0);
+ // @todo Implement this feature?
+ //Property::Index index = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
+ //tet_infoline("Test that the renderer has the mixColor property");
+ //DALI_TEST_CHECK( index != Property::INVALID_INDEX );
+
+ // TransitionData only takes string keys
+ Property::Map map;
+ map["target"] = "testVisual";
+ map["property"] = "pixelArea";
+ map["initialValue"] = Vector4(0, 0, 0, 1);
+ map["targetValue"] = Vector4(0, 0, 1, 1); // Animate width from zero to full
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "LINEAR")
+ .Add("timePeriod", Property::Map().Add("delay", 0.0f).Add("duration", 4.0f));
+
+ Dali::Toolkit::TransitionData transition = TransitionData::New(map);
+
+ Animation animation = dummyImpl.CreateTransition(transition);
+ animation.AnimateTo(Property(actor, Actor::Property::COLOR), Color::WHITE);
+ animation.Play();
+
+ application.SendNotification();
+ application.Render(0); // Ensure animation starts
+ application.Render(2000u); // Halfway point
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("pixelArea", Vector4(0.0f, 0.0f, 0.5f, 1.0f)), true, TEST_LOCATION);
+
+ application.Render(2000u); // End of animation
+
+ DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("pixelArea", Vector4(0.0f, 0.0f, 1.0f, 1.0f)), true, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualTextureCancelRemoteLoad(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request remote image visual, then destroy visual to cancel load");
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_REMOTE_IMAGE_FILE_NAME);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
+ drawTrace.Enable(true);
+
+ Actor actor = CreateActorWithImageVisual(propertyMap);
+ application.GetScene().Add(actor);
+ application.SendNotification();
+
+ application.GetScene().Remove(actor);
+ application.SendNotification();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), false, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualTextureCancelAsyncLoad(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Load image asynchronously, cancel loading, then load again");
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
+ drawTrace.Enable(true);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(Control::Property::BACKGROUND, visual);
+
+ application.GetScene().Add(actor);
+
+ // Cancel loading
+ application.GetScene().Remove(actor);
+
+ application.GetScene().Add(actor);
+
+ // Create another visual with the same image
+ visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ dummyImpl.RegisterVisual(Control::Property::BACKGROUND, visual);
+
+ application.SendNotification();
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliImageVisualSetInvalidAsyncImage(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request image visual with invalid images - should draw broken.png");
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK(factory);
+
+ Property::Map propertyMap;
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_INVALID_FILE_NAME);
+
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ DummyControl actor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+
+ application.GetScene().Add(actor);