/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
application.SendNotification();
application.Render();
- // Trigger count is 2 - load & render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
.Add(DevelImageVisual::Property::LOOP_COUNT, 3)
.Add(DevelImageVisual::Property::PLAY_RANGE, playRange)
.Add(DevelVisual::Property::CORNER_RADIUS, 50.0f)
- .Add(DevelVisual::Property::BORDERLINE_WIDTH, 20.0f);
+ .Add(DevelVisual::Property::BORDERLINE_WIDTH, 20.0f)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
tet_infoline("UtcDaliVisualFactoryGetAnimatedVectorImageVisual04: Request animated vector image visual with a Property::Map");
int startFrame = 1, endFrame = 3;
+ int desiredWidth = 100, desiredHeight = 150;
float cornerRadius = 22.0f;
float borderlineWidth = 2.0f;
Vector4 borderlineColor = Vector4(1.0f, 1.0f, 1.0f, 1.0f);
.Add("cornerRadius", cornerRadius)
.Add("borderlineWidth", borderlineWidth)
.Add("borderlineColor", borderlineColor)
- .Add("borderlineOffset", borderlineOffset);
+ .Add("borderlineOffset", borderlineOffset)
+ .Add("desiredWidth", desiredWidth)
+ .Add("desiredHeight", desiredHeight);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.SendNotification();
application.Render();
- // Trigger count is 2 - load & render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
DALI_TEST_CHECK(value);
DALI_TEST_EQUALS(value->Get<float>(), borderlineOffset, TEST_LOCATION);
+ value = resultMap.Find(ImageVisual::Property::DESIRED_WIDTH, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), desiredWidth, TEST_LOCATION);
+
+ value = resultMap.Find(ImageVisual::Property::DESIRED_HEIGHT, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), desiredHeight, TEST_LOCATION);
+
actor.Unparent();
DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
tet_infoline("UtcDaliAnimatedVectorImageVisualGetPropertyMap01");
int startFrame = 1, endFrame = 3;
+ int desiredWidth = 100, desiredHeight = 150;
Vector4 cornerRadius(50.0f, 22.0f, 0.0f, 3.0f);
float borderlineWidth = 2.3f;
Vector4 borderlineColor = Vector4(0.3f, 0.3f, 1.0f, 1.0f);
.Add(DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::RELATIVE)
.Add(DevelVisual::Property::BORDERLINE_WIDTH, borderlineWidth)
.Add(DevelVisual::Property::BORDERLINE_COLOR, borderlineColor)
- .Add(DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset);
+ .Add(DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false)
+ .Add(ImageVisual::Property::DESIRED_WIDTH, desiredWidth)
+ .Add(ImageVisual::Property::DESIRED_HEIGHT, desiredHeight);
// request AnimatedVectorImageVisual with a property map
VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK(value);
DALI_TEST_EQUALS(value->Get<float>(), borderlineOffset, TEST_LOCATION);
+ value = resultMap.Find(ImageVisual::Property::DESIRED_WIDTH, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), desiredWidth, TEST_LOCATION);
+
+ value = resultMap.Find(ImageVisual::Property::DESIRED_HEIGHT, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), desiredHeight, TEST_LOCATION);
+
// request AnimatedVectorImageVisual with an URL
Visual::Base visual2 = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
Visual::Base visual = factory.CreateVisual(
Property::Map()
.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME));
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false));
DummyControl dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
application.SendNotification();
application.Render();
- // Trigger count is 2 - load & render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Renderer renderer = dummy.GetRendererAt(0);
Shader shader2 = renderer.GetShader();
tet_infoline("UtcDaliAnimatedVectorImageVisualNaturalSize");
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
+ Visual::Base visual = factory.CreateVisual(
+ Property::Map()
+ .Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false));
DALI_TEST_CHECK(visual);
DummyControl actor = DummyControl::New(true);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::LOOP_COUNT, 3);
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ .Add(DevelImageVisual::Property::PLAY_RANGE, array)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
ToolkitTestApplication application;
tet_infoline("UtcDaliAnimatedVectorImageVisualPlayRangeMarker");
+ // Set 1 marker as array
Property::Array array;
array.PushBack(VECTOR_ANIMATION_MARKER_NAME_1);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ .Add(DevelImageVisual::Property::PLAY_RANGE, array)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION);
DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_END_FRAME_1, resultEndFrame, TEST_LOCATION);
+ // Set 1 marker as string
+ array.Clear();
+
+ attributes.Clear();
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, VECTOR_ANIMATION_MARKER_NAME_1);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(40.0f, 40.0f));
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
+
+ result = value->GetArray();
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
+
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION);
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_END_FRAME_1, resultEndFrame, TEST_LOCATION);
+
// Set 2 markers
array.Clear();
array.PushBack(VECTOR_ANIMATION_MARKER_NAME_1);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::LOOP_COUNT, 3);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.GetScene().Add(actor);
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ propertyMap.Clear();
+ propertyMap.Add(DevelImageVisual::Property::LOOP_COUNT, 3);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, propertyMap);
+
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
- // Wait for animation finish - load, render, finish
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
+ // Wait for animation finish
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::PLAY_STATE);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::LOOP_COUNT, 3);
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
.Add(DevelImageVisual::Property::LOOP_COUNT, 3)
- .Add(DevelImageVisual::Property::PLAY_RANGE, playRange);
+ .Add(DevelImageVisual::Property::PLAY_RANGE, playRange)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
- .Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME);
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.GetScene().Add(actor);
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
+ propertyMap.Clear();
+ propertyMap.Add(DevelImageVisual::Property::LOOP_COUNT, 3);
+ propertyMap.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, propertyMap);
+
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
- // Trigger count is 3 - load, render, animation finished
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
+ // Trigger count is 1 - animation finished
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
.Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
- .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
- .Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME)
- .Add(DevelImageVisual::Property::LOOPING_MODE, DevelImageVisual::LoopingMode::AUTO_REVERSE);
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.GetScene().Add(actor);
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 2 - load, render
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
+ propertyMap.Clear();
+ propertyMap.Add(DevelImageVisual::Property::LOOP_COUNT, 3);
+ propertyMap.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME);
+ propertyMap.Add(DevelImageVisual::Property::LOOPING_MODE, DevelImageVisual::LoopingMode::AUTO_REVERSE);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, propertyMap);
+
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
- // Trigger count is 3 - load, render, animation finished
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
+ // Trigger count is 1 - animation finished
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
application.SendNotification();
application.Render();
- // Trigger count is 2 - load & render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Renderer renderer = actor.GetRendererAt(0u);
DALI_TEST_CHECK(renderer);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual1 = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual1);
application.GetScene().Add(actor1);
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
propertyMap.Clear();
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual2 = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual2);
application.SendNotification();
application.Render();
- // Trigger count is 4 - load & render a frame for each instance
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
DevelControl::DoAction(actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map());
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.SendNotification();
application.Render();
- // Trigger count is 2 - load & render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.SendNotification();
application.Render();
- // Trigger count is 1 - load
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
-
// Add to the Scene after loading
application.GetScene().Add(actor);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME_FRAME_DROP);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME_FRAME_DROP)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
application.GetScene().Add(actor);
application.SendNotification();
-
- // Trigger count is 1 - load
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
-
- application.SendNotification();
application.Render();
// Trigger count is 1 - resource ready
tet_infoline("UtcDaliAnimatedVectorImageVisualDynamicProperty");
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
+ Visual::Base visual = factory.CreateVisual(
+ Property::Map()
+ .Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false));
DALI_TEST_CHECK(visual);
DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
+
application.GetScene().Add(actor);
gDynamicPropertyCallbackFired = false;
END_TEST;
}
+
+int UtcDaliAnimatedVectorImageVisualDesiredSize(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliAnimatedVectorImageVisualDesiredSize");
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ int desiredWidth = 150, desiredHeight = 200;
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions(desiredWidth, desiredHeight));
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ application.GetScene().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 1 - resource ready
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ textureTrace.Enable(true);
+
+ application.SendNotification();
+ application.Render();
+
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D << ", " << 0u << ", " << desiredWidth << ", " << desiredHeight;
+ DALI_TEST_CHECK(textureTrace.FindMethodAndParams("TexImage2D", out.str().c_str()));
+ }
+
+ // Unparent to make next trigger
+ actor.Unparent();
+
+ application.SendNotification();
+ application.Render();
+
+ // Set visual size
+ actor.SetProperty(Actor::Property::SIZE, Vector2(300.0f, 300.0f));
+ application.GetScene().Add(actor);
+
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 1 - resource ready
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ textureTrace.Reset();
+
+ application.SendNotification();
+ application.Render();
+
+ {
+ std::stringstream out;
+ out << GL_TEXTURE_2D << ", " << 0u << ", " << desiredWidth << ", " << desiredHeight;
+ DALI_TEST_CHECK(textureTrace.FindMethodAndParams("TexImage2D", out.str().c_str())); // The size should not be changed
+ }
+
+ END_TEST;
+}