virtual ObjectPtr eldbus_object_get_impl( const ConnectionPtr &conn, const std::string &bus, const std::string &path ) = 0;
virtual ProxyPtr eldbus_proxy_get_impl( const ObjectPtr &obj, const std::string &interface ) = 0;
virtual ProxyPtr eldbus_proxy_copy_impl( const ProxyPtr &ptr) = 0;
+ virtual void eldbus_name_request_impl(const ConnectionPtr&, const std::string&) {} // no-op
+ virtual void eldbus_name_release_impl(const ConnectionPtr&, const std::string&) {} // no-op
class StringStorage
{
#include <dali-toolkit/internal/text/hyphenator.h>
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
-#include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
#include <dali-toolkit/internal/text/multi-language-support.h>
#include <dali-toolkit/internal/text/segmentation.h>
#include <dali-toolkit/internal/text/shaper.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/metrics.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-model.h>
namespace Dali
const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
const std::string DEFAULT_FONT_DIR("/resources/fonts");
+const char* const DALI_DEBUG_RENDERING("DALI_DEBUG_RENDERING");
void TestDebugVisual(Integration::Scene scene, Visual::Base& visual, DevelVisual::Type actualType, Vector2 expectedNaturalSize)
{
int UtcDaliDebugRenderingGetVisual1(void)
{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
ToolkitTestApplication application;
tet_infoline("UtcDaliDebugRenderingGetVisual1: Request visual with a Property::Map");
DALI_TEST_CHECK(nPatchVisual);
TestDebugVisual(application.GetScene(), nPatchVisual, Visual::N_PATCH, Vector2::ZERO);
- EnvironmentVariable::SetTestingEnvironmentVariable(false);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
END_TEST;
}
int UtcDaliDebugRenderingGetVisual2(void)
{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
ToolkitTestApplication application;
tet_infoline("UtcDaliDebugRenderingGetVisual2: Request visual with various parameters");
DALI_TEST_CHECK(nPatchVisual);
TestDebugVisual(application.GetScene(), nPatchVisual, Visual::N_PATCH, Vector2::ZERO);
- EnvironmentVariable::SetTestingEnvironmentVariable(false);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
END_TEST;
}
int UtcDaliDebugRenderingGetVisual3(void)
{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
ToolkitTestApplication application;
tet_infoline("UtcDaliDebugRenderingGetVisual3: Request visual with various parameters");
DALI_TEST_EQUALS(imageView2.GetRendererCount(), 0u, TEST_LOCATION);
DALI_TEST_EQUALS(imageView3.GetRendererCount(), 0u, TEST_LOCATION);
- EnvironmentVariable::SetTestingEnvironmentVariable(false);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
END_TEST;
}
int UtcDaliDebugRenderingGetVisual4(void)
{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
ToolkitTestApplication application;
tet_infoline("UtcDaliDebugRenderingGetVisual4: Request visual with empty URL and empty Array");
DALI_TEST_CHECK(emptyVisual.GetObjectPtr() == &visualImpl);
}
- EnvironmentVariable::SetTestingEnvironmentVariable(false);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
END_TEST;
}
int UtcDaliDebugRenderingGetVisualObject01(void)
{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
ToolkitTestApplication application;
VisualFactory factory = VisualFactory::Get();
tet_infoline("Compare the returned TextVisual with the visual implementation, should differ");
DALI_TEST_CHECK(textVisual.GetObjectPtr() != &visualImpl);
- EnvironmentVariable::SetTestingEnvironmentVariable(false);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "0");
END_TEST;
}
int UtcDaliDebugRenderingRenderText(void)
{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
+ EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
ToolkitTestApplication application;
tet_infoline("Ensure we can render text when in debug mode");
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/internal/text/line-helper-functions.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
#include <dali-toolkit/internal/text/rendering/view-model.h>
-#include <dali-toolkit/internal/text/text-controller.h>
#include <toolkit-text-utils.h>
using namespace Dali;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <toolkit-text-utils.h>
#include <dali/devel-api/events/key-event-devel.h>
#include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
using namespace Dali;
using namespace Toolkit;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/internal/text/font-description-run.h>
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
#include <dali-toolkit/internal/text/rendering/view-model.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-view.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/internal/text/color-run.h>
#include <dali-toolkit/internal/text/font-description-run.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
#include <dali-toolkit/internal/text/text-definitions.h>
#include <dali-toolkit/internal/text/text-io.h>
#include <toolkit-text-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/text/bitmap-font.h>
#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
#include <dali-toolkit/internal/text/rendering/view-model.h>
-#include <dali-toolkit/internal/text/text-controller.h>
#include <dali/devel-api/text-abstraction/bitmap-font.h>
#include <toolkit-environment-variable.h>
#include <toolkit-text-utils.h>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/dali-toolkit.h>
#include <toolkit-text-utils.h>
#include <dali-toolkit/internal/text/font-description-run.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
#include <dali-toolkit/internal/text/rendering/view-model.h>
-#include <dali-toolkit/internal/text/text-controller.h>
using namespace Dali;
using namespace Toolkit;
#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
using namespace Dali;
using namespace Toolkit;
}
END_TEST;
-}
\ No newline at end of file
+}
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller.h>
using namespace Dali;
using namespace Toolkit;
}
END_TEST;
-}
\ No newline at end of file
+}
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
#include <dali-toolkit/internal/text/rendering/view-model.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller.h>
using namespace Dali;
using namespace Toolkit;
}
END_TEST;
-}
\ No newline at end of file
+}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <toolkit-text-utils.h>
#include <toolkit-event-thread-callback.h>
+#include <toolkit-text-utils.h>
+
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
#include <dali-toolkit/internal/visuals/color/color-visual.h>
#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
-#include <dummy-visual.h>
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+
#include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
-#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+#include <dummy-visual.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json";
+const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json";
}
int UtcDaliVisualAction(void)
{
ToolkitTestApplication application;
- tet_infoline( "Register an ImageVisual and and perform an Action on Visual directly" );
- Vector2 controlSize( 20.f, 30.f );
+ tet_infoline("Register an ImageVisual and and perform an Action on Visual directly");
+ Vector2 controlSize(20.f, 30.f);
//Created DummyVisual
- Property::Map settings;
- Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New( settings );
+ Property::Map settings;
+ Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New(settings);
- DummyControl dummyControl = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- tet_infoline( "Register visual and stage control" );
+ tet_infoline("Register visual and stage control");
- Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( dummyVisualPtr.Get() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
- dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( dummyControl );
+ Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base(dummyVisualPtr.Get());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visualBaseHandle);
+ dummyControl.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render();
- tet_infoline( "Check action counter is 0 before DoAction" );
- DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+ tet_infoline("Check action counter is 0 before DoAction");
+ DALI_TEST_EQUALS(dummyVisualPtr->GetActionCounter(), 0, TEST_LOCATION);
- tet_infoline( "Perform TEST_ACTION action on Visual. Should increase the action counter" );
+ tet_infoline("Perform TEST_ACTION action on Visual. Should increase the action counter");
- Property::Map attributes;
- Toolkit::Internal::Visual::Base& internalVisualBase = GetImplementation( visualBaseHandle );
- internalVisualBase.DoAction( Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes );
+ Property::Map attributes;
+ Toolkit::Internal::Visual::Base& internalVisualBase = GetImplementation(visualBaseHandle);
+ internalVisualBase.DoAction(Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes);
application.SendNotification();
- DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyVisualPtr->GetActionCounter(), 1, TEST_LOCATION);
END_TEST;
}
int UtcDaliVisualActionNotImplemented(void)
{
ToolkitTestApplication application;
- tet_infoline( "Register an ImageVisual and and perform an Action on a Visual which does not support any Actions" );
- Vector2 controlSize( 20.f, 30.f );
+ tet_infoline("Register an ImageVisual and and perform an Action on a Visual which does not support any Actions");
+ Vector2 controlSize(20.f, 30.f);
//Created DummyVisual
- Property::Map settings;
- Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New( settings );
+ Property::Map settings;
+ Toolkit::Internal::DummyVisualPtr dummyVisualPtr = Toolkit::Internal::DummyVisual::New(settings);
- DummyControl dummyControl = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- tet_infoline( "Register visual and stage control" );
+ tet_infoline("Register visual and stage control");
VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
- propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( dummyControl );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ dummyControl.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render();
- tet_infoline( "Check action counter is 0 before DoAction" );
- DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+ tet_infoline("Check action counter is 0 before DoAction");
+ DALI_TEST_EQUALS(dummyVisualPtr->GetActionCounter(), 0, TEST_LOCATION);
- tet_infoline( "Perform TEST_ACTION action on Color Visual which does not support it.. Should not increment the action counter" );
+ tet_infoline("Perform TEST_ACTION action on Color Visual which does not support it.. Should not increment the action counter");
Property::Map attributes;
- GetImplementation( visual ).DoAction( Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes );
+ GetImplementation(visual).DoAction(Dali::Toolkit::Internal::DummyVisual::TEST_ACTION, attributes);
application.SendNotification();
- DALI_TEST_EQUALS( dummyVisualPtr->GetActionCounter() , 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyVisualPtr->GetActionCounter(), 0, TEST_LOCATION);
END_TEST;
}
int UtcDaliVisualSetProperties(void)
{
ToolkitTestApplication application;
- tet_infoline( "Register a visual and SetProperties" );
+ tet_infoline("Register a visual and SetProperties");
Toolkit::Internal::VisualFactoryCache* factoryCache = new Toolkit::Internal::VisualFactoryCache(false);
//Created ColorVisual
Property::Map propertyMap1;
- propertyMap1.Insert(Visual::Property::TYPE, Visual::COLOR);
- propertyMap1.Insert(ColorVisual::Property::MIX_COLOR, Color::RED);
- Toolkit::Internal::ColorVisualPtr colorVisualPtr = Toolkit::Internal::ColorVisual::New( *factoryCache, propertyMap1 );
+ propertyMap1.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap1.Insert(ColorVisual::Property::MIX_COLOR, Color::RED);
+ Toolkit::Internal::ColorVisualPtr colorVisualPtr = Toolkit::Internal::ColorVisual::New(*factoryCache, propertyMap1);
- DummyControl dummyControl = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummyControl.GetImplementation() );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( colorVisualPtr.Get() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
- dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( dummyControl );
+ Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base(colorVisualPtr.Get());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visualBaseHandle);
+ dummyControl.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render();
Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::MIX_COLOR, Color::BLUE );
+ propertyMap.Insert(Visual::Property::MIX_COLOR, Color::BLUE);
- colorVisualPtr->SetProperties( propertyMap );
+ colorVisualPtr->SetProperties(propertyMap);
application.SendNotification();
application.Render();
Property::Map resultMap;
- visualBaseHandle.CreatePropertyMap( resultMap );
+ visualBaseHandle.CreatePropertyMap(resultMap);
- Property::Value* colorValue = resultMap.Find( Visual::Property::MIX_COLOR, Property::VECTOR4 );
- DALI_TEST_CHECK( colorValue );
- DALI_TEST_CHECK( colorValue->Get< Vector4 >() == Color::BLUE );
+ Property::Value* colorValue = resultMap.Find(Visual::Property::MIX_COLOR, Property::VECTOR4);
+ DALI_TEST_CHECK(colorValue);
+ DALI_TEST_CHECK(colorValue->Get<Vector4>() == Color::BLUE);
delete factoryCache;
int UtcDaliAnimatedVectorImageVisualCreateInstancePropertyMap(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualCreateInstancePropertyMap" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualCreateInstancePropertyMap");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
// request AnimatedVectorImageVisual with a property map
- VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
- Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( visual );
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation(visual);
Property::Map resultMap;
- visualImpl.CreateInstancePropertyMap( resultMap );
+ visualImpl.CreateInstancePropertyMap(resultMap);
// check the property values from the returned map from a visual
- DALI_TEST_CHECK( resultMap.Empty() ); // Now the map is empty
+ DALI_TEST_CHECK(resultMap.Empty()); // Now the map is empty
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualSetProperties(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualSetProperties" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualSetProperties");
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::PLAY_RANGE, Vector2( 0.2f, 0.8f ) );
+ 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, Vector2(0.2f, 0.8f));
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( visual );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation(visual);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load, resource ready
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
Property::Map propertyMap1;
- propertyMap1.Add( DevelImageVisual::Property::LOOP_COUNT, 1 )
- .Add( DevelImageVisual::Property::PLAY_RANGE, Vector2( 0.4f, 0.6f ) );
+ propertyMap1.Add(DevelImageVisual::Property::LOOP_COUNT, 1)
+ .Add(DevelImageVisual::Property::PLAY_RANGE, Vector2(0.4f, 0.6f));
- visualImpl.SetProperties( propertyMap1 );
+ visualImpl.SetProperties(propertyMap1);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliArcVisualCreateInstancePropertyMap(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliArcVisualCreateInstancePropertyMap" );
+ tet_infoline("UtcDaliArcVisualCreateInstancePropertyMap");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
- .Add( DevelArcVisual::Property::THICKNESS, 20.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ARC)
+ .Add(DevelArcVisual::Property::THICKNESS, 20.0f);
// request ArcVisual with a property map
- VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
- Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( visual );
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ Toolkit::Internal::Visual::Base& visualImpl = GetImplementation(visual);
Property::Map resultMap;
- visualImpl.CreateInstancePropertyMap( resultMap );
+ visualImpl.CreateInstancePropertyMap(resultMap);
// check the property values from the returned map from a visual
- DALI_TEST_CHECK( resultMap.Empty() ); // Now the map is empty
+ DALI_TEST_CHECK(resultMap.Empty()); // Now the map is empty
END_TEST;
}
int UtcDaliVisualUpdateBrokenImageRenderer(void)
{
ToolkitTestApplication application;
- tet_infoline( "UpdateBrokenImageRenderer Test" );
+ tet_infoline("UpdateBrokenImageRenderer Test");
Toolkit::Internal::VisualFactoryCache* factoryCache = new Toolkit::Internal::VisualFactoryCache(false);
//Created dummy renderer
Geometry geometry = factoryCache->GetGeometry(Toolkit::Internal::VisualFactoryCache::QUAD_GEOMETRY);
- Shader shader = Shader::New("foo","bar");
+ Shader shader = Shader::New("foo", "bar");
Renderer renderer = Renderer::New(geometry, shader);
DALI_TEST_CHECK(renderer);
#define DALI_TEST_COMPARE_TYPES_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
(extents1.bottom == extents2.bottom);
}
-template<>
-inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
-{
- Property::Type type = q1.GetType();
- if(type != q2.GetType())
- {
- return false;
- }
-
- bool result = false;
- switch(type)
- {
- case Property::BOOLEAN:
- {
- bool a, b;
- q1.Get(a);
- q2.Get(b);
- result = a == b;
- break;
- }
- case Property::INTEGER:
- {
- int a, b;
- q1.Get(a);
- q2.Get(b);
- result = a == b;
- break;
- }
- case Property::FLOAT:
- {
- float a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<float>(a, b, epsilon);
- break;
- }
- case Property::VECTOR2:
- {
- Vector2 a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Vector2>(a, b, epsilon);
- break;
- }
- case Property::VECTOR3:
- {
- Vector3 a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Vector3>(a, b, epsilon);
- break;
- }
- case Property::RECTANGLE:
- case Property::VECTOR4:
- {
- Vector4 a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Vector4>(a, b, epsilon);
- break;
- }
- case Property::ROTATION:
- {
- Quaternion a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Quaternion>(a, b, epsilon);
- break;
- }
- case Property::STRING:
- {
- std::string a, b;
- q1.Get(a);
- q2.Get(b);
- result = (a.compare(b) == 0);
- break;
- }
- case Property::MATRIX:
- case Property::MATRIX3:
- case Property::ARRAY:
- case Property::MAP:
- {
- //TODO: Implement this?
- DALI_ASSERT_ALWAYS(0 && "Not implemented");
- result = false;
- break;
- }
- case Property::EXTENTS:
- {
- Extents a, b;
- q1.Get(a);
- q2.Get(b);
- result = CompareType<Extents>(a, b, epsilon);
- break;
- }
- case Property::NONE:
- {
- result = false;
- break;
- }
- }
-
- return result;
-}
-
#endif
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*
*/
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/rendering/renderer.h>
#include <toolkit-application.h>
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include "toolkit-environment-variable.h"
// EXTERNAL INCLUDE
-#include <cstddef>
-#include <string>
+#include <map>
namespace Dali
{
{
namespace
{
-const char* gReturnValue = NULL;
-std::string gEnvironmentVariableName;
-std::string gEnvironmentVariableValue;
+std::map<std::string, std::string> gEnvironmentVariables;
} // namespace
const char* GetEnvironmentVariable(const char* variable)
{
- if(gEnvironmentVariableName == variable)
+ auto value = gEnvironmentVariables.find(variable);
+ if(value != gEnvironmentVariables.end())
{
- return gEnvironmentVariableValue.c_str();
- }
- return gReturnValue;
-}
-
-void SetTestingEnvironmentVariable(bool testing)
-{
- if(testing)
- {
- gReturnValue = "1";
- }
- else
- {
- gReturnValue = NULL;
+ return value->second.c_str();
}
+ return nullptr;
}
void SetTestEnvironmentVariable(const char* variable, const char* value)
{
- gEnvironmentVariableName = variable;
- gEnvironmentVariableValue = value;
+ gEnvironmentVariables[variable] = value;
}
} // namespace EnvironmentVariable
{
const char* GetEnvironmentVariable(const char* variable);
-void SetTestingEnvironmentVariable(bool);
-
void SetTestEnvironmentVariable(const char* variable, const char* value);
} // namespace EnvironmentVariable
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*
*/
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
#include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
+#include <dali/devel-api/threading/mutex.h>
#include <dali/public-api/object/base-object.h>
#include <toolkit-application.h>
-#include <toolkit-vector-animation-renderer.h>
#include <toolkit-event-thread-callback.h>
+#include <toolkit-vector-animation-renderer.h>
+#include <chrono>
#include <memory>
#include <thread>
-#include <chrono>
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
namespace
{
Dali::Internal::Adaptor::VectorAnimationRenderer* gVectorAnimationRenderer = nullptr;
}
-class VectorAnimationRenderer: public Dali::BaseObject
+class VectorAnimationRenderer : public Dali::BaseObject
{
public:
-
VectorAnimationRenderer()
: mUrl(),
mRenderer(),
- mWidth( 0 ),
- mHeight( 0 ),
+ mWidth(0),
+ mHeight(0),
+ mDefaultWidth(0),
+ mDefaultHeight(0),
mTotalFrameNumber(VECTOR_ANIMATION_TOTAL_FRAME_NUMBER),
- mPreviousFrame( 0 ),
+ mPreviousFrame(0),
mDelayTime(0),
mDroppedFrames(0),
- mFrameRate( 60.0f ),
+ mFrameRate(60.0f),
mTestFrameDrop(false),
mNeedDroppedFrames(false),
- mEventThreadCallback( new EventThreadCallback( MakeCallback( this, &VectorAnimationRenderer::OnTriggered ) ) )
+ mEventThreadCallback(new EventThreadCallback(MakeCallback(this, &VectorAnimationRenderer::OnTriggered)))
{
mCount++;
- if( mCount == 2 )
+ if(mCount == 2)
{
mFrameRate = 0.1f;
}
bool Load(const std::string& url)
{
+ Dali::Mutex::ScopedLock lock(mMutex);
mUrl = url;
if(mUrl == "invalid.json")
{
+ mLoadFailed = true;
return false;
}
else if(mUrl == "framedrop.json")
{
// Change total frame number for test
mTotalFrameNumber = 200;
- mTestFrameDrop = true;
}
+
+ mDefaultWidth = 100;
+ mDefaultHeight = 100;
+
return true;
}
- void SetRenderer( Dali::Renderer renderer )
+ void SetRenderer(Dali::Renderer renderer)
{
mRenderer = renderer;
-
- if( mWidth != 0 && mHeight != 0 )
- {
- Dali::TextureSet textureSet = mRenderer.GetTextures();
- Dali::Texture texture = Dali::Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, mWidth, mHeight );
- textureSet.SetTexture( 0, texture );
- mUploadCompletedSignal.Emit();
- }
}
- void SetSize( uint32_t width, uint32_t height )
+ void SetSize(uint32_t width, uint32_t height)
{
- mWidth = width;
+ Dali::Mutex::ScopedLock lock(mMutex);
+ mWidth = width;
mHeight = height;
- if( mRenderer )
+ if(!mLoadFailed)
{
- Dali::TextureSet textureSet = mRenderer.GetTextures();
- Dali::Texture texture = Dali::Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, mWidth, mHeight );
- textureSet.SetTexture( 0, texture );
- mUploadCompletedSignal.Emit();
+ mNeedTrigger = true;
+ mResourceReady = false;
}
}
- bool Render( uint32_t frameNumber )
+ bool Render(uint32_t frameNumber)
{
+ Dali::Mutex::ScopedLock lock(mMutex);
+ if(mWidth == 0 || mHeight == 0)
+ {
+ return false;
+ }
+
if(mTestFrameDrop)
{
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<int32_t>(mDelayTime)));
- mTestFrameDrop = false;
+ mTestFrameDrop = false;
mNeedDroppedFrames = true;
}
else if(mNeedDroppedFrames)
{
- mDroppedFrames = (frameNumber > mPreviousFrame) ? frameNumber - mPreviousFrame - 1: frameNumber + (mTotalFrameNumber - mPreviousFrame) - 1;
- mNeedTrigger = true;
+ mDroppedFrames = (frameNumber > mPreviousFrame) ? frameNumber - mPreviousFrame - 1 : frameNumber + (mTotalFrameNumber - mPreviousFrame) - 1;
+ mNeedTrigger = true;
mNeedDroppedFrames = false;
}
- if( mNeedTrigger )
+ if(mNeedTrigger)
{
mEventThreadCallback->Trigger();
mNeedTrigger = false;
}
- if( frameNumber == 1 && mPreviousFrame != frameNumber )
+ if(frameNumber == 1 && mPreviousFrame != frameNumber)
{
mPreviousFrame = frameNumber;
// For test corverage
return mFrameRate;
}
- void GetDefaultSize( uint32_t& width, uint32_t& height ) const
+ void GetDefaultSize(uint32_t& width, uint32_t& height) const
{
- width = 100;
- height = 100;
+ width = mDefaultWidth;
+ height = mDefaultHeight;
}
- bool GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const
+ bool GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const
{
- if( marker.compare( VECTOR_ANIMATION_MARKER_NAME_1 ) == 0 )
+ if(marker.compare(VECTOR_ANIMATION_MARKER_NAME_1) == 0)
{
startFrame = VECTOR_ANIMATION_MARKER_START_FRAME_1;
- endFrame = VECTOR_ANIMATION_MARKER_END_FRAME_1;
+ endFrame = VECTOR_ANIMATION_MARKER_END_FRAME_1;
}
- else if( marker.compare( VECTOR_ANIMATION_MARKER_NAME_2 ) == 0 )
+ else if(marker.compare(VECTOR_ANIMATION_MARKER_NAME_2) == 0)
{
startFrame = VECTOR_ANIMATION_MARKER_START_FRAME_2;
- endFrame = VECTOR_ANIMATION_MARKER_END_FRAME_2;
+ endFrame = VECTOR_ANIMATION_MARKER_END_FRAME_2;
}
else
{
return true;
}
+ void InvalidateBuffer()
+ {
+ Dali::Mutex::ScopedLock lock(mMutex);
+ if(mResourceReady)
+ {
+ mNeedTrigger = true;
+ mResourceReady = false;
+ }
+ }
+
Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal()
{
return mUploadCompletedSignal;
void OnTriggered()
{
+ if(!mResourceReady)
+ {
+ mResourceReady = true;
+
+ Dali::TextureSet textureSet = mRenderer.GetTextures();
+ Dali::Texture texture = Dali::Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, mWidth, mHeight);
+ textureSet.SetTexture(0, texture);
+
+ Devel::PixelBuffer pixelBuffer = Devel::PixelBuffer::New(mWidth, mHeight, Pixel::RGBA8888);
+ Dali::PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
+ texture.Upload(pixelData);
+
+ mUploadCompletedSignal.Emit();
+ }
}
public:
-
static uint32_t mCount;
- static bool mNeedTrigger;
- std::string mUrl;
+ std::string mUrl;
Dali::Renderer mRenderer;
- uint32_t mWidth;
- uint32_t mHeight;
- uint32_t mTotalFrameNumber;
- uint32_t mPreviousFrame;
- uint32_t mDelayTime;
- uint32_t mDroppedFrames;
- float mFrameRate;
- bool mTestFrameDrop;
- bool mNeedDroppedFrames;
+ Dali::Mutex mMutex;
+ uint32_t mWidth;
+ uint32_t mHeight;
+ uint32_t mDefaultWidth;
+ uint32_t mDefaultHeight;
+ uint32_t mTotalFrameNumber;
+ uint32_t mPreviousFrame;
+ uint32_t mDelayTime;
+ uint32_t mDroppedFrames;
+ float mFrameRate;
+ bool mTestFrameDrop;
+ bool mNeedDroppedFrames;
+ bool mLoadFailed{false};
+ bool mResourceReady{false};
+ bool mNeedTrigger{true};
+
Dali::VectorAnimationRenderer::UploadCompletedSignalType mUploadCompletedSignal;
- std::unique_ptr< EventThreadCallback > mEventThreadCallback;
+ std::unique_ptr<EventThreadCallback> mEventThreadCallback;
};
uint32_t VectorAnimationRenderer::mCount = 0;
-bool VectorAnimationRenderer::mNeedTrigger = true;
-inline VectorAnimationRenderer& GetImplementation( Dali::VectorAnimationRenderer& renderer )
+inline VectorAnimationRenderer& GetImplementation(Dali::VectorAnimationRenderer& renderer)
{
- DALI_ASSERT_ALWAYS( renderer && "VectorAnimationRenderer handle is empty." );
+ DALI_ASSERT_ALWAYS(renderer && "VectorAnimationRenderer handle is empty.");
BaseObject& handle = renderer.GetBaseObject();
- return static_cast< Internal::Adaptor::VectorAnimationRenderer& >( handle );
+ return static_cast<Internal::Adaptor::VectorAnimationRenderer&>(handle);
}
-inline const VectorAnimationRenderer& GetImplementation( const Dali::VectorAnimationRenderer& renderer )
+inline const VectorAnimationRenderer& GetImplementation(const Dali::VectorAnimationRenderer& renderer)
{
- DALI_ASSERT_ALWAYS( renderer && "VectorAnimationRenderer handle is empty." );
+ DALI_ASSERT_ALWAYS(renderer && "VectorAnimationRenderer handle is empty.");
const BaseObject& handle = renderer.GetBaseObject();
- return static_cast< const Internal::Adaptor::VectorAnimationRenderer& >( handle );
+ return static_cast<const Internal::Adaptor::VectorAnimationRenderer&>(handle);
}
} // namespace Adaptor
} // namespace Internal
-
/********************************************************************************/
/********************************* PUBLIC CLASS *******************************/
/********************************************************************************/
Internal::Adaptor::gVectorAnimationRenderer = animationRenderer;
- return VectorAnimationRenderer( animationRenderer );
+ return VectorAnimationRenderer(animationRenderer);
}
VectorAnimationRenderer::VectorAnimationRenderer()
{
}
-VectorAnimationRenderer::VectorAnimationRenderer( Internal::Adaptor::VectorAnimationRenderer* internal )
-: BaseHandle( internal )
+VectorAnimationRenderer::VectorAnimationRenderer(Internal::Adaptor::VectorAnimationRenderer* internal)
+: BaseHandle(internal)
{
}
-VectorAnimationRenderer::VectorAnimationRenderer( const VectorAnimationRenderer& handle )
-: BaseHandle( handle )
+VectorAnimationRenderer::VectorAnimationRenderer(const VectorAnimationRenderer& handle)
+: BaseHandle(handle)
{
}
-VectorAnimationRenderer& VectorAnimationRenderer::operator=( const VectorAnimationRenderer& rhs )
+VectorAnimationRenderer& VectorAnimationRenderer::operator=(const VectorAnimationRenderer& rhs)
{
- BaseHandle::operator=( rhs );
+ BaseHandle::operator=(rhs);
return *this;
}
bool VectorAnimationRenderer::Load(const std::string& url)
{
- return Internal::Adaptor::GetImplementation( *this ).Load(url);
+ return Internal::Adaptor::GetImplementation(*this).Load(url);
}
-void VectorAnimationRenderer::SetRenderer( Renderer renderer )
+void VectorAnimationRenderer::SetRenderer(Renderer renderer)
{
- Internal::Adaptor::GetImplementation( *this ).SetRenderer( renderer );
+ Internal::Adaptor::GetImplementation(*this).SetRenderer(renderer);
}
-void VectorAnimationRenderer::SetSize( uint32_t width, uint32_t height )
+void VectorAnimationRenderer::SetSize(uint32_t width, uint32_t height)
{
- Internal::Adaptor::GetImplementation( *this ).SetSize( width, height );
+ Internal::Adaptor::GetImplementation(*this).SetSize(width, height);
}
-bool VectorAnimationRenderer::Render( uint32_t frameNumber )
+bool VectorAnimationRenderer::Render(uint32_t frameNumber)
{
- return Internal::Adaptor::GetImplementation( *this ).Render( frameNumber );
+ return Internal::Adaptor::GetImplementation(*this).Render(frameNumber);
}
uint32_t VectorAnimationRenderer::GetTotalFrameNumber() const
{
- return Internal::Adaptor::GetImplementation( *this ).GetTotalFrameNumber();
+ return Internal::Adaptor::GetImplementation(*this).GetTotalFrameNumber();
}
float VectorAnimationRenderer::GetFrameRate() const
{
- return Internal::Adaptor::GetImplementation( *this ).GetFrameRate();
+ return Internal::Adaptor::GetImplementation(*this).GetFrameRate();
+}
+
+void VectorAnimationRenderer::GetDefaultSize(uint32_t& width, uint32_t& height) const
+{
+ Internal::Adaptor::GetImplementation(*this).GetDefaultSize(width, height);
}
-void VectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& height ) const
+void VectorAnimationRenderer::GetLayerInfo(Property::Map& map) const
{
- Internal::Adaptor::GetImplementation( *this ).GetDefaultSize( width, height );
}
-void VectorAnimationRenderer::GetLayerInfo( Property::Map& map ) const
+bool VectorAnimationRenderer::GetMarkerInfo(const std::string& marker, uint32_t& startFrame, uint32_t& endFrame) const
{
+ return Internal::Adaptor::GetImplementation(*this).GetMarkerInfo(marker, startFrame, endFrame);
}
-bool VectorAnimationRenderer::GetMarkerInfo( const std::string& marker, uint32_t& startFrame, uint32_t& endFrame ) const
+void VectorAnimationRenderer::InvalidateBuffer()
{
- return Internal::Adaptor::GetImplementation( *this ).GetMarkerInfo( marker, startFrame, endFrame );
+ return Internal::Adaptor::GetImplementation(*this).InvalidateBuffer();
}
VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
{
- return Internal::Adaptor::GetImplementation( *this ).UploadCompletedSignal();
+ return Internal::Adaptor::GetImplementation(*this).UploadCompletedSignal();
}
} // namespace Dali
{
namespace VectorAnimationRenderer
{
-
-void RequestTrigger()
-{
- Dali::Internal::Adaptor::VectorAnimationRenderer::mNeedTrigger = true;
-}
-
void DelayRendering(uint32_t delay)
{
- Dali::Internal::Adaptor::gVectorAnimationRenderer->mDelayTime = delay;
+ Dali::Internal::Adaptor::gVectorAnimationRenderer->mDelayTime = delay;
+ Dali::Internal::Adaptor::gVectorAnimationRenderer->mTestFrameDrop = true;
}
uint32_t GetDroppedFrames()
return Dali::Internal::Adaptor::gVectorAnimationRenderer->mDroppedFrames;
}
-} // VectorAnimationRenderer
-} // Test
-
+} // namespace VectorAnimationRenderer
+} // namespace Test
#define DALI_TOOLKIT_TEST_VECTOR_ANIMATION_RENDERER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
{
namespace VectorAnimationRenderer
{
-
#define VECTOR_ANIMATION_TOTAL_FRAME_NUMBER 5
#define VECTOR_ANIMATION_MARKER_NAME_1 "marker1"
#define VECTOR_ANIMATION_MARKER_NAME_2 "marker2"
#define VECTOR_ANIMATION_MARKER_START_FRAME_2 2
#define VECTOR_ANIMATION_MARKER_END_FRAME_2 3
-void RequestTrigger();
-void DelayRendering(uint32_t delay);
+void DelayRendering(uint32_t delay);
uint32_t GetDroppedFrames();
-} // VectorAnimationRenderer
-} // Test
-
+} // namespace VectorAnimationRenderer
+} // namespace Test
#endif // DALI_TOOLKIT_TEST_VECTOR_ANIMATION_RENDERER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include "toolkit-timer.h"
-#include <dali/devel-api/adaptor-framework/web-engine.h>
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
-#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
-#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
-#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
-#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-frame.h>
-#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
-#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
-#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
-#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
-#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
-#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-frame.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-security-origin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h>
#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/images/pixel-data.h>
#include <dali/public-api/object/any.h>
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
Renderer renderer = actor.GetRendererAt(0u);
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
Renderer renderer = actor.GetRendererAt(0u);
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
Renderer renderer = actor.GetRendererAt(0u);
application.SendNotification();
application.Render();
- // Trigger count is 1 - render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
Property::Map resultMap;
resultMap = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
Renderer renderer = dummy.GetRendererAt(0);
Shader shader2 = renderer.GetShader();
Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
application.SendNotification();
application.Render();
+ // Trigger count is 1 - load
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
visual.GetNaturalSize(naturalSize);
DALI_TEST_EQUALS(naturalSize, Vector2(100.0f, 100.0f), TEST_LOCATION); // 100x100 is the content default size.
application.SendNotification();
application.Render();
- // Trigger count is 1 - render a frame
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ 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);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ 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);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
// renderer is added to actor
DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ 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);
attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ 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);
application.SendNotification();
application.Render();
- // Wait for animation finish
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Wait for animation finish - load, render, finish
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), 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(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3);
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);
+
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 2);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ 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);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
application.SendNotification();
application.Render();
- // Stop and jump to 3
- DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes);
+ // Wait for animation finish
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Jump to 3
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
// Jump to the same position
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::LOOP_COUNT);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
value = map.Find(DevelImageVisual::Property::LOOP_COUNT);
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
+ 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);
application.SendNotification();
application.Render();
- // Trigger count is 1 - animation finished
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 3 - load, render, animation finished
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
// Pause
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.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::CURRENT_FRAME_NUMBER);
int currentFrameNumber = value->Get<int>();
// Stop
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes);
+ // To make event trigger
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
application.SendNotification();
- application.Render(16);
+ 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::CURRENT_FRAME_NUMBER);
application.SendNotification();
application.Render();
- // Trigger count is 1 - animation finished
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 3 - load, render, animation finished
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
+ 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);
+
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
Vector2 controlSize(20.f, 30.f);
- Vector3 controlScale(2.0f, 2.0f, 1.0f);
actor.SetProperty(Actor::Property::SIZE, controlSize);
- actor.SetProperty(Actor::Property::SCALE, controlScale);
-
- application.GetScene().Add(actor);
application.SendNotification();
application.Render();
application.SendNotification();
application.Render();
- Renderer renderer = actor.GetRendererAt(0u);
- DALI_TEST_CHECK(renderer);
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
auto textureSet = renderer.GetTextures();
auto texture = textureSet.GetTexture(0);
- DALI_TEST_EQUALS(controlSize.width * controlScale.width, texture.GetWidth(), TEST_LOCATION);
- DALI_TEST_EQUALS(controlSize.height * controlScale.height, texture.GetHeight(), TEST_LOCATION);
+ DALI_TEST_EQUALS(controlSize.width, texture.GetWidth(), TEST_LOCATION);
+ DALI_TEST_EQUALS(controlSize.height, texture.GetHeight(), TEST_LOCATION);
- // Change scale and size
- controlSize = Vector2(50.f, 40.f);
- controlScale = Vector3(0.5f, 0.5f, 1.0f);
- actor.SetProperty(Actor::Property::SIZE, controlSize);
+ // Change scale
+ Vector3 controlScale(2.0f, 2.0f, 1.0f);
actor.SetProperty(Actor::Property::SCALE, controlScale);
application.SendNotification();
application.SendNotification();
application.Render();
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
+
+ textureSet = renderer.GetTextures();
+ texture = textureSet.GetTexture(0);
+
+ DALI_TEST_EQUALS(controlSize.width * controlScale.width, texture.GetWidth(), TEST_LOCATION);
+ DALI_TEST_EQUALS(controlSize.height * controlScale.height, texture.GetHeight(), TEST_LOCATION);
+
+ // Size animation
+ controlSize = Vector2(50.0f, 100.0f);
+ Animation animation = Animation::New(1.0);
+ animation.AnimateTo(Property(actor, Actor::Property::SIZE), Vector3(controlSize.x, controlSize.y, 0.0f));
+ animation.Play();
+
+ application.SendNotification();
+ application.Render(1100); // After the animation
+
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
renderer = actor.GetRendererAt(0u);
DALI_TEST_CHECK(renderer);
application.GetScene().Add(actor2);
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 4 - load & render a frame for each instance
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
+
DevelControl::DoAction(actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map());
+ // To make event trigger
+ actor2.SetProperty(Actor::Property::SIZE, Vector2(10.0f, 10.0f));
+
application.SendNotification();
application.Render();
- std::this_thread::sleep_for(std::chrono::milliseconds(200));
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Property::Map attributes;
attributes.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME);
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
END_TEST;
}
-int UtcDaliAnimatedVectorImageVisualInvalidFile(void)
+int UtcDaliAnimatedVectorImageVisualInvalidFile01(void)
{
ToolkitTestApplication application;
tet_infoline("Request loading with invalid file - should draw broken image");
application.SendNotification();
application.Render();
+ // Trigger count is 1 - load
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ // Check resource status
+ Visual::ResourceStatus status = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
+ DALI_TEST_EQUALS(status, Visual::ResourceStatus::FAILED, TEST_LOCATION);
+
+ // The broken image should be shown.
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliAnimatedVectorImageVisualInvalidFile02(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request loading with invalid file - should draw broken image");
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ Property::Map propertyMap;
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME);
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+
+ 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);
+
+ application.SendNotification();
+ application.Render();
+
+ // Check resource status
+ Visual::ResourceStatus status = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
+ DALI_TEST_EQUALS(status, Visual::ResourceStatus::FAILED, TEST_LOCATION);
+
+ // The broken image should be shown.
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliAnimatedVectorImageVisualInvalidFile03(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("Request loading with invalid file without size set - should draw broken image");
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
+
+ Property::Map propertyMap;
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME);
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ 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 - load
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
// Check resource status
Visual::ResourceStatus status = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
DALI_TEST_EQUALS(status, Visual::ResourceStatus::FAILED, TEST_LOCATION);
application.GetScene().Add(actor);
+ application.SendNotification();
+ application.Render();
+
+ // Trigger count is 2 - load, render the first frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
Property::Value* value = map.Find(DevelImageVisual::Property::TOTAL_FRAME_NUMBER);
int totalFrameNumber = value->Get<int>();
application.SendNotification();
application.Render();
- // Trigger count is 2 - render the first frame & calculating frame drops
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+ // Trigger count is 1 - calculating frame drops
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// Check dropped frame
uint32_t frames = Test::VectorAnimationRenderer::GetDroppedFrames();
END_TEST;
}
+
+int UtcDaliAnimatedVectorImageVisualSize(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliAnimatedVectorImageVisualSize");
+
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base visual = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
+ 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();
+
+ // Trigger count is 2 - load, resource ready
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+
+ textureTrace.Enable(true);
+
+ application.SendNotification();
+ application.Render();
+
+ {
+ int width = 100, height = 100; // 100x100 is the content default size.
+ std::stringstream out;
+ out << GL_TEXTURE_2D << ", " << 0u << ", " << width << ", " << height;
+ DALI_TEST_CHECK(textureTrace.FindMethodAndParams("TexImage2D", out.str().c_str()));
+ }
+
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+
+ 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();
+
+ {
+ int width = 200, height = 200;
+ std::stringstream out;
+ out << GL_TEXTURE_2D << ", " << 0u << ", " << width << ", " << height;
+ DALI_TEST_CHECK(textureTrace.FindMethodAndParams("TexImage2D", out.str().c_str()));
+ }
+
+ END_TEST;
+}
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/canvas-view/canvas-view.h>
#include <dali-toolkit/internal/controls/canvas-view/canvas-view-rasterize-thread.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/public-api/images/pixel-data.h>
using namespace Dali;
tet_printf("test %s [sync:%d] signal fired\n", url.c_str(), isSynchronous ? 1 : 0);
DALI_TEST_EQUALS(gResourceReadySignalCounter, 1, location);
- DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(Toolkit::ImageView::Property::IMAGE), loadSuccess ? Toolkit::Visual::ResourceStatus::READY : Toolkit::Visual::ResourceStatus::FAILED, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(Toolkit::ImageView::Property::IMAGE), loadSuccess ? Toolkit::Visual::ResourceStatus::READY : Toolkit::Visual::ResourceStatus::FAILED, location);
imageView.Unparent();
};
TestResourceReadyUrl(1, 0, 1, TEST_BROKEN_IMAGE_L, "", TEST_LOCATION);
TestResourceReadyUrl(2, 0, 1, TEST_GIF_FILE_NAME, "", TEST_LOCATION); // 2 image loading - batch size
- TestResourceReadyUrl(1, 0, 1, TEST_ANIMATED_VECTOR_IMAGE_FILE_NAME, "", TEST_LOCATION); // 1 rasterize
+ TestResourceReadyUrl(2, 0, 1, TEST_ANIMATED_VECTOR_IMAGE_FILE_NAME, "", TEST_LOCATION); // load & rasterize
TestResourceReadyUrl(3, 0, 1, gImage_600_RGB, gImage_34_RGBA, TEST_LOCATION); // 2 image loading + 1 applymask
TestResourceReadyUrl(1, 0, 0, "invalid.svg", "", TEST_LOCATION);
TestResourceReadyUrl(1, 0, 0, "invalid.9.png", "", TEST_LOCATION);
TestResourceReadyUrl(1, 0, 0, "invalid.gif", "", TEST_LOCATION); // 1 image loading
- TestResourceReadyUrl(0, 0, 0, "invalid.json", "", TEST_LOCATION); // 0 rasterize
+ TestResourceReadyUrl(1, 0, 0, "invalid.json", "", TEST_LOCATION); // 0 rasterize
TestResourceReadyUrl(2, 0, 0, "invalid.jpg", "invalid.png", TEST_LOCATION); // 2 image loading
TestResourceReadyUrl(2, 0, 1, gImage_600_RGB, "invalid.png", TEST_LOCATION); // 2 image loading
TestResourceReadyUrl(0, 1, 1, TEST_SVG_FILE_NAME, "", TEST_LOCATION); // synchronous rasterize
TestResourceReadyUrl(0, 1, 1, TEST_BROKEN_IMAGE_L, "", TEST_LOCATION);
- TestResourceReadyUrl(1, 1, 1, TEST_GIF_FILE_NAME, "", TEST_LOCATION); // first frame image loading sync + second frame image loading async
- TestResourceReadyUrl(0, 1, 1, TEST_ANIMATED_VECTOR_IMAGE_FILE_NAME, "", TEST_LOCATION); // synchronous rasterize
+ TestResourceReadyUrl(1, 1, 1, TEST_GIF_FILE_NAME, "", TEST_LOCATION); // first frame image loading sync + second frame image loading async
TestResourceReadyUrl(0, 1, 1, gImage_600_RGB, gImage_34_RGBA, TEST_LOCATION);
TestResourceReadyUrl(0, 1, 0, "invalid.svg", "", TEST_LOCATION);
TestResourceReadyUrl(0, 1, 0, "invalid.9.png", "", TEST_LOCATION);
TestResourceReadyUrl(0, 1, 0, "invalid.gif", "", TEST_LOCATION);
- TestResourceReadyUrl(0, 1, 0, "invalid.json", "", TEST_LOCATION); // 0 rasterize
TestResourceReadyUrl(0, 1, 0, "invalid.jpg", "invalid.png", TEST_LOCATION);
TestResourceReadyUrl(0, 1, 1, gImage_600_RGB, "invalid.png", TEST_LOCATION);
const char* TEST_YUV420_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1-yuv420.jpg";
const char* TEST_N_PATCH_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/heartsframe.9.png";
-constexpr auto LOAD_IMAGE_YUV_PLANES_ENV = "DALI_LOAD_IMAGE_YUV_PLANES_ENV";
+constexpr auto LOAD_IMAGE_YUV_PLANES_ENV = "DALI_LOAD_IMAGE_YUV_PLANES";
+constexpr auto ENABLE_DECODE_JPEG_TO_YUV_420_ENV = "DALI_ENABLE_DECODE_JPEG_TO_YUV_420";
bool gResourceReadySignalFired = false;
std::vector<int> gReadyIds = {};
int UtcDaliImageVisualLoadImagePlanes01(void)
{
EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+ EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
ToolkitTestApplication application;
int UtcDaliImageVisualLoadImagePlanes02(void)
{
EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+ EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
ToolkitTestApplication application;
int UtcDaliImageVisualLoadImagePlanes03(void)
{
EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+ EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
ToolkitTestApplication application;
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
application.SendNotification();
application.Render();
- // Wait for image loading
- DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ // Trigger count is 2 - load & render a frame
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
#include <dali.h>
-#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
-#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
-#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-frame.h>
-#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
-#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
-#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
-#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
-#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-frame.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-request-interceptor.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-security-origin.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
#define DALI_TOOLKIT_CANVAS_VIEW_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/public-api/controls/control.h>
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
namespace Dali
{
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
namespace Dali
{
#define DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list-item.h>
#include <vector>
#include <memory>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/devel-api/controls/web-view/web-context.h>
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-security-origin.h>
namespace Dali
{
#define DALI_TOOLKIT_WEB_CONTEXT_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
#include <string>
// INTERNAL INCLUDES
#define DALI_TOOLKIT_WEB_COOKIE_MANAGER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
#include <string>
// INTERNAL INCLUDES
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h>
namespace Dali
{
#define DALI_TOOLKIT_WEB_VIEW_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
-#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-plugin.h>
namespace Dali
{
#include <dali-toolkit/internal/text/glyph-metrics-helper.h>
#include <dali-toolkit/internal/text/layouts/layout-engine.h>
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
-#include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
#include <dali-toolkit/internal/text/multi-language-support.h>
#include <dali-toolkit/internal/text/rendering/styles/character-spacing-helper-functions.h>
#include <dali-toolkit/internal/text/segmentation.h>
#define DALI_TOOLKIT_INTERNAL_CANVAS_VIEW_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/integration-api/processor-interface.h>
#define DALI_TOOLKIT_CANVAS_VIEW_RASTERIZE_THREAD_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer.h>
#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
#include <dali/devel-api/threading/conditional-wait.h>
#include <dali/devel-api/threading/mutex.h>
#define DALI_TOOLKIT_INTERNAL_TEXT_CONTROLS_COMMON_TEXT_UTILS_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali-toolkit/devel-api/controls/text-controls/text-anchor-devel.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-selectable-control-interface.h>
#include <dali-toolkit/internal/text/text-vertical-scroller.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
#include <dali-toolkit/internal/text/text-enumerations-impl.h>
#include <dali-toolkit/internal/text/text-font-style.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-selectable-control-interface.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/devel-api/text/rendering-backend.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
#include <dali-toolkit/internal/text/text-enumerations-impl.h>
#include <dali-toolkit/internal/text/text-font-style.h>
#include <dali-toolkit/internal/text/rendering/text-renderer.h>
#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-scroller-interface.h>
#include <dali-toolkit/internal/text/text-scroller.h>
#include <dali-toolkit/internal/visuals/text/text-visual.h>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include "web-view-impl.h"
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
-#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
-#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
-#include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
-#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
-#include <dali/devel-api/adaptor-framework/web-engine-http-auth-handler.h>
-#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
-#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
-#include <dali/devel-api/adaptor-framework/web-engine-settings.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-back-forward-list.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-certificate.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-console-message.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-context.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-form-repost-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-hit-test.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-http-auth-handler.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-load-error.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-policy-decision.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine-settings.h>
#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/scripting/enum-helper.h>
#include <dali/devel-api/scripting/scripting.h>
#define DALI_TOOLKIT_INTERNAL_WEB_VIEW_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// EXTERNAL INCLUDES
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/adaptor-framework/proxy-accessible.h>
-#include <dali/devel-api/adaptor-framework/web-engine.h>
+#include <dali/devel-api/adaptor-framework/web-engine/web-engine.h>
#include <dali/public-api/images/image-operations.h>
#include <dali/public-api/object/property-notification.h>
#include <memory>
${toolkit_src_dir}/visuals/primitive/primitive-visual.cpp
${toolkit_src_dir}/visuals/svg/svg-rasterize-thread.cpp
${toolkit_src_dir}/visuals/svg/svg-visual.cpp
+ ${toolkit_src_dir}/visuals/text-visual-shader-factory.cpp
${toolkit_src_dir}/visuals/text/text-visual.cpp
${toolkit_src_dir}/visuals/transition-data-impl.cpp
${toolkit_src_dir}/visuals/image-visual-shader-factory.cpp
${toolkit_src_dir}/text/cursor-helper-functions.cpp
${toolkit_src_dir}/text/glyph-metrics-helper.cpp
${toolkit_src_dir}/text/logical-model-impl.cpp
- ${toolkit_src_dir}/text/markup-processor.cpp
- ${toolkit_src_dir}/text/markup-processor-color.cpp
- ${toolkit_src_dir}/text/markup-processor-embedded-item.cpp
- ${toolkit_src_dir}/text/markup-processor-anchor.cpp
- ${toolkit_src_dir}/text/markup-processor-font.cpp
- ${toolkit_src_dir}/text/markup-processor-background.cpp
- ${toolkit_src_dir}/text/markup-processor-paragraph.cpp
- ${toolkit_src_dir}/text/markup-processor-span.cpp
- ${toolkit_src_dir}/text/markup-processor-strikethrough.cpp
- ${toolkit_src_dir}/text/markup-processor-underline.cpp
- ${toolkit_src_dir}/text/markup-processor-character-spacing.cpp
- ${toolkit_src_dir}/text/markup-processor-helper-functions.cpp
- ${toolkit_src_dir}/text/markup-processor-attribute-helper-functions.cpp
${toolkit_src_dir}/text/multi-language-support.cpp
${toolkit_src_dir}/text/hidden-text.cpp
${toolkit_src_dir}/text/input-filter.cpp
${toolkit_src_dir}/text/shaper.cpp
${toolkit_src_dir}/text/hyphenator.cpp
${toolkit_src_dir}/text/text-enumerations-impl.cpp
- ${toolkit_src_dir}/text/text-controller.cpp
- ${toolkit_src_dir}/text/text-controller-background-actor.cpp
- ${toolkit_src_dir}/text/text-controller-event-handler.cpp
- ${toolkit_src_dir}/text/text-controller-impl.cpp
- ${toolkit_src_dir}/text/text-controller-impl-data-clearer.cpp
- ${toolkit_src_dir}/text/text-controller-impl-event-handler.cpp
- ${toolkit_src_dir}/text/text-controller-impl-model-updater.cpp
- ${toolkit_src_dir}/text/text-controller-input-font-handler.cpp
- ${toolkit_src_dir}/text/text-controller-input-properties.cpp
- ${toolkit_src_dir}/text/text-controller-placeholder-handler.cpp
- ${toolkit_src_dir}/text/text-controller-relayouter.cpp
- ${toolkit_src_dir}/text/text-controller-text-updater.cpp
${toolkit_src_dir}/text/text-effects-style.cpp
${toolkit_src_dir}/text/text-font-style.cpp
${toolkit_src_dir}/text/text-io.cpp
${toolkit_src_dir}/text/text-view-interface.cpp
${toolkit_src_dir}/text/visual-model-impl.cpp
${toolkit_src_dir}/text/decorator/text-decorator.cpp
+ ${toolkit_src_dir}/text/controller/text-controller.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-background-actor.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-event-handler.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-impl.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-impl-data-clearer.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-impl-event-handler.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-impl-model-updater.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-input-font-handler.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-input-properties.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-placeholder-handler.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-relayouter.cpp
+ ${toolkit_src_dir}/text/controller/text-controller-text-updater.cpp
${toolkit_src_dir}/text/layouts/layout-engine-helper-functions.cpp
${toolkit_src_dir}/text/layouts/layout-engine.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-color.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-embedded-item.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-anchor.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-font.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-background.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-paragraph.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-span.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-strikethrough.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-underline.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-character-spacing.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-helper-functions.cpp
+ ${toolkit_src_dir}/text/markup-processor/markup-processor-attribute-helper-functions.cpp
${toolkit_src_dir}/text/multi-language-helper-functions.cpp
${toolkit_src_dir}/text/multi-language-support-impl.cpp
${toolkit_src_dir}/text/rendering/text-backend.cpp
+++ /dev/null
-varying mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-
-void main()
-{
- mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
-
- gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );
-}
+++ /dev/null
-varying mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform sampler2D sStyle;
-uniform sampler2D sOverlayStyle;
-uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-
-void main()
-{
- mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
- mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );
- mediump vec4 overlayStyleTexture = texture2D( sOverlayStyle, vTexCoord );
-
- // Draw the text as overlay above the style
- gl_FragColor = ( overlayStyleTexture + textTexture * (1.0 - overlayStyleTexture.a) + styleTexture * ( 1.0 - textTexture.a ) * (1.0 - overlayStyleTexture.a) ) * uColor * vec4( mixColor, 1.0 );
-}
--- /dev/null
+INPUT mediump vec2 vTexCoord;
+uniform sampler2D sTexture;
+#ifdef IS_REQUIRED_STYLE
+uniform sampler2D sStyle;
+#endif
+#ifdef IS_REQUIRED_OVERLAY
+uniform sampler2D sOverlayStyle;
+#endif
+#ifdef IS_REQUIRED_MULTI_COLOR
+#elif defined(IS_REQUIRED_EMOJI)
+// Single color with emoji.
+uniform sampler2D sMask;
+uniform lowp float uHasMultipleTextColors;
+#endif
+uniform lowp vec4 uTextColorAnimatable;
+uniform lowp vec4 uColor;
+uniform lowp vec3 mixColor;
+
+void main()
+{
+#ifdef IS_REQUIRED_STYLE
+ mediump vec4 styleTexture = TEXTURE( sStyle, vTexCoord );
+#endif
+
+#ifdef IS_REQUIRED_OVERLAY
+ mediump vec4 overlayStyleTexture = TEXTURE( sOverlayStyle, vTexCoord );
+#endif
+
+#if defined(IS_REQUIRED_MULTI_COLOR) || defined(IS_REQUIRED_EMOJI)
+ // Multiple color or use emoji.
+ mediump vec4 textColor = TEXTURE(sTexture, vTexCoord);
+
+#ifdef IS_REQUIRED_MULTI_COLOR
+#elif defined(IS_REQUIRED_EMOJI)
+ // Single color with emoji.
+ mediump float maskTexture = TEXTURE(sMask, vTexCoord).r;
+
+ // Set the color of non-transparent pixel in text to what it is animated to.
+ // Markup text with multiple text colors are not animated (but can be supported later on if required).
+ // Emoji color are not animated.
+ mediump float vstep = step( 0.0001, textColor.a );
+ textColor.rgb = mix(textColor.rgb, uTextColorAnimatable.rgb, vstep * maskTexture * (1.0 - uHasMultipleTextColors));
+#endif
+#else
+ // Single color without emoji.
+ mediump float textTexture = TEXTURE(sTexture, vTexCoord).r;
+ mediump vec4 textColor = uTextColorAnimatable * textTexture;
+#endif
+
+ // Draw the text as overlay above the style
+ OUT_COLOR = uColor * vec4(mixColor, 1.0) * (
+#ifdef IS_REQUIRED_OVERLAY
+ (
+#endif
+ textColor
+#ifdef IS_REQUIRED_STYLE
+ + styleTexture * (1.0 - textColor.a)
+#endif
+#ifdef IS_REQUIRED_OVERLAY
+ ) * (1.0 - overlayStyleTexture.a) + overlayStyleTexture
+#endif
+ );
+}
-attribute mediump vec2 aPosition;
+INPUT mediump vec2 aPosition;
uniform highp mat4 uMvpMatrix;
uniform highp vec3 uSize;
uniform mediump vec4 pixelArea;
-varying mediump vec2 vTexCoord;
+OUTPUT mediump vec2 vTexCoord;
//Visual size and offset
uniform mediump vec2 offset;
+++ /dev/null
-varying mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform lowp vec4 uTextColorAnimatable;
-uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-
-void main()
-{
- mediump float textTexture = texture2D( sTexture, vTexCoord ).r;
-
- // Set the color of the text to what it is animated to.
- gl_FragColor = uTextColorAnimatable * textTexture * uColor * vec4( mixColor, 1.0 );
-}
+++ /dev/null
-varying mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform sampler2D sMask;
-uniform lowp vec4 uTextColorAnimatable;
-uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-
-void main()
-{
- mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
- mediump float maskTexture = texture2D( sMask, vTexCoord ).r;
-
- // Set the color of non-transparent pixel in text to what it is animated to.
- // Markup text with multiple text colors are not animated (but can be supported later on if required).
- // Emoji color are not animated.
- mediump float vstep = step( 0.0001, textTexture.a );
- textTexture.rgb = mix( textTexture.rgb, uTextColorAnimatable.rgb, vstep * maskTexture );
-
- // Draw the text as overlay above the style
- gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );
-}
+++ /dev/null
-varying mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform sampler2D sStyle;
-uniform sampler2D sOverlayStyle;
-uniform sampler2D sMask;
-uniform lowp float uHasMultipleTextColors;
-uniform lowp vec4 uTextColorAnimatable;
-uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-
-void main()
-{
- mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
- mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );
- mediump vec4 overlayStyleTexture = texture2D( sOverlayStyle, vTexCoord );
- mediump float maskTexture = texture2D( sMask, vTexCoord ).r;
-
- // Set the color of non-transparent pixel in text to what it is animated to.
- // Markup text with multiple text colors are not animated (but can be supported later on if required).
- // Emoji color are not animated.
- mediump float vstep = step( 0.0001, textTexture.a );
- textTexture.rgb = mix( textTexture.rgb, uTextColorAnimatable.rgb, vstep * maskTexture * ( 1.0 - uHasMultipleTextColors ) );
-
- // Draw the text as overlay above the style
- gl_FragColor = ( overlayStyleTexture + textTexture * (1.0 - overlayStyleTexture.a) + styleTexture * ( 1.0 - textTexture.a ) * (1.0 - overlayStyleTexture.a) ) * uColor * vec4( mixColor, 1.0 );
-}
+++ /dev/null
-varying mediump vec2 vTexCoord;
-uniform sampler2D sTexture;
-uniform sampler2D sStyle;
-uniform sampler2D sOverlayStyle;
-uniform lowp vec4 uTextColorAnimatable;
-uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-
-void main()
-{
- mediump float textTexture = texture2D( sTexture, vTexCoord ).r;
- mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );
- mediump vec4 overlayStyleTexture = texture2D( sOverlayStyle, vTexCoord );
-
- // Draw the text as overlay above the style
- gl_FragColor = ( overlayStyleTexture + uTextColorAnimatable * textTexture * (1.0 - overlayStyleTexture.a) + styleTexture * ( 1.0 - uTextColorAnimatable.a * textTexture ) * (1.0 - overlayStyleTexture.a) ) * uColor * vec4( mixColor, 1.0 );
-}
\ No newline at end of file
*/
// HEADER
-#include <dali-toolkit/internal/text/text-controller-background-actor.h>
+#include <dali-toolkit/internal/text/controller/text-controller-background-actor.h>
// EXTERNAL INCLUDES
#include <dali/public-api/rendering/renderer.h>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-event-handler.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller-placeholder-handler.h>
-#include <dali-toolkit/internal/text/text-controller-text-updater.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-text-updater.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
namespace
#define DALI_TOOLKIT_TEXT_CONTROLLER_EVENT_HANDLER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
-#include <dali-toolkit/internal/text/text-controller.h>
namespace Dali
{
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-impl-data-clearer.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-data-clearer.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
#include <dali-toolkit/internal/text/text-run-container.h>
namespace Dali::Toolkit::Text
#define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_DATA_CLEARER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
namespace Dali::Toolkit::Text
{
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-impl-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-event-handler.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_EVENT_HANDLER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
namespace Dali
{
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-impl-model-updater.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-model-updater.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_MODEL_UPDATER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
namespace Dali::Toolkit::Text
{
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
#include <dali-toolkit/internal/text/glyph-metrics-helper.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
-#include <dali-toolkit/internal/text/text-controller-impl-data-clearer.h>
-#include <dali-toolkit/internal/text/text-controller-impl-event-handler.h>
-#include <dali-toolkit/internal/text/text-controller-impl-model-updater.h>
-#include <dali-toolkit/internal/text/text-controller-placeholder-handler.h>
-#include <dali-toolkit/internal/text/text-controller-relayouter.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-data-clearer.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-model-updater.h>
+#include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-relayouter.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-enumerations-impl.h>
#include <dali-toolkit/internal/text/text-run-container.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
#include <dali-toolkit/internal/text/input-style.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-model.h>
#include <dali-toolkit/internal/text/text-view.h>
#include <dali-toolkit/public-api/styling/style-manager.h>
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-input-font-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-input-font-handler.h>
// EXTERNAL INCLUDES
#include <memory.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
namespace Dali
{
#define DALI_TOOLKIT_TEXT_CONTROLLER_INPUT_FONT_HANDLER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <string>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-definitions.h>
namespace Dali
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-input-properties.h>
+#include <dali-toolkit/internal/text/controller/text-controller-input-properties.h>
// EXTERNAL INCLUDES
//#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
-#include <dali-toolkit/internal/text/text-controller-event-handler.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller-input-font-handler.h>
-#include <dali-toolkit/internal/text/text-controller-placeholder-handler.h>
-#include <dali-toolkit/internal/text/text-controller-relayouter.h>
-#include <dali-toolkit/internal/text/text-controller-text-updater.h>
+#include <dali-toolkit/internal/text/controller/text-controller-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-input-font-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-relayouter.h>
+#include <dali-toolkit/internal/text/controller/text-controller-text-updater.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
namespace
#define DALI_TOOLKIT_TEXT_CONTROLLER_INPUT_PROPERTIES_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali/public-api/events/gesture.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
-//#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
-//#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
-//#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
-//#include <dali-toolkit/internal/text/decorator/text-decorator.h>
-//#include <dali-toolkit/internal/text/hidden-text.h>
-//#include <dali-toolkit/internal/text/input-filter.h>
-//#include <dali-toolkit/internal/text/layouts/layout-engine.h>
-//#include <dali-toolkit/internal/text/text-anchor-control-interface.h>
-//#include <dali-toolkit/internal/text/text-model-interface.h>
-//#include <dali-toolkit/internal/text/text-selectable-control-interface.h>
-//#include <dali-toolkit/public-api/text/text-enumerations.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
namespace Dali::Toolkit::Text
{
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/character-set-conversion.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
#include <dali-toolkit/internal/text/text-font-style.h>
#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
#define DALI_TOOLKIT_TEXT_CONTROLLER_PLACEHOLDER_HANDLER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali/public-api/object/property-map.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/text-definitions.h>
namespace Dali
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-relayouter.h>
+#include <dali-toolkit/internal/text/controller/text-controller-relayouter.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/layouts/layout-parameters.h>
-#include <dali-toolkit/internal/text/text-controller-event-handler.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
namespace
{
#define DALI_TOOLKIT_TEXT_CONTROLLER_RELAYOUTER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali/public-api/math/vector3.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
namespace Dali
{
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller-text-updater.h>
+#include <dali-toolkit/internal/text/controller/text-controller-text-updater.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali-toolkit/internal/text/character-set-conversion.h>
#include <dali-toolkit/internal/text/characters-helper-functions.h>
#include <dali-toolkit/internal/text/emoji-helper.h>
-#include <dali-toolkit/internal/text/markup-processor.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
namespace
UpdateInputStyleType type)
{
bool removed = false;
+ bool removeAll = false;
Controller::Impl& impl = *controller.mImpl;
EventData*& eventData = impl.mEventData;
numberOfCharacters = currentText.Count() - cursorIndex;
}
+ if((cursorIndex == 0) && (currentText.Count() - numberOfCharacters == 0))
+ {
+ removeAll = true;
+ }
+
TextUpdateInfo& textUpdateInfo = impl.mTextUpdateInfo;
- if(eventData->mPreEditFlag || // If the preedit flag is enabled, it means two (or more) of them came together i.e. when two keys have been pressed at the same time.
+ if(eventData->mPreEditFlag || removeAll || // If the preedit flag is enabled, it means two (or more) of them came together i.e. when two keys have been pressed at the same time.
((cursorIndex + numberOfCharacters) <= textUpdateInfo.mPreviousNumberOfCharacters))
{
// Mark the paragraphs to be updated.
// If the number of current text and the number of characters to be deleted are same,
// it means all texts should be removed and all Preedit variables should be initialized.
- if((currentText.Count() - numberOfCharacters == 0) && (cursorIndex == 0))
+ if(removeAll)
{
impl.ClearPreEditFlag();
textUpdateInfo.mNumberOfCharactersToAdd = 0;
}
DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", &controller, numberOfCharacters);
+ removeAll = false;
removed = true;
}
}
#define DALI_TOOLKIT_TEXT_UPDATER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <string>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
namespace Dali
{
*/
// CLASS HEADER
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
// EXTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
-#include <dali-toolkit/internal/text/text-controller-background-actor.h>
-#include <dali-toolkit/internal/text/text-controller-event-handler.h>
-#include <dali-toolkit/internal/text/text-controller-impl.h>
-#include <dali-toolkit/internal/text/text-controller-input-font-handler.h>
-#include <dali-toolkit/internal/text/text-controller-input-properties.h>
-#include <dali-toolkit/internal/text/text-controller-placeholder-handler.h>
-#include <dali-toolkit/internal/text/text-controller-relayouter.h>
-#include <dali-toolkit/internal/text/text-controller-text-updater.h>
+#include <dali-toolkit/internal/text/controller/text-controller-background-actor.h>
+#include <dali-toolkit/internal/text/controller/text-controller-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-input-font-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-input-properties.h>
+#include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-relayouter.h>
+#include <dali-toolkit/internal/text/controller/text-controller-text-updater.h>
#include <dali-toolkit/internal/text/text-editable-control-interface.h>
#include <dali-toolkit/internal/text/text-geometry.h>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-anchor.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-anchor.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/anchor.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_ANCHOR_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-attribute-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
// EXTERNAL INCLUDES
#include <memory.h>
#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_ATTRIBUTE_HELPER_FUNCTIONS_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-background.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-background.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/color-run.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_BACKGROUND_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-character-spacing.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-character-spacing.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/character-spacing-character-run.h>
-#include <dali-toolkit/internal/text/markup-processor-attribute-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-color.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-color.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/color-run.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_COLOR_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-embedded-item.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-embedded-item.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/embedded-item.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_EMBEDDED_ITEM_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-font.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-font.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/font-description-run.h>
-#include <dali-toolkit/internal/text/markup-processor-attribute-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
#include <dali-toolkit/internal/text/text-font-style.h>
#define DALI_TOOLKIT_TEXT_MARKUP_PROCESSOR_FONT_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/constants.h>
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-paragraph.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-paragraph.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/bounded-paragraph-run.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-color.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-color.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/color-run.h>
#include <dali-toolkit/internal/text/font-description-run.h>
-#include <dali-toolkit/internal/text/markup-processor-character-spacing.h>
-#include <dali-toolkit/internal/text/markup-processor-font.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor-strikethrough.h>
-#include <dali-toolkit/internal/text/markup-processor-underline.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-character-spacing.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-font.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-strikethrough.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-underline.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-strikethrough.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-strikethrough.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/markup-processor-attribute-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
#include <dali-toolkit/internal/text/strikethrough-character-run.h>
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor-underline.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-underline.h>
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/markup-processor-attribute-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
#include <dali-toolkit/internal/text/underlined-character-run.h>
*/
// FILE HEADER
-#include <dali-toolkit/internal/text/markup-processor.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/character-set-conversion.h>
-#include <dali-toolkit/internal/text/markup-processor-anchor.h>
-#include <dali-toolkit/internal/text/markup-processor-background.h>
-#include <dali-toolkit/internal/text/markup-processor-character-spacing.h>
-#include <dali-toolkit/internal/text/markup-processor-color.h>
-#include <dali-toolkit/internal/text/markup-processor-embedded-item.h>
-#include <dali-toolkit/internal/text/markup-processor-font.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
-#include <dali-toolkit/internal/text/markup-processor-paragraph.h>
-#include <dali-toolkit/internal/text/markup-processor-span.h>
-#include <dali-toolkit/internal/text/markup-processor-strikethrough.h>
-#include <dali-toolkit/internal/text/markup-processor-underline.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-anchor.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-background.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-character-spacing.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-color.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-embedded-item.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-font.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-paragraph.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-span.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-strikethrough.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-underline.h>
#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
#include <dali-toolkit/internal/text/xhtml-entities.h>
markupProcessData.characterSpacingCharacterRuns.Resize(characterSpacingCharacterRunIndex);
#ifdef DEBUG_ENABLED
- for(uint32_t i = 0; gLogFilter->IsEnabledFor(Debug::Verbose) && i < colorRunIndex; ++i)
+ if(gLogFilter->IsEnabledFor(Debug::Verbose))
{
- ColorRun& run = markupProcessData.colorRuns[i];
- DALI_LOG_INFO(gLogFilter, Debug::Verbose, "run[%d] index: %d, length: %d, color %f,%f,%f,%f\n", i, run.characterRun.characterIndex, run.characterRun.numberOfCharacters, run.color.r, run.color.g, run.color.b, run.color.a);
+ for(uint32_t i = 0; i < colorRunIndex; ++i)
+ {
+ ColorRun& run = markupProcessData.colorRuns[i];
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "run[%d] index: %d, length: %d, color %f,%f,%f,%f\n", i, run.characterRun.characterIndex, run.characterRun.numberOfCharacters, run.color.r, run.color.g, run.color.b, run.color.a);
+ }
}
#endif
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/builder/json-parser.h>
#include <dali-toolkit/devel-api/builder/tree-node.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
namespace Dali
{
Toolkit::AtlasGlyphManager::Metrics metrics = mGlyphManager.GetMetrics();
DALI_LOG_INFO(gLogFilter, Debug::General, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n", metrics.mGlyphCount, metrics.mAtlasMetrics.mAtlasCount, metrics.mAtlasMetrics.mTextureMemoryUsed / 1024);
- DALI_LOG_INFO(gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str());
-
- for(uint32_t i = 0; gLogFilter->IsEnabledFor(Debug::Verbose) && i < metrics.mAtlasMetrics.mAtlasCount; ++i)
+ if(gLogFilter->IsEnabledFor(Debug::Verbose))
{
- DALI_LOG_INFO(gLogFilter, Debug::Verbose, " Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n", i + 1, i > 8 ? "" : " ", metrics.mAtlasMetrics.mAtlasMetrics[i].mPixelFormat == Pixel::L8 ? "L8 " : "BGRA", metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mBlocksUsed, metrics.mAtlasMetrics.mAtlasMetrics[i].mTotalBlocks);
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str());
+
+ for(uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i)
+ {
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, " Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n", i + 1, i > 8 ? "" : " ", metrics.mAtlasMetrics.mAtlasMetrics[i].mPixelFormat == Pixel::L8 ? "L8 " : "BGRA", metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mBlocksUsed, metrics.mAtlasMetrics.mAtlasMetrics[i].mTotalBlocks);
+ }
}
#endif
}
CombineImageBuffer(imageBuffer, outlineImageBuffer, bufferWidth, bufferHeight, true);
}
- // @todo. Support shadow and underline for partial text later on.
+ // @todo. Support shadow for partial text later on.
// Generate the shadow if enabled
const Vector2& shadowOffset = mModel->GetShadowOffset();
CombineImageBuffer(imageBuffer, shadowImageBuffer, bufferWidth, bufferHeight, true);
}
- // Generate the underline if enabled
- const bool underlineEnabled = mModel->IsUnderlineEnabled();
- if(underlineEnabled && RENDER_OVERLAY_STYLE == behaviour)
- {
- // Create the image buffer for underline
- Devel::PixelBuffer underlineImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_UNDERLINE, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs);
-
- // Combine the two buffers
- CombineImageBuffer(imageBuffer, underlineImageBuffer, bufferWidth, bufferHeight, true);
- }
-
// Generate the background if enabled
const bool backgroundEnabled = mModel->IsBackgroundEnabled();
const bool backgroundMarkupSet = mModel->IsMarkupBackgroundColorSet();
CombineImageBuffer(imageBuffer, backgroundImageBuffer, bufferWidth, bufferHeight, true);
}
- // Generate the strikethrough if enabled
- const bool strikethroughEnabled = mModel->IsStrikethroughEnabled();
- if(strikethroughEnabled && RENDER_OVERLAY_STYLE == behaviour)
+ if(RENDER_OVERLAY_STYLE == behaviour)
{
- // Create the image buffer for strikethrough
- Devel::PixelBuffer strikethroughImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_STRIKETHROUGH, ignoreHorizontalAlignment, pixelFormat, penX, penY, 0u, endIndexOfGlyphs);
+ if(mModel->IsUnderlineEnabled())
+ {
+ // Create the image buffer for underline
+ Devel::PixelBuffer underlineImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_UNDERLINE, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs);
- // Combine the two buffers
- CombineImageBuffer(imageBuffer, strikethroughImageBuffer, bufferWidth, bufferHeight, true);
- }
+ // Combine the two buffers
+ CombineImageBuffer(imageBuffer, underlineImageBuffer, bufferWidth, bufferHeight, true);
+ }
+
+ if(mModel->IsStrikethroughEnabled())
+ {
+ // Create the image buffer for strikethrough
+ Devel::PixelBuffer strikethroughImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_STRIKETHROUGH, ignoreHorizontalAlignment, pixelFormat, penX, penY, 0u, endIndexOfGlyphs);
- // Markup-Processor
+ // Combine the two buffers
+ CombineImageBuffer(imageBuffer, strikethroughImageBuffer, bufferWidth, bufferHeight, true);
+ }
+
+ // Markup-Processor for overlay styles
+ if(mModel->IsMarkupProcessorEnabled())
+ {
+ if(mModel->IsMarkupUnderlineSet())
+ {
+ imageBuffer = ApplyUnderlineMarkupImageBuffer(imageBuffer, bufferWidth, bufferHeight, ignoreHorizontalAlignment, pixelFormat, penX, penY);
+ }
- imageBuffer = ApplyMarkupProcessorOnPixelBuffer(imageBuffer, bufferWidth, bufferHeight, ignoreHorizontalAlignment, pixelFormat, penX, penY);
+ if(mModel->IsMarkupStrikethroughSet())
+ {
+ imageBuffer = ApplyStrikethroughMarkupImageBuffer(imageBuffer, bufferWidth, bufferHeight, ignoreHorizontalAlignment, pixelFormat, penX, penY);
+ }
+ }
+ }
}
// Create the final PixelData for the combined image buffer
return topPixelBuffer;
}
-Devel::PixelBuffer Typesetter::ApplyMarkupProcessorOnPixelBuffer(Devel::PixelBuffer topPixelBuffer, const uint32_t bufferWidth, const uint32_t bufferHeight, const bool ignoreHorizontalAlignment, const Pixel::Format pixelFormat, const int32_t horizontalOffset, const int32_t verticalOffset)
-{
- // Apply the markup-Processor if enabled
- const bool markupProcessorEnabled = mModel->IsMarkupProcessorEnabled();
- if(markupProcessorEnabled)
- {
- topPixelBuffer = ApplyUnderlineMarkupImageBuffer(topPixelBuffer, bufferWidth, bufferHeight, ignoreHorizontalAlignment, pixelFormat, horizontalOffset, verticalOffset);
-
- topPixelBuffer = ApplyStrikethroughMarkupImageBuffer(topPixelBuffer, bufferWidth, bufferHeight, ignoreHorizontalAlignment, pixelFormat, horizontalOffset, verticalOffset);
- }
-
- return topPixelBuffer;
-}
-
Typesetter::Typesetter(const ModelInterface* const model)
: mModel(new ViewModel(model))
{
Devel::PixelBuffer CreateImageBuffer(const uint32_t bufferWidth, const uint32_t bufferHeight, const Typesetter::Style style, const bool ignoreHorizontalAlignment, const Pixel::Format pixelFormat, const int32_t horizontalOffset, const int32_t verticalOffset, const TextAbstraction::GlyphIndex fromGlyphIndex, const TextAbstraction::GlyphIndex toGlyphIndex);
/**
- * @brief Apply behaviour of tags if the markup-processor is enabled.
- *
- * @param[in] topPixelBuffer The top layer buffer.
- * @param[in] bufferWidth The width of the image buffer.
- * @param[in] bufferHeight The height of the image buffer.
- * @param[in] ignoreHorizontalAlignment Whether to ignore the horizontal alignment, not ignored by default.
- * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8).
- * @param[in] horizontalOffset The horizontal offset to be added to the glyph's position.
- * @param[in] verticalOffset The vertical offset to be added to the glyph's position.
- *
- * @return The image buffer with the markup.
- */
- Devel::PixelBuffer ApplyMarkupProcessorOnPixelBuffer(Devel::PixelBuffer topPixelBuffer, const uint32_t bufferWidth, const uint32_t bufferHeight, const bool ignoreHorizontalAlignment, const Pixel::Format pixelFormat, const int32_t horizontalOffset, const int32_t verticalOffset);
-
- /**
* @brief Apply markup underline tags.
*
* The properties on TextLabel override the behavior of Markup.
return mModel->IsUnderlineEnabled();
}
+bool const ViewModel::IsMarkupUnderlineSet() const
+{
+ return mModel->IsMarkupUnderlineSet();
+}
+
float ViewModel::GetUnderlineHeight() const
{
return mModel->GetUnderlineHeight();
return mModel->IsStrikethroughEnabled();
}
+bool const ViewModel::IsMarkupStrikethroughSet() const
+{
+ return mModel->IsMarkupStrikethroughSet();
+}
+
Length ViewModel::GetNumberOfStrikethroughRuns() const
{
return mModel->GetNumberOfStrikethroughRuns();
bool IsUnderlineEnabled() const override;
/**
+ * @copydoc ModelInterface::IsMarkupUnderlineSet()
+ */
+ bool const IsMarkupUnderlineSet() const override;
+
+ /**
* @copydoc ModelInterface::GetUnderlineHeight()
*/
float GetUnderlineHeight() const override;
*/
void ElideGlyphs();
+ /**
+ * @copydoc ModelInterface::GetStrikethroughHeight()
+ */
float GetStrikethroughHeight() const override;
+ /**
+ * @copydoc ModelInterface::GetStrikethroughColor()
+ */
const Vector4& GetStrikethroughColor() const override;
+ /**
+ * @copydoc ModelInterface::IsStrikethroughEnabled()
+ */
bool IsStrikethroughEnabled() const override;
/**
+ * @copydoc ModelInterface::IsMarkupStrikethroughSet()
+ */
+ bool const IsMarkupStrikethroughSet() const override;
+
+ /**
* @copydoc ModelInterface::GetNumberOfStrikethroughRuns()
*/
Length GetNumberOfStrikethroughRuns() const override;
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/text-controls/text-style-properties-devel.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/property-string-parser.h>
#include <dali-toolkit/internal/text/text-enumerations-impl.h>
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/public-api/text/text-enumerations.h>
#include <dali/devel-api/scripting/scripting.h>
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/property-string-parser.h>
namespace Dali
#define DALI_TOOLKIT_INTERNAL_TEXT_FONT_STYLE_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
#include <dali/devel-api/scripting/scripting.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
namespace Dali
{
virtual bool IsUnderlineEnabled() const = 0;
/**
+ * @brief checks if there is underline set using markup.
+ *
+ * @return boolean if there is underline set using markup.
+ */
+ virtual bool const IsMarkupUnderlineSet() const = 0;
+
+ /**
* @brief Retrieves the underline height override
*
* @return Returns the override height for an underline, 0 indicates that adaptor will determine the height
virtual bool IsStrikethroughEnabled() const = 0;
/**
+ * @brief checks if there is strikethrough set using markup.
+ *
+ * @return boolean if there is strikethrough set using markup.
+ */
+ virtual bool const IsMarkupStrikethroughSet() const = 0;
+
+ /**
* @brief Retrieves the strikethrough height override
*
* @return Returns the override height for a strikethrough, 0 indicates that adaptor will determine the height
return mVisualModel->IsUnderlineEnabled();
}
+bool const Model::IsMarkupUnderlineSet() const
+{
+ return (mVisualModel->mUnderlineRuns.Count() > 0u);
+}
+
float Model::GetUnderlineHeight() const
{
return mVisualModel->GetUnderlineHeight();
return mVisualModel->IsStrikethroughEnabled();
}
+bool const Model::IsMarkupStrikethroughSet() const
+{
+ return (mVisualModel->mStrikethroughRuns.Count() > 0u);
+}
+
float Model::GetStrikethroughHeight() const
{
return mVisualModel->GetStrikethroughHeight();
bool IsUnderlineEnabled() const override;
/**
+ * @copydoc ModelInterface::IsMarkupUnderlineSet()
+ */
+ bool const IsMarkupUnderlineSet() const override;
+
+ /**
* @copydoc ModelInterface::GetUnderlineHeight()
*/
float GetUnderlineHeight() const override;
*/
Length GetHyphensCount() const override;
+ /**
+ * @copydoc ModelInterface::GetStrikethroughHeight()
+ */
float GetStrikethroughHeight() const override;
+ /**
+ * @copydoc ModelInterface::GetStrikethroughColor()
+ */
const Vector4& GetStrikethroughColor() const override;
+ /**
+ * @copydoc ModelInterface::IsStrikethroughEnabled()
+ */
bool IsStrikethroughEnabled() const override;
+
+ /**
+ * @copydoc ModelInterface::IsMarkupStrikethroughSet()
+ */
+ bool const IsMarkupStrikethroughSet() const override;
+
/**
* @copydoc ModelInterface::GetCharacterSpacing()
*/
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
#include <dali-toolkit/internal/text/glyph-metrics-helper.h>
#include <dali-toolkit/internal/text/rendering/styles/character-spacing-helper-functions.h>
-#include <dali-toolkit/internal/text/text-controller-impl-event-handler.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl-event-handler.h>
using namespace Dali;
#define DALI_TOOLKIT_TEXT_SELECTION_HANDLE_CONTROLLER_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
namespace Dali
{
virtual bool IsUnderlineEnabled() const = 0;
/**
+ * @brief checks if there is underline set using markup.
+ *
+ * @return boolean if there is underline set using markup.
+ */
+ virtual bool const IsMarkupUnderlineSet() const = 0;
+
+ /**
* @brief Returns the hyphens glyph info.
*
* @return hyphens glyph info.
virtual bool IsStrikethroughEnabled() const = 0;
/**
+ * @brief checks if there is strikethrough set using markup.
+ *
+ * @return boolean if there is strikethrough set using markup.
+ */
+ virtual bool const IsMarkupStrikethroughSet() const = 0;
+
+ /**
* @brief Retrieves the strikethrough height override
*
* @return Returns the override height for a strikethrough, 0 indicates that adaptor will determine the height
return false;
}
+bool const View::IsMarkupUnderlineSet() const
+{
+ return (GetNumberOfUnderlineRuns() > 0u);
+}
+
const GlyphInfo* View::GetHyphens() const
{
if(mImpl->mVisualModel)
return (mImpl->mVisualModel) ? mImpl->mVisualModel->IsStrikethroughEnabled() : false;
}
+bool const View::IsMarkupStrikethroughSet() const
+{
+ return (GetNumberOfStrikethroughRuns() > 0u);
+}
+
float View::GetStrikethroughHeight() const
{
return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetStrikethroughHeight() : 0.0f;
bool IsUnderlineEnabled() const override;
/**
+ * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupUnderlineSet()
+ */
+ bool const IsMarkupUnderlineSet() const;
+
+ /**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
*/
const GlyphInfo* GetHyphens() const override;
bool IsStrikethroughEnabled() const override;
/**
+ * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupStrikethroughSet()
+ */
+ bool const IsMarkupStrikethroughSet() const;
+
+ /**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughHeight()
*/
float GetStrikethroughHeight() const override;
constexpr auto NUMBER_OF_LOCAL_LOADER_THREADS_ENV = "DALI_TEXTURE_LOCAL_THREADS";
constexpr auto NUMBER_OF_REMOTE_LOADER_THREADS_ENV = "DALI_TEXTURE_REMOTE_THREADS";
-constexpr auto LOAD_IMAGE_YUV_PLANES_ENV = "DALI_LOAD_IMAGE_YUV_PLANES_ENV";
+constexpr auto LOAD_IMAGE_YUV_PLANES_ENV = "DALI_LOAD_IMAGE_YUV_PLANES";
size_t GetNumberOfThreads(const char* environmentVariable, size_t defaultValue)
{
// the rasterized image is with pre-multiplied alpha format
mImpl->mFlags |= Visual::Base::Impl::IS_PREMULTIPLIED_ALPHA;
- if(!mVectorAnimationTask->Load(mUrl.GetUrl()))
- {
- mLoadFailed = true;
- }
+ mVectorAnimationTask->RequestLoad(mUrl.GetUrl());
- mVectorAnimationTask->UploadCompletedSignal().Connect(this, &AnimatedVectorImageVisual::OnUploadCompleted);
+ mVectorAnimationTask->ResourceReadySignal().Connect(this, &AnimatedVectorImageVisual::OnResourceReady);
mVectorAnimationTask->SetAnimationFinishedCallback(new EventThreadCallback(MakeCallback(this, &AnimatedVectorImageVisual::OnAnimationFinished)));
auto& vectorAnimationManager = mFactoryCache.GetVectorAnimationManager();
}
// Finalize animation task and disconnect the signal in the main thread
- mVectorAnimationTask->UploadCompletedSignal().Disconnect(this, &AnimatedVectorImageVisual::OnUploadCompleted);
+ mVectorAnimationTask->ResourceReadySignal().Disconnect(this, &AnimatedVectorImageVisual::OnResourceReady);
mVectorAnimationTask->Finalize();
}
}
}
else
{
- uint32_t width, height;
- mVectorAnimationTask->GetDefaultSize(width, height);
- naturalSize.x = width;
- naturalSize.y = height;
+ if(mLoadFailed && mImpl->mRenderer)
+ {
+ // Load failed, use broken image size
+ auto textureSet = mImpl->mRenderer.GetTextures();
+ if(textureSet && textureSet.GetTextureCount())
+ {
+ auto texture = textureSet.GetTexture(0);
+ if(texture)
+ {
+ naturalSize.x = texture.GetWidth();
+ naturalSize.y = texture.GetHeight();
+ return;
+ }
+ }
+ }
+ else
+ {
+ uint32_t width, height;
+ mVectorAnimationTask->GetDefaultSize(width, height);
+ naturalSize.x = width;
+ naturalSize.y = height;
+ }
}
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::GetNaturalSize: w = %f, h = %f [%p]\n", naturalSize.width, naturalSize.height, this);
// Register transform properties
mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
+
+ mVectorAnimationTask->SetRenderer(mImpl->mRenderer);
}
void AnimatedVectorImageVisual::DoSetOnScene(Actor& actor)
if(mLoadFailed)
{
- Vector2 imageSize = Vector2::ZERO;
- imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+ Vector2 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
actor.AddRenderer(mImpl->mRenderer);
ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
}
else
{
- mVectorAnimationTask->SetRenderer(mImpl->mRenderer);
-
// Add property notification for scaling & size
mScaleNotification = actor.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f));
mScaleNotification.NotifySignal().Connect(this, &AnimatedVectorImageVisual::OnScaleNotification);
{
DevelWindow::VisibilityChangedSignal(window).Connect(this, &AnimatedVectorImageVisual::OnWindowVisibilityChanged);
}
+
+ if(mImpl->mEventObserver)
+ {
+ // The visual needs it's size set before it can be rasterized hence request relayout once on stage
+ mImpl->mEventObserver->RelayoutRequest(*this);
+ }
+
+ mAnimationData.resendFlag |= VectorAnimationTask::RESEND_NEED_RESOURCE_READY;
+ TriggerVectorRasterization();
}
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::DoSetOnScene [%p]\n", this);
void AnimatedVectorImageVisual::DoSetOffScene(Actor& actor)
{
StopAnimation();
- SendAnimationData();
+ TriggerVectorRasterization();
if(mImpl->mRenderer)
{
mPlacementActor.Reset();
// Reset the visual size to zero so that when adding the actor back to stage the rasterization is forced
- mVisualSize = Vector2::ZERO;
- mVisualScale = Vector2::ONE;
+ mVisualSize = Vector2::ZERO;
+ mVisualScale = Vector2::ONE;
+ mAnimationData.width = 0;
+ mAnimationData.height = 0;
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::DoSetOffScene [%p]\n", this);
}
mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
}
- SendAnimationData();
+ TriggerVectorRasterization();
}
}
TriggerVectorRasterization();
}
-void AnimatedVectorImageVisual::OnUploadCompleted()
+void AnimatedVectorImageVisual::OnResourceReady(VectorAnimationTask::ResourceStatus status)
{
- // If weak handle is holding a placement actor, it is the time to add the renderer to actor.
- Actor actor = mPlacementActor.GetHandle();
- if(actor && !mRendererAdded)
+ if(status == VectorAnimationTask::ResourceStatus::LOADED)
{
- actor.AddRenderer(mImpl->mRenderer);
- mRendererAdded = true;
+ if(mImpl->mEventObserver)
+ {
+ mImpl->mEventObserver->RelayoutRequest(*this);
+ }
+ }
+ else
+ {
+ mLoadFailed = status == VectorAnimationTask::ResourceStatus::FAILED ? true : false;
- ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+ // If weak handle is holding a placement actor, it is the time to add the renderer to actor.
+ Actor actor = mPlacementActor.GetHandle();
+ if(actor && !mRendererAdded)
+ {
+ if(!mLoadFailed)
+ {
+ actor.AddRenderer(mImpl->mRenderer);
+ ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+ }
+ else
+ {
+ Vector2 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+ mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
+ actor.AddRenderer(mImpl->mRenderer);
+ ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ }
- DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnUploadCompleted: Renderer is added [%p]\n", this);
+ mRendererAdded = true;
+ }
}
+
+ DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "Renderer is added (status = %d) [%p]\n", status, this);
}
void AnimatedVectorImageVisual::OnAnimationFinished()
uint32_t width = static_cast<uint32_t>(mVisualSize.width * mVisualScale.width);
uint32_t height = static_cast<uint32_t>(mVisualSize.height * mVisualScale.height);
- mAnimationData.width = width;
- mAnimationData.height = height;
- mAnimationData.resendFlag |= VectorAnimationTask::RESEND_SIZE;
+ if(mAnimationData.width != width || mAnimationData.height != height)
+ {
+ mAnimationData.width = width;
+ mAnimationData.height = height;
+ mAnimationData.resendFlag |= VectorAnimationTask::RESEND_SIZE;
+ }
}
void AnimatedVectorImageVisual::StopAnimation()
{
Vector3 scale = actor.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
- if(mRedrawInScalingDown || scale.width >= 1.0f || scale.height >= 1.0f)
+ if((mVisualScale.width != scale.width || mVisualScale.height != scale.height) && (mRedrawInScalingDown || scale.width >= 1.0f || scale.height >= 1.0f))
{
mVisualScale.width = scale.width;
mVisualScale.height = scale.height;
Actor actor = mPlacementActor.GetHandle();
if(actor)
{
- Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE);
- mVisualSize.width = size.width;
- mVisualSize.height = size.height;
+ Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE);
- DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnSizeNotification: size = %f, %f [%p]\n", mVisualSize.width, mVisualSize.height, this);
+ if(mVisualSize.width != size.width || mVisualSize.height != size.height)
+ {
+ mVisualSize.width = size.width;
+ mVisualSize.height = size.height;
- SetVectorImageSize();
- SendAnimationData();
+ DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnSizeNotification: size = %f, %f [%p]\n", mVisualSize.width, mVisualSize.height, this);
- Stage::GetCurrent().KeepRendering(0.0f); // Trigger event processing
+ SetVectorImageSize();
+ SendAnimationData();
+
+ Stage::GetCurrent().KeepRendering(0.0f); // Trigger event processing
+ }
}
}
void DoSetProperty(Property::Index index, const Property::Value& value);
/**
- * @brief Called when the texture upload is completed.
+ * @brief Called when the resource is ready.
+ * @param[in] status The resource status
*/
- void OnUploadCompleted();
+ void OnResourceReady(VectorAnimationTask::ResourceStatus status);
/**
* @brief Event callback from rasterize thread. This is called after the animation is finished.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
if(mProcessorRegistered)
{
- Adaptor::Get().UnregisterProcessor(*this);
+ Adaptor::Get().UnregisterProcessor(*this, true);
}
for(auto observer : mLifecycleObservers)
if(!mProcessorRegistered)
{
- Adaptor::Get().RegisterProcessor(*this);
+ Adaptor::Get().RegisterProcessor(*this, true); // Use post processor to trigger after layoutting
mProcessorRegistered = true;
}
}
{
if(Adaptor::IsAvailable())
{
- Adaptor::Get().UnregisterProcessor(*this);
+ Adaptor::Get().UnregisterProcessor(*this, true);
mProcessorRegistered = false;
}
}
}
mEventCallbacks.clear();
- Adaptor::Get().UnregisterProcessor(*this);
+ Adaptor::Get().UnregisterProcessor(*this, true);
mProcessorRegistered = false;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
mAnimationData(),
mVectorAnimationThread(factoryCache.GetVectorAnimationManager().GetVectorAnimationThread()),
mConditionalWait(),
+ mResourceReadySignal(),
mAnimationFinishedTrigger(),
+ mLoadCompletedTrigger(new EventThreadCallback(MakeCallback(this, &VectorAnimationTask::OnLoadCompleted))),
mPlayState(PlayState::STOPPED),
mStopBehavior(DevelImageVisual::StopBehavior::CURRENT_FRAME),
mLoopingMode(DevelImageVisual::LoopingMode::RESTART),
mUpdateFrameNumber(false),
mNeedAnimationFinishedTrigger(true),
mAnimationDataUpdated(false),
- mDestroyTask(false)
+ mDestroyTask(false),
+ mLoadRequest(false),
+ mLoadFailed(false)
{
+ mVectorRenderer.UploadCompletedSignal().Connect(this, &VectorAnimationTask::OnUploadCompleted);
}
VectorAnimationTask::~VectorAnimationTask()
mDestroyTask = true;
}
-bool VectorAnimationTask::Load(const std::string& url)
+bool VectorAnimationTask::Load()
{
- mUrl = url;
-
if(!mVectorRenderer.Load(mUrl))
{
DALI_LOG_ERROR("VectorAnimationTask::Load: Load failed [%s]\n", mUrl.c_str());
+ mLoadRequest = false;
+ mLoadFailed = true;
+ mLoadCompletedTrigger->Trigger();
return false;
}
mFrameRate = mVectorRenderer.GetFrameRate();
mFrameDurationMicroSeconds = MICROSECONDS_PER_SECOND / mFrameRate;
- uint32_t width, height;
- mVectorRenderer.GetDefaultSize(width, height);
-
- SetSize(width, height);
+ mLoadRequest = false;
+ mLoadCompletedTrigger->Trigger();
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Load: file = %s [%d frames, %f fps] [%p]\n", mUrl.c_str(), mTotalFrame, mFrameRate, this);
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetRenderer [%p]\n", this);
}
+void VectorAnimationTask::RequestLoad(const std::string& url)
+{
+ mUrl = url;
+ mLoadRequest = true;
+
+ mVectorAnimationThread.AddTask(this);
+}
+
void VectorAnimationTask::SetAnimationData(const AnimationData& data)
{
ConditionalWait::ScopedLock lock(mConditionalWait);
mCurrentFrame = mEndFrame;
}
- DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetPlayRange: [%d, %d] [%p]\n", mStartFrame, mEndFrame, this);
+ DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetPlayRange: [%d, %d] [%s] [%p]\n", mStartFrame, mEndFrame, mUrl.c_str(), this);
}
}
else
{
- DALI_LOG_ERROR("VectorAnimationTask::SetPlayRange: Invalid range (%d, %d) [%p]\n", startFrame, endFrame, this);
+ DALI_LOG_ERROR("VectorAnimationTask::SetPlayRange: Invalid range (%d, %d) [%s] [%p]\n", startFrame, endFrame, mUrl.c_str(), this);
return;
}
}
}
else
{
- DALI_LOG_ERROR("Invalid frame number [%d (%d, %d)]\n", frameNumber, mStartFrame, mEndFrame);
+ DALI_LOG_ERROR("Invalid frame number [%d (%d, %d)] [%p]\n", frameNumber, mStartFrame, mEndFrame, this);
}
}
mVectorRenderer.GetLayerInfo(map);
}
-VectorAnimationTask::UploadCompletedSignalType& VectorAnimationTask::UploadCompletedSignal()
+VectorAnimationTask::ResourceReadySignalType& VectorAnimationTask::ResourceReadySignal()
{
- return mVectorRenderer.UploadCompletedSignal();
+ return mResourceReadySignal;
}
-bool VectorAnimationTask::Rasterize()
+bool VectorAnimationTask::Rasterize(bool& keepAnimation)
{
bool stopped = false;
uint32_t currentFrame;
+ keepAnimation = false;
{
ConditionalWait::ScopedLock lock(mConditionalWait);
// The task will be destroyed. We don't need rasterization.
return false;
}
+
+ if(mLoadRequest)
+ {
+ return Load();
+ }
+ }
+
+ if(mLoadFailed)
+ {
+ return false;
}
ApplyAnimationData();
if(mPlayState == PlayState::PLAYING && mUpdateFrameNumber)
{
- mCurrentFrame = mForward ? mCurrentFrame + mDroppedFrames + 1 : mCurrentFrame - mDroppedFrames - 1;
+ mCurrentFrame = mForward ? mCurrentFrame + mDroppedFrames + 1 : (mCurrentFrame > mDroppedFrames ? mCurrentFrame - mDroppedFrames - 1 : 0);
Dali::ClampInPlace(mCurrentFrame, mStartFrame, mEndFrame);
}
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Animation is finished [current = %d] [%p]\n", currentFrame, this);
}
- bool keepAnimation = true;
- if(mPlayState == PlayState::PAUSED || mPlayState == PlayState::STOPPED)
+ if(mPlayState != PlayState::PAUSED && mPlayState != PlayState::STOPPED)
{
- keepAnimation = false;
+ keepAnimation = true;
}
- return keepAnimation;
+ return true;
}
uint32_t VectorAnimationTask::GetStoppedFrame(uint32_t startFrame, uint32_t endFrame, uint32_t currentFrame)
SetCurrentFrameNumber(mAnimationData[index].currentFrame);
}
+ if(mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_NEED_RESOURCE_READY)
+ {
+ mVectorRenderer.InvalidateBuffer();
+ }
+
if(mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_PLAY_STATE)
{
if(mAnimationData[index].playState == DevelImageVisual::PlayState::PLAYING)
mAnimationData[index].resendFlag = 0;
}
+void VectorAnimationTask::OnUploadCompleted()
+{
+ mResourceReadySignal.Emit(ResourceStatus::READY);
+}
+
+void VectorAnimationTask::OnLoadCompleted()
+{
+ if(!mLoadFailed)
+ {
+ mResourceReadySignal.Emit(ResourceStatus::LOADED);
+ }
+ else
+ {
+ mResourceReadySignal.Emit(ResourceStatus::FAILED);
+ }
+}
} // namespace Internal
} // namespace Toolkit
#define DALI_TOOLKIT_VECTOR_ANIMATION_TASK_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/**
* The task of the vector animation.
*/
-class VectorAnimationTask : public RefObject
+class VectorAnimationTask : public RefObject, public ConnectionTracker
{
public:
- using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType;
+ enum class ResourceStatus
+ {
+ LOADED, /// Resource is loaded
+ READY, /// Resource is ready
+ FAILED /// Resource is fail to load
+ };
+
+ using ResourceReadySignalType = Signal<void(ResourceStatus)>;
using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
*/
enum ResendFlags
{
- RESEND_PLAY_RANGE = 1 << 0,
- RESEND_LOOP_COUNT = 1 << 1,
- RESEND_STOP_BEHAVIOR = 1 << 2,
- RESEND_LOOPING_MODE = 1 << 3,
- RESEND_CURRENT_FRAME = 1 << 4,
- RESEND_SIZE = 1 << 5,
- RESEND_PLAY_STATE = 1 << 6
+ RESEND_PLAY_RANGE = 1 << 0,
+ RESEND_LOOP_COUNT = 1 << 1,
+ RESEND_STOP_BEHAVIOR = 1 << 2,
+ RESEND_LOOPING_MODE = 1 << 3,
+ RESEND_CURRENT_FRAME = 1 << 4,
+ RESEND_SIZE = 1 << 5,
+ RESEND_PLAY_STATE = 1 << 6,
+ RESEND_NEED_RESOURCE_READY = 1 << 7
};
/**
void Finalize();
/**
- * @brief Loads the animation file.
+ * @brief Sets the renderer used to display the result image.
*
- * @param[in] url The url of the vector animation file
- * @return True if loading success, false otherwise.
+ * @param[in] renderer The renderer used to display the result image
*/
- bool Load(const std::string& url);
+ void SetRenderer(Renderer renderer);
/**
- * @brief Sets the renderer used to display the result image.
+ * @brief Request to load the animation file.
*
- * @param[in] renderer The renderer used to display the result image
+ * @param[in] url The url of the vector animation file
*/
- void SetRenderer(Renderer renderer);
+ void RequestLoad(const std::string& url);
/**
* @brief Sets data to specify animation playback.
void GetLayerInfo(Property::Map& map) const;
/**
- * @brief Connect to this signal to be notified when the texture upload is completed.
+ * @brief Connect to this signal to be notified when the resource is ready.
* @return The signal to connect to.
*/
- UploadCompletedSignalType& UploadCompletedSignal();
+ ResourceReadySignalType& ResourceReadySignal();
/**
* @brief Rasterizes the current frame.
- * @return true if the animation is running, false otherwise.
+ * @param[out] keepAnimation true if the animation is running, false otherwise.
+ * @return true if the rasterization succeeded, false otherwise.
*/
- bool Rasterize();
+ bool Rasterize(bool& keepAnimation);
/**
* @brief Calculates the time for the next frame rasterization.
private:
/**
+ * @brief Loads the animation file.
+ *
+ * @return True if loading succeeded, false otherwise.
+ */
+ bool Load();
+
+ /**
* @brief Play the vector animation.
*/
void PlayAnimation();
*/
void ApplyAnimationData();
+ /**
+ * @brief Called when the texture upload is completed.
+ */
+ void OnUploadCompleted();
+
+ /**
+ * @brief Event callback from rasterize thread. This is called when the file loading is completed.
+ */
+ void OnLoadCompleted();
+
// Undefined
VectorAnimationTask(const VectorAnimationTask& task) = delete;
AnimationData mAnimationData[2];
VectorAnimationThread& mVectorAnimationThread;
ConditionalWait mConditionalWait;
+ ResourceReadySignalType mResourceReadySignal;
std::unique_ptr<EventThreadCallback> mAnimationFinishedTrigger;
+ std::unique_ptr<EventThreadCallback> mLoadCompletedTrigger;
PlayState mPlayState;
DevelImageVisual::StopBehavior::Type mStopBehavior;
DevelImageVisual::LoopingMode::Type mLoopingMode;
bool mNeedAnimationFinishedTrigger;
bool mAnimationDataUpdated;
bool mDestroyTask;
+ bool mLoadRequest;
+ bool mLoadFailed;
};
} // namespace Internal
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
}
}
-void VectorAnimationThread::OnTaskCompleted(VectorAnimationTaskPtr task, bool keepAnimation)
+void VectorAnimationThread::OnTaskCompleted(VectorAnimationTaskPtr task, bool success, bool keepAnimation)
{
if(!mDestroyThread)
{
needRasterize = true;
}
- if(keepAnimation)
+ if(keepAnimation && success)
{
if(mCompletedTasks.end() == std::find(mCompletedTasks.begin(), mCompletedTasks.end(), task))
{
auto nextFrameTime = nextTask->GetNextFrameTime();
#if defined(DEBUG_ENABLED)
- auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(nextFrameTime - currentTime);
+// auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(nextFrameTime - currentTime);
- DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationThread::Rasterize: [next time = %lld]\n", duration.count());
+// DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationThread::Rasterize: [next time = %lld]\n", duration.count());
#endif
if(nextFrameTime <= currentTime)
if(needToSleep)
{
#if defined(DEBUG_ENABLED)
- auto sleepDuration = std::chrono::duration_cast<std::chrono::milliseconds>(mSleepTimePoint - std::chrono::steady_clock::now());
+// auto sleepDuration = std::chrono::duration_cast<std::chrono::milliseconds>(mSleepTimePoint - std::chrono::steady_clock::now());
- DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationThread::SleepThread::Run: [sleep duration = %lld]\n", sleepDuration.count());
+// DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationThread::SleepThread::Run: [sleep duration = %lld]\n", sleepDuration.count());
#endif
std::this_thread::sleep_until(sleepTimePoint);
#define DALI_TOOLKIT_VECTOR_ANIMATION_THREAD_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
/**
* @brief Called when the rasterization is completed from the rasterize thread.
- * @param task The completed task
+ * @param[in] task The completed task
+ * @param[in] success true if the task succeeded, false otherwise.
+ * @param[in] keepAnimation true if the animation is running, false otherwise.
*/
- void OnTaskCompleted(VectorAnimationTaskPtr task, bool stopped);
+ void OnTaskCompleted(VectorAnimationTaskPtr task, bool success, bool keepAnimation);
/**
* @brief Called when the sleep thread is awaken.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
if(nextTask)
{
- bool keepAnimation = nextTask->Rasterize();
+ bool keepAnimation;
+ bool success = nextTask->Rasterize(keepAnimation);
if(mCompletedCallback)
{
- CallbackBase::Execute(*mCompletedCallback, nextTask, keepAnimation);
+ CallbackBase::Execute(*mCompletedCallback, nextTask, success, keepAnimation);
}
}
}
--- /dev/null
+/*
+ * Copyright (c) 2022 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.
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/visuals/text-visual-shader-factory.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+namespace
+{
+// global string variable to caching complate vertex shader
+static std::string gVertexShader;
+
+// global string variable to caching complate fragment shader (no atlas)
+static std::string gFragmentShaderNoAtlas;
+
+// enum of required list when we select shader
+enum class TextVisualRequireFlag : uint32_t
+{
+ DEFAULT = 0,
+ STYLES = 1 << 0,
+ OVERLAY = 1 << 1,
+ EMOJI = 1 << 2,
+ MULTI_COLOR = 1 << 3,
+};
+
+const VisualFactoryCache::ShaderType SHADER_TYPE_TABLE[] =
+ {
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_OVERLAY,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_OVERLAY,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_EMOJI,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_EMOJI,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_OVERLAY_AND_EMOJI,
+ VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_OVERLAY_AND_EMOJI,
+ VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT,
+ VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE,
+ VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_OVERLAY,
+ VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE_AND_OVERLAY,
+};
+
+} // unnamed namespace
+
+namespace TextVisualShaderFeature
+{
+FeatureBuilder& FeatureBuilder::EnableMultiColor(bool enableMultiColor)
+{
+ mTextMultiColor = enableMultiColor ? TextMultiColor::MULTI_COLOR_TEXT : TextMultiColor::SINGLE_COLOR_TEXT;
+ return *this;
+}
+FeatureBuilder& FeatureBuilder::EnableEmoji(bool enableEmoji)
+{
+ mTextEmoji = enableEmoji ? TextEmoji::HAS_EMOJI : TextEmoji::NO_EMOJI;
+ return *this;
+}
+FeatureBuilder& FeatureBuilder::EnableStyle(bool enableStyle)
+{
+ mTextStyle = enableStyle ? TextStyle::HAS_STYLES : TextStyle::NO_STYLES;
+ return *this;
+}
+FeatureBuilder& FeatureBuilder::EnableOverlay(bool enableOverlay)
+{
+ mTextOverlay = enableOverlay ? TextOverlay::HAS_OVERLAY : TextOverlay::NO_OVERLAY;
+ return *this;
+}
+} // namespace TextVisualShaderFeature
+
+TextVisualShaderFactory::TextVisualShaderFactory()
+{
+}
+
+TextVisualShaderFactory::~TextVisualShaderFactory()
+{
+}
+
+Shader TextVisualShaderFactory::GetShader(VisualFactoryCache& factoryCache, const TextVisualShaderFeature::FeatureBuilder& featureBuilder)
+{
+ Shader shader;
+ uint32_t shaderTypeFlag = static_cast<uint32_t>(TextVisualRequireFlag::DEFAULT);
+ VisualFactoryCache::ShaderType shaderType = VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT;
+
+ const auto& multiColor = featureBuilder.mTextMultiColor;
+ const auto& emoji = featureBuilder.mTextEmoji;
+ const auto& style = featureBuilder.mTextStyle;
+ const auto& overlay = featureBuilder.mTextOverlay;
+
+ if(style == TextVisualShaderFeature::TextStyle::HAS_STYLES)
+ {
+ shaderTypeFlag |= static_cast<uint32_t>(TextVisualRequireFlag::STYLES);
+ }
+ if(overlay == TextVisualShaderFeature::TextOverlay::HAS_OVERLAY)
+ {
+ shaderTypeFlag |= static_cast<uint32_t>(TextVisualRequireFlag::OVERLAY);
+ }
+ // multi color can also render emoji. If multi color text, dont consider emoji
+ if(multiColor != TextVisualShaderFeature::TextMultiColor::MULTI_COLOR_TEXT && emoji == TextVisualShaderFeature::TextEmoji::HAS_EMOJI)
+ {
+ shaderTypeFlag |= static_cast<uint32_t>(TextVisualRequireFlag::EMOJI);
+ }
+ if(multiColor == TextVisualShaderFeature::TextMultiColor::MULTI_COLOR_TEXT)
+ {
+ shaderTypeFlag |= static_cast<uint32_t>(TextVisualRequireFlag::MULTI_COLOR);
+ }
+
+ shaderType = SHADER_TYPE_TABLE[shaderTypeFlag];
+ shader = factoryCache.GetShader(shaderType);
+
+ if(!shader)
+ {
+ std::string vertexShaderPrefixList;
+ std::string fragmentShaderPrefixList;
+
+ if(style == TextVisualShaderFeature::TextStyle::HAS_STYLES)
+ {
+ fragmentShaderPrefixList += "#define IS_REQUIRED_STYLE\n";
+ }
+ if(overlay == TextVisualShaderFeature::TextOverlay::HAS_OVERLAY)
+ {
+ fragmentShaderPrefixList += "#define IS_REQUIRED_OVERLAY\n";
+ }
+ // multi color can also render emoji. If multi color text, dont consider emoji
+ if(multiColor != TextVisualShaderFeature::TextMultiColor::MULTI_COLOR_TEXT && emoji == TextVisualShaderFeature::TextEmoji::HAS_EMOJI)
+ {
+ fragmentShaderPrefixList += "#define IS_REQUIRED_EMOJI\n";
+ }
+ if(multiColor == TextVisualShaderFeature::TextMultiColor::MULTI_COLOR_TEXT)
+ {
+ fragmentShaderPrefixList += "#define IS_REQUIRED_MULTI_COLOR\n";
+ }
+
+ std::string vertexShader = std::string(Dali::Shader::GetVertexShaderPrefix() + vertexShaderPrefixList + SHADER_TEXT_VISUAL_SHADER_VERT.data());
+ std::string fragmentShader = std::string(Dali::Shader::GetFragmentShaderPrefix() + fragmentShaderPrefixList + SHADER_TEXT_VISUAL_SHADER_FRAG.data());
+
+ shader = Shader::New(vertexShader, fragmentShader);
+ factoryCache.SaveShader(shaderType, shader);
+ }
+ return shader;
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_VISUAL_SHADER_FACTORY_H
+#define DALI_TOOLKIT_TEXT_VISUAL_SHADER_FACTORY_H
+
+/*
+ * Copyright (c) 2022 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
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
+#include <string_view>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+/**
+ * TextVisualShaderFeature contains feature lists what text visual shader need to know.
+ */
+namespace TextVisualShaderFeature
+{
+namespace TextMultiColor
+{
+/**
+ * @brief Whether text contains single color or not.
+ */
+enum Type
+{
+ SINGLE_COLOR_TEXT = 0, ///< The text contains single color only.
+ MULTI_COLOR_TEXT ///< The text contains multiple colors.
+};
+} // namespace TextMultiColor
+
+namespace TextEmoji
+{
+/**
+ * @brief Whether text contains emoji or not.
+ */
+enum Type
+{
+ NO_EMOJI = 0, ///< The text contains no emoji.
+ HAS_EMOJI ///< The text contains emoji.
+};
+} // namespace TextEmoji
+
+namespace TextStyle
+{
+/**
+ * @brief Whether text contains styles (like shadow or background color) or not.
+ */
+enum Type
+{
+ NO_STYLES = 0, ///< The text contains contains no styles.
+ HAS_STYLES ///< The text contains contains styles.
+};
+} // namespace TextStyle
+
+namespace TextOverlay
+{
+/**
+ * @brief Whether text contains overlay styles (like markdown) or not.
+ */
+enum Type
+{
+ NO_OVERLAY = 0, ///< The text contains contains no overlay.
+ HAS_OVERLAY ///< The text contains contains overlay.
+};
+} // namespace TextOverlay
+
+/**
+ * @brief Collection of current text visual feature.
+ */
+struct FeatureBuilder
+{
+ FeatureBuilder()
+ : mTextMultiColor(TextMultiColor::SINGLE_COLOR_TEXT),
+ mTextEmoji(TextEmoji::NO_EMOJI),
+ mTextStyle(TextStyle::NO_STYLES),
+ mTextOverlay(TextOverlay::NO_OVERLAY)
+ {
+ }
+
+ FeatureBuilder& EnableMultiColor(bool enableMultiColor);
+ FeatureBuilder& EnableEmoji(bool enableEmoji);
+ FeatureBuilder& EnableStyle(bool enableStyle);
+ FeatureBuilder& EnableOverlay(bool enableOverlay);
+
+ bool IsEnabledMultiColor() const
+ {
+ return mTextMultiColor == TextMultiColor::MULTI_COLOR_TEXT;
+ }
+ bool IsEnabledEmoji() const
+ {
+ return mTextEmoji == TextEmoji::HAS_EMOJI;
+ }
+ bool IsEnabledStyle() const
+ {
+ return mTextStyle == TextStyle::HAS_STYLES;
+ }
+ bool IsEnabledOverlay() const
+ {
+ return mTextOverlay == TextOverlay::HAS_OVERLAY;
+ }
+
+ TextMultiColor::Type mTextMultiColor : 2; ///< Whether text has multiple color, or not. default as TextMultiColor::SINGLE_COLOR_TEXT
+ TextEmoji::Type mTextEmoji : 2; ///< Whether text has emoji, or not. default as TextEmoji::NO_EMOJI
+ TextStyle::Type mTextStyle : 2; ///< Whether text has style, or not. default as TextStyle::NO_STYLES
+ TextOverlay::Type mTextOverlay : 2; ///< Whether text has overlay style, or not. default as TextOverlay::NO_OVERLAY
+};
+
+} // namespace TextVisualShaderFeature
+
+/**
+ * TextVisualShaderFactory is an object that provides and shares shaders for text visuals
+ */
+class TextVisualShaderFactory
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ TextVisualShaderFactory();
+
+ /**
+ * @brief Destructor
+ */
+ ~TextVisualShaderFactory();
+
+ /**
+ * @brief Get the standard text rendering shader.
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] featureBuilder Collection of current text shader's features
+ * @return The standard text rendering shader with features.
+ */
+ Shader GetShader(VisualFactoryCache& factoryCache, const TextVisualShaderFeature::FeatureBuilder& featureBuilder);
+
+protected:
+ /**
+ * Undefined copy constructor.
+ */
+ TextVisualShaderFactory(const TextVisualShaderFactory&);
+
+ /**
+ * Undefined assignment operator.
+ */
+ TextVisualShaderFactory& operator=(const TextVisualShaderFactory& rhs);
+
+private:
+};
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_VISUAL_SHADER_FACTORY_H
} // unnamed namespace
-TextVisualPtr TextVisual::New(VisualFactoryCache& factoryCache, const Property::Map& properties)
+TextVisualPtr TextVisual::New(VisualFactoryCache& factoryCache, TextVisualShaderFactory& shaderFactory, const Property::Map& properties)
{
- TextVisualPtr textVisualPtr(new TextVisual(factoryCache));
+ TextVisualPtr textVisualPtr(new TextVisual(factoryCache, shaderFactory));
textVisualPtr->SetProperties(properties);
textVisualPtr->Initialize();
return textVisualPtr;
}
}
-TextVisual::TextVisual(VisualFactoryCache& factoryCache)
+TextVisual::TextVisual(VisualFactoryCache& factoryCache, TextVisualShaderFactory& shaderFactory)
: Visual::Base(factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::TEXT),
mController(Text::Controller::New()),
mTypesetter(Text::Typesetter::New(mController->GetTextModel())),
+ mTextVisualShaderFactory(shaderFactory),
+ mTextShaderFeatureCache(),
mAnimatableTextColorPropertyIndex(Property::INVALID_INDEX),
mTextColorAnimatableIndex(Property::INVALID_INDEX),
mRendererUpdateNeeded(false)
void TextVisual::OnInitialize()
{
Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
- Shader shader = GetTextShader(mFactoryCache, TextType::SINGLE_COLOR_TEXT, TextType::NO_EMOJI, TextType::NO_STYLES);
+ Shader shader = GetTextShader(mFactoryCache, TextVisualShaderFeature::FeatureBuilder());
mImpl->mRenderer = VisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
shadowEnabled = true;
}
- const bool underlineEnabled = mController->GetTextModel()->IsUnderlineEnabled();
- const bool outlineEnabled = (mController->GetTextModel()->GetOutlineWidth() > Math::MACHINE_EPSILON_1);
- const bool backgroundEnabled = mController->GetTextModel()->IsBackgroundEnabled();
- const bool markupProcessorEnabled = mController->IsMarkupProcessorEnabled();
- const bool strikethroughEnabled = mController->GetTextModel()->IsStrikethroughEnabled();
-
- const bool styleEnabled = (shadowEnabled || underlineEnabled || outlineEnabled || backgroundEnabled || markupProcessorEnabled || strikethroughEnabled);
+ const bool outlineEnabled = (mController->GetTextModel()->GetOutlineWidth() > Math::MACHINE_EPSILON_1);
+ const bool backgroundEnabled = mController->GetTextModel()->IsBackgroundEnabled();
+ const bool markupProcessorEnabled = mController->IsMarkupProcessorEnabled();
+ const bool markupUnderlineEnabled = markupProcessorEnabled && mController->GetTextModel()->IsMarkupUnderlineSet();
+ const bool markupStrikethroughEnabled = markupProcessorEnabled && mController->GetTextModel()->IsMarkupStrikethroughSet();
+ const bool underlineEnabled = mController->GetTextModel()->IsUnderlineEnabled() || markupUnderlineEnabled;
+ const bool strikethroughEnabled = mController->GetTextModel()->IsStrikethroughEnabled() || markupStrikethroughEnabled;
+ const bool styleEnabled = (shadowEnabled || outlineEnabled || backgroundEnabled || markupProcessorEnabled);
const bool isOverlayStyle = underlineEnabled || strikethroughEnabled;
AddRenderer(control, relayoutSize, hasMultipleTextColors, containsColorGlyph, styleEnabled, isOverlayStyle);
return pixelData;
}
-void TextVisual::CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sampler& sampler, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle)
+void TextVisual::CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sampler& sampler)
{
TextureSet textureSet = TextureSet::New();
unsigned int textureSetIndex = 0u;
++textureSetIndex;
}
- if(styleEnabled && info.styleBuffer && info.overlayStyleBuffer)
+ if(mTextShaderFeatureCache.IsEnabledStyle() && info.styleBuffer)
{
PixelData styleData = ConvertToPixelData(info.styleBuffer, info.width, info.height, info.offsetPosition, Pixel::RGBA8888);
AddTexture(textureSet, styleData, sampler, textureSetIndex);
++textureSetIndex;
+ }
- // TODO : We need to seperate whether use overlayStyle or not.
- // Current text visual shader required both of them.
-
+ if(mTextShaderFeatureCache.IsEnabledOverlay() && info.overlayStyleBuffer)
+ {
PixelData overlayStyleData = ConvertToPixelData(info.overlayStyleBuffer, info.width, info.height, info.offsetPosition, Pixel::RGBA8888);
AddTexture(textureSet, overlayStyleData, sampler, textureSetIndex);
++textureSetIndex;
}
- if(containsColorGlyph && !hasMultipleTextColors && info.maskBuffer)
+ if(mTextShaderFeatureCache.IsEnabledEmoji() && !mTextShaderFeatureCache.IsEnabledMultiColor() && info.maskBuffer)
{
PixelData maskData = ConvertToPixelData(info.maskBuffer, info.width, info.height, info.offsetPosition, Pixel::L8);
AddTexture(textureSet, maskData, sampler, textureSetIndex);
renderer.SetProperty(VisualRenderer::Property::TRANSFORM_SIZE, Vector2(info.width, info.height));
renderer.SetProperty(VisualRenderer::Property::TRANSFORM_OFFSET, Vector2(info.offSet.x, info.offSet.y));
renderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
- renderer.RegisterProperty("uHasMultipleTextColors", static_cast<float>(hasMultipleTextColors));
+ renderer.RegisterProperty("uHasMultipleTextColors", static_cast<float>(mTextShaderFeatureCache.IsEnabledMultiColor()));
mRendererList.push_back(renderer);
}
void TextVisual::AddRenderer(Actor& actor, const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle)
{
- Shader shader = GetTextShader(mFactoryCache, hasMultipleTextColors, containsColorGlyph, styleEnabled);
+ Shader shader = GetTextShader(mFactoryCache, TextVisualShaderFeature::FeatureBuilder().EnableMultiColor(hasMultipleTextColors).EnableEmoji(containsColorGlyph).EnableStyle(styleEnabled).EnableOverlay(isOverlayStyle));
mImpl->mRenderer.SetShader(shader);
// Get the maximum size.
// No tiling required. Use the default renderer.
if(size.height < maxTextureSize)
{
- TextureSet textureSet = GetTextTexture(size, hasMultipleTextColors, containsColorGlyph, styleEnabled, isOverlayStyle);
+ TextureSet textureSet = GetTextTexture(size);
mImpl->mRenderer.SetTextures(textureSet);
//Register transform properties
Dali::DevelPixelData::PixelDataBuffer textPixelData = Dali::DevelPixelData::ReleasePixelDataBuffer(data);
info.textBuffer = textPixelData.buffer;
- if(styleEnabled)
+ if(mTextShaderFeatureCache.IsEnabledStyle())
{
// Create RGBA texture for all the text styles (without the text itself)
PixelData styleData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_NO_TEXT, false, Pixel::RGBA8888);
Dali::DevelPixelData::PixelDataBuffer stylePixelData = Dali::DevelPixelData::ReleasePixelDataBuffer(styleData);
info.styleBuffer = stylePixelData.buffer;
+ }
- // TODO : We need to seperate whether use overlayStyle or not.
- // Current text visual shader required both of them.
-
+ if(mTextShaderFeatureCache.IsEnabledOverlay())
+ {
// Create RGBA texture for all the overlay styles
PixelData overlayStyleData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_OVERLAY_STYLE, false, Pixel::RGBA8888);
Dali::DevelPixelData::PixelDataBuffer overlayStylePixelData = Dali::DevelPixelData::ReleasePixelDataBuffer(overlayStyleData);
info.overlayStyleBuffer = overlayStylePixelData.buffer;
}
- if(containsColorGlyph && !hasMultipleTextColors)
+ if(mTextShaderFeatureCache.IsEnabledEmoji() && !mTextShaderFeatureCache.IsEnabledMultiColor())
{
// Create a L8 texture as a mask to avoid color glyphs (e.g. emojis) to be affected by text color animation
PixelData maskData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_MASK, false, Pixel::L8);
}
// Create a textureset in the default renderer.
- CreateTextureSet(info, mImpl->mRenderer, sampler, hasMultipleTextColors, containsColorGlyph, styleEnabled, isOverlayStyle);
+ CreateTextureSet(info, mImpl->mRenderer, sampler);
verifiedHeight -= maxTextureSize;
// New offset for tiling.
info.offSet.y += maxTextureSize;
// Create a textureset int the new tiling renderer.
- CreateTextureSet(info, tilingRenderer, sampler, hasMultipleTextColors, containsColorGlyph, styleEnabled, isOverlayStyle);
+ CreateTextureSet(info, tilingRenderer, sampler);
verifiedHeight -= maxTextureSize;
}
}
}
-TextureSet TextVisual::GetTextTexture(const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle)
+TextureSet TextVisual::GetTextTexture(const Vector2& size)
{
// Filter mode needs to be set to linear to produce better quality while scaling.
Sampler sampler = Sampler::New();
TextureSet textureSet = TextureSet::New();
// Create RGBA texture if the text contains emojis or multiple text colors, otherwise L8 texture
- Pixel::Format textPixelFormat = (containsColorGlyph || hasMultipleTextColors) ? Pixel::RGBA8888 : Pixel::L8;
+ Pixel::Format textPixelFormat = (mTextShaderFeatureCache.IsEnabledEmoji() || mTextShaderFeatureCache.IsEnabledMultiColor()) ? Pixel::RGBA8888 : Pixel::L8;
// Check the text direction
Toolkit::DevelText::TextDirection::Type textDirection = mController->GetTextDirection();
AddTexture(textureSet, data, sampler, textureSetIndex);
++textureSetIndex;
- if(styleEnabled)
+ if(mTextShaderFeatureCache.IsEnabledStyle())
{
// Create RGBA texture for all the text styles that render in the background (without the text itself)
PixelData styleData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_NO_TEXT, false, Pixel::RGBA8888);
AddTexture(textureSet, styleData, sampler, textureSetIndex);
++textureSetIndex;
+ }
- // TODO : We need to seperate whether use overlayStyle or not.
- // Current text visual shader required both of them.
-
+ if(mTextShaderFeatureCache.IsEnabledOverlay())
+ {
// Create RGBA texture for overlay styles such as underline and strikethrough (without the text itself)
PixelData overlayStyleData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_OVERLAY_STYLE, false, Pixel::RGBA8888);
AddTexture(textureSet, overlayStyleData, sampler, textureSetIndex);
++textureSetIndex;
}
- if(containsColorGlyph && !hasMultipleTextColors)
+ if(mTextShaderFeatureCache.IsEnabledEmoji() && !mTextShaderFeatureCache.IsEnabledMultiColor())
{
// Create a L8 texture as a mask to avoid color glyphs (e.g. emojis) to be affected by text color animation
PixelData maskData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_MASK, false, Pixel::L8);
return textureSet;
}
-Shader TextVisual::GetTextShader(VisualFactoryCache& factoryCache, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled)
+Shader TextVisual::GetTextShader(VisualFactoryCache& factoryCache, const TextVisualShaderFeature::FeatureBuilder& featureBuilder)
{
- Shader shader;
-
- if(hasMultipleTextColors && !styleEnabled)
- {
- // We don't animate text color if the text contains multiple colors
- shader = factoryCache.GetShader(VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT);
- if(!shader)
- {
- shader = Shader::New(SHADER_TEXT_VISUAL_SHADER_VERT, SHADER_TEXT_VISUAL_MULTI_COLOR_TEXT_SHADER_FRAG);
- shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
- factoryCache.SaveShader(VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT, shader);
- }
- }
- else if(hasMultipleTextColors && styleEnabled)
- {
- // We don't animate text color if the text contains multiple colors
- shader = factoryCache.GetShader(VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE);
- if(!shader)
- {
- shader = Shader::New(SHADER_TEXT_VISUAL_SHADER_VERT, SHADER_TEXT_VISUAL_MULTI_COLOR_TEXT_WITH_STYLE_SHADER_FRAG);
- shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
- factoryCache.SaveShader(VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE, shader);
- }
- }
- else if(!hasMultipleTextColors && !containsColorGlyph && !styleEnabled)
- {
- shader = factoryCache.GetShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT);
- if(!shader)
- {
- shader = Shader::New(SHADER_TEXT_VISUAL_SHADER_VERT, SHADER_TEXT_VISUAL_SINGLE_COLOR_TEXT_SHADER_FRAG);
- shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
- factoryCache.SaveShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT, shader);
- }
- }
- else if(!hasMultipleTextColors && !containsColorGlyph && styleEnabled)
- {
- shader = factoryCache.GetShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE);
- if(!shader)
- {
- shader = Shader::New(SHADER_TEXT_VISUAL_SHADER_VERT, SHADER_TEXT_VISUAL_SINGLE_COLOR_TEXT_WITH_STYLE_SHADER_FRAG);
- shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
- factoryCache.SaveShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE, shader);
- }
- }
- else if(!hasMultipleTextColors && containsColorGlyph && !styleEnabled)
- {
- shader = factoryCache.GetShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_EMOJI);
- if(!shader)
- {
- shader = Shader::New(SHADER_TEXT_VISUAL_SHADER_VERT, SHADER_TEXT_VISUAL_SINGLE_COLOR_TEXT_WITH_EMOJI_SHADER_FRAG);
- shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
- factoryCache.SaveShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_EMOJI, shader);
- }
- }
- else // if( !hasMultipleTextColors && containsColorGlyph && styleEnabled )
- {
- shader = factoryCache.GetShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_EMOJI);
- if(!shader)
- {
- shader = Shader::New(SHADER_TEXT_VISUAL_SHADER_VERT, SHADER_TEXT_VISUAL_SINGLE_COLOR_TEXT_WITH_STYLE_AND_EMOJI_SHADER_FRAG);
- shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
- factoryCache.SaveShader(VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_EMOJI, shader);
- }
- }
+ // Cache feature builder informations.
+ mTextShaderFeatureCache = featureBuilder;
+ Shader shader = mTextVisualShaderFactory.GetShader(factoryCache, mTextShaderFeatureCache);
+ shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
return shader;
}
#include <dali/public-api/rendering/visual-renderer.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/controller/text-controller.h>
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/visuals/text-visual-shader-factory.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
namespace Dali
* @brief Create a new text visual.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] shaderFactory The TextVisualShaderFactory object
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
- static TextVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties);
+ static TextVisualPtr New(VisualFactoryCache& factoryCache, TextVisualShaderFactory& shaderFactory, const Property::Map& properties);
/**
* @brief Converts all strings keys in property map to index keys. Property Map can then be merged correctly.
* @brief Constructor.
*
* @param[in] factoryCache The VisualFactoryCache object
+ * @param[in] shaderFactory The TextVisualShaderFactory object
*/
- TextVisual(VisualFactoryCache& factoryCache);
+ TextVisual(VisualFactoryCache& factoryCache, TextVisualShaderFactory& shaderFactory);
/**
* @brief A reference counted object may only be deleted by calling Unreference().
PixelData ConvertToPixelData(unsigned char* buffer, int width, int height, int offsetPosition, const Pixel::Format textPixelFormat);
/**
- * @brief Create the text's texture.
+ * @brief Create the text's texture. It will use cached shader feature for text visual.
* @param[in] info This is the information you need to create a Tiling.
* @param[in] renderer The renderer to which the TextureSet will be added.
* @param[in] sampler The sampler.
- * @param[in] hasMultipleTextColors Whether the text contains multiple colors.
- * @param[in] containsColorGlyph Whether the text contains color glyph.
- * @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.).
- * @param[in] isOverlayStyle Whether the style needs to overlay on the text (e.g. strikethrough, underline, etc.).
*/
- void CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sampler& sampler, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle);
+ void CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sampler& sampler);
/**
* Create renderer of the text for rendering.
void AddRenderer(Actor& actor, const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle);
/**
- * Get the texture of the text for rendering.
+ * Get the texture of the text for rendering. It will use cached shader feature for text visual.
* @param[in] size The texture size.
- * @param[in] hasMultipleTextColors Whether the text contains multiple colors.
- * @param[in] containsColorGlyph Whether the text contains color glyph.
- * @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.).
- * @param[in] isOverlayStyle Whether the style needs to overlay on the text (e.g. strikethrough, underline, etc.).
*/
- TextureSet GetTextTexture(const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle);
+ TextureSet GetTextTexture(const Vector2& size);
/**
* Get the text rendering shader.
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
- * @param[in] hasMultipleTextColors Whether the text contains multiple colors.
- * @param[in] containsColorGlyph Whether the text contains color glyph.
- * @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.).
+ * @param[in] featureBuilder Collection of current text shader's features. It will be cached as text visual.
*/
- Shader GetTextShader(VisualFactoryCache& factoryCache, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled);
+ Shader GetTextShader(VisualFactoryCache& factoryCache, const TextVisualShaderFeature::FeatureBuilder& featureBuilder);
/**
* @brief Retrieve the TextVisual object.
private:
typedef std::vector<Renderer> RendererContainer;
- /**
- * Used as an alternative to boolean so that it is obvious whether the text contains single or multiple text colors, and emoji and styles.
- */
- struct TextType
- {
- enum Type
- {
- SINGLE_COLOR_TEXT = 0, ///< The text contains single color only.
- MULTI_COLOR_TEXT = 1, ///< The text contains multiple colors.
- NO_EMOJI = 0, ///< The text contains no emoji.
- HAS_EMOJI = 1, ///< The text contains emoji.
- NO_STYLES = 0, ///< The text contains contains no styles.
- HAS_SYLES = 1 ///< The text contains contains styles.
- };
- };
-
private:
- Text::ControllerPtr mController; ///< The text's controller.
- Text::TypesetterPtr mTypesetter; ///< The text's typesetter.
- WeakHandle<Actor> mControl; ///< The control where the renderer is added.
- Constraint mColorConstraint{}; ///< Color constraint
- Constraint mOpacityConstraint{}; ///< Opacity constraint
- Property::Index mAnimatableTextColorPropertyIndex; ///< The index of animatable text color property registered by the control.
- Property::Index mTextColorAnimatableIndex; ///< The index of uTextColorAnimatable property.
- bool mRendererUpdateNeeded : 1; ///< The flag to indicate whether the renderer needs to be updated.
- RendererContainer mRendererList;
+ Text::ControllerPtr mController; ///< The text's controller.
+ Text::TypesetterPtr mTypesetter; ///< The text's typesetter.
+
+ TextVisualShaderFactory& mTextVisualShaderFactory; ///< The shader factory for text visual.
+ TextVisualShaderFeature::FeatureBuilder mTextShaderFeatureCache; ///< The cached shader feature for text visual.
+
+ WeakHandle<Actor> mControl; ///< The control where the renderer is added.
+ Constraint mColorConstraint{}; ///< Color constraint
+ Constraint mOpacityConstraint{}; ///< Opacity constraint
+ Property::Index mAnimatableTextColorPropertyIndex; ///< The index of animatable text color property registered by the control.
+ Property::Index mTextColorAnimatableIndex; ///< The index of uTextColorAnimatable property.
+ bool mRendererUpdateNeeded : 1; ///< The flag to indicate whether the renderer needs to be updated.
+ RendererContainer mRendererList;
};
} // namespace Internal
NATIVE_IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING,
NINE_PATCH_SHADER,
NINE_PATCH_MASK_SHADER,
- TEXT_SHADER_MULTI_COLOR_TEXT,
- TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE,
TEXT_SHADER_SINGLE_COLOR_TEXT,
TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE,
+ TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_OVERLAY,
+ TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_OVERLAY,
TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_EMOJI,
TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_EMOJI,
+ TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_OVERLAY_AND_EMOJI,
+ TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_OVERLAY_AND_EMOJI,
+ TEXT_SHADER_MULTI_COLOR_TEXT,
+ TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE,
+ TEXT_SHADER_MULTI_COLOR_TEXT_WITH_OVERLAY,
+ TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE_AND_OVERLAY,
ANIMATED_GRADIENT_SHADER_LINEAR_BOUNDING_REFLECT,
ANIMATED_GRADIENT_SHADER_LINEAR_BOUNDING_REPEAT,
ANIMATED_GRADIENT_SHADER_LINEAR_BOUNDING_CLAMP,
#include <dali-toolkit/internal/visuals/npatch/npatch-visual.h>
#include <dali-toolkit/internal/visuals/primitive/primitive-visual.h>
#include <dali-toolkit/internal/visuals/svg/svg-visual.h>
+#include <dali-toolkit/internal/visuals/text-visual-shader-factory.h>
#include <dali-toolkit/internal/visuals/text/text-visual.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
VisualFactory::VisualFactory(bool debugEnabled)
: mFactoryCache(),
mImageVisualShaderFactory(),
+ mTextVisualShaderFactory(),
mSlotDelegate(this),
mDebugEnabled(debugEnabled),
mPreMultiplyOnLoad(true)
case Toolkit::Visual::TEXT:
{
- visualPtr = TextVisual::New(GetFactoryCache(), propertyMap);
+ visualPtr = TextVisual::New(GetFactoryCache(), GetTextVisualShaderFactory(), propertyMap);
break;
}
return *mImageVisualShaderFactory;
}
+TextVisualShaderFactory& VisualFactory::GetTextVisualShaderFactory()
+{
+ if(!mTextVisualShaderFactory)
+ {
+ mTextVisualShaderFactory = std::unique_ptr<TextVisualShaderFactory>(new TextVisualShaderFactory());
+ }
+ return *mTextVisualShaderFactory;
+}
+
} // namespace Internal
} // namespace Toolkit
#define DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
{
class VisualFactoryCache;
class ImageVisualShaderFactory;
+class TextVisualShaderFactory;
/**
* @copydoc Toolkit::VisualFactory
*/
ImageVisualShaderFactory& GetImageVisualShaderFactory();
+ /**
+ * Get the text visual shader factory, creating it if necessary.
+ */
+ TextVisualShaderFactory& GetTextVisualShaderFactory();
+
VisualFactory(const VisualFactory&) = delete;
VisualFactory& operator=(const VisualFactory& rhs) = delete;
private:
std::unique_ptr<VisualFactoryCache> mFactoryCache;
std::unique_ptr<ImageVisualShaderFactory> mImageVisualShaderFactory;
+ std::unique_ptr<TextVisualShaderFactory> mTextVisualShaderFactory;
SlotDelegate<VisualFactory> mSlotDelegate;
bool mDebugEnabled : 1;
bool mPreMultiplyOnLoad : 1; ///< Local store for this flag
{
const unsigned int TOOLKIT_MAJOR_VERSION = 2;
const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 30;
+const unsigned int TOOLKIT_MICRO_VERSION = 31;
const char* const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 2.1.30
+Version: 2.1.31
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT