[dali_2.1.31] Merge branch 'devel/master' 76/277976/1
authorRichard Huang <r.huang@samsung.com>
Fri, 15 Jul 2022 12:17:32 +0000 (13:17 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 15 Jul 2022 12:17:33 +0000 (13:17 +0100)
Change-Id: I8f5db813c2fde9e94473dbe70f32a889543d76b8

141 files changed:
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.h
automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-LineHelperFunctions.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Markup.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Typesetter.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Visuals-internal.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-canvas-renderer.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp [changed mode: 0755->0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.h [changed mode: 0755->0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-CanvasView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp
dali-toolkit/devel-api/controls/canvas-view/canvas-view.h
dali-toolkit/devel-api/controls/web-view/web-back-forward-list.cpp
dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h
dali-toolkit/devel-api/controls/web-view/web-context.cpp
dali-toolkit/devel-api/controls/web-view/web-context.h
dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h
dali-toolkit/devel-api/controls/web-view/web-settings.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/devel-api/text/text-utils-devel.cpp
dali-toolkit/internal/controls/canvas-view/canvas-view-impl.h
dali-toolkit/internal/controls/canvas-view/canvas-view-rasterize-thread.h
dali-toolkit/internal/controls/text-controls/common-text-utils.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-editor-property-handler.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-field-property-handler.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-shader.frag [deleted file]
dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-with-style-shader.frag [deleted file]
dali-toolkit/internal/graphics/shaders/text-visual-shader.frag [new file with mode: 0644]
dali-toolkit/internal/graphics/shaders/text-visual-shader.vert
dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-shader.frag [deleted file]
dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-emoji-shader.frag [deleted file]
dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-and-emoji-shader.frag [deleted file]
dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-shader.frag [deleted file]
dali-toolkit/internal/text/controller/text-controller-background-actor.cpp [moved from dali-toolkit/internal/text/text-controller-background-actor.cpp with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-background-actor.h [moved from dali-toolkit/internal/text/text-controller-background-actor.h with 100% similarity]
dali-toolkit/internal/text/controller/text-controller-event-handler.cpp [moved from dali-toolkit/internal/text/text-controller-event-handler.cpp with 98% similarity]
dali-toolkit/internal/text/controller/text-controller-event-handler.h [moved from dali-toolkit/internal/text/text-controller-event-handler.h with 97% similarity]
dali-toolkit/internal/text/controller/text-controller-impl-data-clearer.cpp [moved from dali-toolkit/internal/text/text-controller-impl-data-clearer.cpp with 98% similarity]
dali-toolkit/internal/text/controller/text-controller-impl-data-clearer.h [moved from dali-toolkit/internal/text/text-controller-impl-data-clearer.h with 96% similarity]
dali-toolkit/internal/text/controller/text-controller-impl-event-handler.cpp [moved from dali-toolkit/internal/text/text-controller-impl-event-handler.cpp with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-impl-event-handler.h [moved from dali-toolkit/internal/text/text-controller-impl-event-handler.h with 97% similarity]
dali-toolkit/internal/text/controller/text-controller-impl-model-updater.cpp [moved from dali-toolkit/internal/text/text-controller-impl-model-updater.cpp with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-impl-model-updater.h [moved from dali-toolkit/internal/text/text-controller-impl-model-updater.h with 91% similarity]
dali-toolkit/internal/text/controller/text-controller-impl.cpp [moved from dali-toolkit/internal/text/text-controller-impl.cpp with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-impl.h [moved from dali-toolkit/internal/text/text-controller-impl.h with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-input-font-handler.cpp [moved from dali-toolkit/internal/text/text-controller-input-font-handler.cpp with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-input-font-handler.h [moved from dali-toolkit/internal/text/text-controller-input-font-handler.h with 94% similarity]
dali-toolkit/internal/text/controller/text-controller-input-properties.cpp [moved from dali-toolkit/internal/text/text-controller-input-properties.cpp with 91% similarity]
dali-toolkit/internal/text/controller/text-controller-input-properties.h [moved from dali-toolkit/internal/text/text-controller-input-properties.h with 71% similarity]
dali-toolkit/internal/text/controller/text-controller-placeholder-handler.cpp [moved from dali-toolkit/internal/text/text-controller-placeholder-handler.cpp with 98% similarity]
dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h [moved from dali-toolkit/internal/text/text-controller-placeholder-handler.h with 96% similarity]
dali-toolkit/internal/text/controller/text-controller-relayouter.cpp [moved from dali-toolkit/internal/text/text-controller-relayouter.cpp with 99% similarity]
dali-toolkit/internal/text/controller/text-controller-relayouter.h [moved from dali-toolkit/internal/text/text-controller-relayouter.h with 97% similarity]
dali-toolkit/internal/text/controller/text-controller-text-updater.cpp [moved from dali-toolkit/internal/text/text-controller-text-updater.cpp with 97% similarity]
dali-toolkit/internal/text/controller/text-controller-text-updater.h [moved from dali-toolkit/internal/text/text-controller-text-updater.h with 96% similarity]
dali-toolkit/internal/text/controller/text-controller.cpp [moved from dali-toolkit/internal/text/text-controller.cpp with 98% similarity]
dali-toolkit/internal/text/controller/text-controller.h [moved from dali-toolkit/internal/text/text-controller.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-anchor.cpp [moved from dali-toolkit/internal/text/markup-processor-anchor.cpp with 85% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-anchor.h [moved from dali-toolkit/internal/text/markup-processor-anchor.h with 90% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.cpp [moved from dali-toolkit/internal/text/markup-processor-attribute-helper-functions.cpp with 86% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-attribute-helper-functions.h [moved from dali-toolkit/internal/text/markup-processor-attribute-helper-functions.h with 98% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-background.cpp [moved from dali-toolkit/internal/text/markup-processor-background.cpp with 83% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-background.h [moved from dali-toolkit/internal/text/markup-processor-background.h with 90% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-character-spacing.cpp [moved from dali-toolkit/internal/text/markup-processor-character-spacing.cpp with 85% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-character-spacing.h [moved from dali-toolkit/internal/text/markup-processor-character-spacing.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-color.cpp [moved from dali-toolkit/internal/text/markup-processor-color.cpp with 90% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-color.h [moved from dali-toolkit/internal/text/markup-processor-color.h with 96% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-embedded-item.cpp [moved from dali-toolkit/internal/text/markup-processor-embedded-item.cpp with 91% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-embedded-item.h [moved from dali-toolkit/internal/text/markup-processor-embedded-item.h with 95% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-font.cpp [moved from dali-toolkit/internal/text/markup-processor-font.cpp with 93% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-font.h [moved from dali-toolkit/internal/text/markup-processor-font.h with 97% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.cpp [moved from dali-toolkit/internal/text/markup-processor-helper-functions.cpp with 99% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h [moved from dali-toolkit/internal/text/markup-processor-helper-functions.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-paragraph.cpp [moved from dali-toolkit/internal/text/markup-processor-paragraph.cpp with 93% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-paragraph.h [moved from dali-toolkit/internal/text/markup-processor-paragraph.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-span.cpp [moved from dali-toolkit/internal/text/markup-processor-span.cpp with 91% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-span.h [moved from dali-toolkit/internal/text/markup-processor-span.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-strikethrough.cpp [moved from dali-toolkit/internal/text/markup-processor-strikethrough.cpp with 93% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-strikethrough.h [moved from dali-toolkit/internal/text/markup-processor-strikethrough.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-underline.cpp [moved from dali-toolkit/internal/text/markup-processor-underline.cpp with 95% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor-underline.h [moved from dali-toolkit/internal/text/markup-processor-underline.h with 100% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor.cpp [moved from dali-toolkit/internal/text/markup-processor.cpp with 96% similarity]
dali-toolkit/internal/text/markup-processor/markup-processor.h [moved from dali-toolkit/internal/text/markup-processor.h with 100% similarity]
dali-toolkit/internal/text/property-string-parser.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/rendering/text-typesetter.h
dali-toolkit/internal/text/rendering/view-model.cpp
dali-toolkit/internal/text/rendering/view-model.h
dali-toolkit/internal/text/text-effects-style.cpp
dali-toolkit/internal/text/text-effects-style.h
dali-toolkit/internal/text/text-font-style.cpp
dali-toolkit/internal/text/text-font-style.h
dali-toolkit/internal/text/text-model-interface.h
dali-toolkit/internal/text/text-model.cpp
dali-toolkit/internal/text/text-model.h
dali-toolkit/internal/text/text-selection-handle-controller.cpp
dali-toolkit/internal/text/text-selection-handle-controller.h
dali-toolkit/internal/text/text-view-interface.h
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/text/text-view.h
dali-toolkit/internal/texture-manager/texture-manager-impl.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-manager.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
dali-toolkit/internal/visuals/text-visual-shader-factory.cpp [new file with mode: 0644]
dali-toolkit/internal/visuals/text-visual-shader-factory.h [new file with mode: 0644]
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.h
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/visual-factory-impl.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index e44aa56..d3f4e25 100644 (file)
@@ -125,6 +125,8 @@ struct DBusWrapper
   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
   {
index 5b8469d..5fc9349 100644 (file)
 #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
 {
index 00bf3d5..b064bfa 100644 (file)
@@ -20,7 +20,7 @@
 
 // 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
index e2ff409..d9fe5b7 100755 (executable)
@@ -43,6 +43,7 @@ const char* TEST_SVG_FILE_NAME    = TEST_RESOURCE_DIR "/svg1.svg";
 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)
 {
@@ -96,7 +97,7 @@ void dali_debug_rendering_cleanup(void)
 
 int UtcDaliDebugRenderingGetVisual1(void)
 {
-  EnvironmentVariable::SetTestingEnvironmentVariable(true);
+  EnvironmentVariable::SetTestEnvironmentVariable(DALI_DEBUG_RENDERING, "1");
   ToolkitTestApplication application;
   tet_infoline("UtcDaliDebugRenderingGetVisual1:  Request visual with a Property::Map");
 
@@ -213,13 +214,13 @@ int UtcDaliDebugRenderingGetVisual1(void)
   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");
 
@@ -257,13 +258,13 @@ int UtcDaliDebugRenderingGetVisual2(void)
   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");
 
@@ -322,13 +323,13 @@ int UtcDaliDebugRenderingGetVisual3(void)
   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");
 
@@ -372,13 +373,13 @@ int UtcDaliDebugRenderingGetVisual4(void)
     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();
@@ -400,7 +401,7 @@ int UtcDaliDebugRenderingGetVisualObject01(void)
   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;
 }
 
@@ -457,7 +458,7 @@ int UtcDaliDebugRenderingGetVisualObject03(void)
 
 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");
 
index 2930c6d..92113fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -22,9 +22,9 @@
 #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;
index b079ce3..53b45f2 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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;
index 75d8bb4..a0a27c9 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -25,7 +25,7 @@
 #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>
 
 
index 36117f7..3efd9aa 100644 (file)
@@ -24,8 +24,8 @@
 #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>
index 462a883..c64458a 100644 (file)
@@ -25,9 +25,9 @@
 #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>
index a3ad901..daabc0b 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -23,9 +23,9 @@
 #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;
index f768255..16dfc51 100644 (file)
@@ -23,8 +23,8 @@
 
 #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;
@@ -1441,4 +1441,4 @@ int UtcDaliTextEditorMarkupSpanCharacterSpacing(void)
   }
 
   END_TEST;
-}
\ No newline at end of file
+}
index da3ffc3..06eefbc 100644 (file)
@@ -22,9 +22,9 @@
 #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;
@@ -1350,4 +1350,4 @@ int UtcDaliTextFieldMarkupSpanCharacterSpacing(void)
   }
 
   END_TEST;
-}
\ No newline at end of file
+}
index d9a3c04..4f15239 100644 (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;
@@ -1337,4 +1337,4 @@ int UtcDaliTextLabelMarkupSpanCharacterSpacing(void)
   }
 
   END_TEST;
-}
\ No newline at end of file
+}
index 6999ffa..9f4cd73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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;
 }
@@ -81,39 +82,39 @@ int UtcDaliVisualAction(void)
 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;
 }
@@ -121,40 +122,40 @@ int UtcDaliVisualActionNotImplemented(void)
 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;
 
@@ -164,22 +165,22 @@ int UtcDaliVisualSetProperties(void)
 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;
 }
@@ -187,47 +188,50 @@ int UtcDaliAnimatedVectorImageVisualCreateInstancePropertyMap(void)
 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;
 }
@@ -235,29 +239,29 @@ int UtcDaliAnimatedVectorImageVisualSetProperties(void)
 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);
 
@@ -268,7 +272,7 @@ int UtcDaliVisualUpdateBrokenImageRenderer(void)
 
   //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);
index d917107..fcadd6f 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -111,109 +111,4 @@ inline bool CompareType<Extents>(Extents extents1, Extents extents2, float epsil
          (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
index 43aa8ce..726648a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -15,8 +15,8 @@
  *
  */
 
-#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>
index 5d8d143..4fc6cf2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -18,8 +18,7 @@
 #include "toolkit-environment-variable.h"
 
 // EXTERNAL INCLUDE
-#include <cstddef>
-#include <string>
+#include <map>
 
 namespace Dali
 {
@@ -27,36 +26,22 @@ namespace EnvironmentVariable
 {
 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
index 43b0758..96c9c88 100644 (file)
@@ -27,8 +27,6 @@ namespace EnvironmentVariable
 {
 const char* GetEnvironmentVariable(const char* variable);
 
-void SetTestingEnvironmentVariable(bool);
-
 void SetTestEnvironmentVariable(const char* variable, const char* value);
 
 } // namespace EnvironmentVariable
old mode 100755 (executable)
new mode 100644 (file)
index 2ccf2c1..e6456ec
@@ -1,5 +1,5 @@
 /*
- * 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;
     }
@@ -71,69 +71,71 @@ public:
 
   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
@@ -153,23 +155,23 @@ public:
     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
     {
@@ -178,6 +180,16 @@ public:
     return true;
   }
 
+  void InvalidateBuffer()
+  {
+    Dali::Mutex::ScopedLock lock(mMutex);
+    if(mResourceReady)
+    {
+      mNeedTrigger   = true;
+      mResourceReady = false;
+    }
+  }
+
   Dali::VectorAnimationRenderer::UploadCompletedSignalType& UploadCompletedSignal()
   {
     return mUploadCompletedSignal;
@@ -185,50 +197,67 @@ public:
 
   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  *******************************/
 /********************************************************************************/
@@ -239,7 +268,7 @@ VectorAnimationRenderer VectorAnimationRenderer::New()
 
   Internal::Adaptor::gVectorAnimationRenderer = animationRenderer;
 
-  return VectorAnimationRenderer( animationRenderer );
+  return VectorAnimationRenderer(animationRenderer);
 }
 
 VectorAnimationRenderer::VectorAnimationRenderer()
@@ -250,19 +279,19 @@ 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;
 }
 
@@ -272,51 +301,56 @@ void VectorAnimationRenderer::Finalize()
 
 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
@@ -325,15 +359,10 @@ namespace Test
 {
 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()
@@ -341,6 +370,5 @@ uint32_t GetDroppedFrames()
   return Dali::Internal::Adaptor::gVectorAnimationRenderer->mDroppedFrames;
 }
 
-} // VectorAnimationRenderer
-} // Test
-
+} // namespace VectorAnimationRenderer
+} // namespace Test
old mode 100755 (executable)
new mode 100644 (file)
index a1ea51b..bc241f1
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,6 @@ namespace Test
 {
 namespace VectorAnimationRenderer
 {
-
 #define VECTOR_ANIMATION_TOTAL_FRAME_NUMBER 5
 #define VECTOR_ANIMATION_MARKER_NAME_1 "marker1"
 #define VECTOR_ANIMATION_MARKER_NAME_2 "marker2"
@@ -31,12 +30,10 @@ namespace VectorAnimationRenderer
 #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
index 000bfa7..075cf2a 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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>
index 41028c1..0529655 100644 (file)
@@ -86,6 +86,9 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void)
   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);
@@ -119,6 +122,9 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual02(void)
   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);
@@ -160,6 +166,9 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual03(void)
   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);
@@ -210,8 +219,8 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
   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);
@@ -319,7 +328,8 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
   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);
@@ -558,6 +568,9 @@ int UtcDaliAnimatedVectorImageVisualCustomShader(void)
   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);
@@ -597,6 +610,9 @@ int UtcDaliAnimatedVectorImageVisualNaturalSize(void)
   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.
@@ -641,8 +657,8 @@ int UtcDaliAnimatedVectorImageVisualLoopCount(void)
   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);
@@ -685,7 +701,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   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);
@@ -712,10 +729,13 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   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);
@@ -734,10 +754,13 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
 
   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);
@@ -751,10 +774,13 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   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);
@@ -803,7 +829,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRangeMarker(void)
   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);
@@ -830,10 +857,13 @@ int UtcDaliAnimatedVectorImageVisualPlayRangeMarker(void)
   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);
@@ -854,10 +884,13 @@ int UtcDaliAnimatedVectorImageVisualPlayRangeMarker(void)
   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);
@@ -902,8 +935,8 @@ int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void)
   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);
@@ -921,7 +954,8 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
 
   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);
@@ -940,12 +974,18 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   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);
@@ -963,10 +1003,13 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
 
   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);
@@ -990,15 +1033,19 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   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);
@@ -1009,10 +1056,13 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   // 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);
@@ -1054,7 +1104,8 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
   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);
@@ -1079,10 +1130,13 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
 
   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);
@@ -1105,10 +1159,13 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
 
   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);
@@ -1169,8 +1226,8 @@ int UtcDaliAnimatedVectorImageVisualStopBehavior(void)
   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);
@@ -1217,6 +1274,14 @@ int UtcDaliAnimatedVectorImageVisualStopBehavior(void)
   // 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>();
@@ -1224,8 +1289,13 @@ int UtcDaliAnimatedVectorImageVisualStopBehavior(void)
   // 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);
@@ -1264,8 +1334,8 @@ int UtcDaliAnimatedVectorImageVisualLoopingMode(void)
   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);
@@ -1328,13 +1398,21 @@ int UtcDaliAnimatedVectorImageVisualPropertyNotification(void)
   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();
@@ -1342,19 +1420,17 @@ int UtcDaliAnimatedVectorImageVisualPropertyNotification(void)
   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();
@@ -1363,6 +1439,33 @@ int UtcDaliAnimatedVectorImageVisualPropertyNotification(void)
   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);
 
@@ -1411,12 +1514,21 @@ int UtcDaliAnimatedVectorImageVisualMultipleInstances(void)
 
   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);
@@ -1463,6 +1575,9 @@ int UtcDaliAnimatedVectorImageVisualControlVisibilityChanged(void)
   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);
 
@@ -1510,6 +1625,9 @@ int UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged(void)
   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);
 
@@ -1534,7 +1652,7 @@ int UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged(void)
   END_TEST;
 }
 
-int UtcDaliAnimatedVectorImageVisualInvalidFile(void)
+int UtcDaliAnimatedVectorImageVisualInvalidFile01(void)
 {
   ToolkitTestApplication application;
   tet_infoline("Request loading with invalid file - should draw broken image");
@@ -1561,6 +1679,99 @@ int UtcDaliAnimatedVectorImageVisualInvalidFile(void)
   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);
@@ -1593,6 +1804,12 @@ int UtcDaliAnimatedVectorImageVisualFrameDrops(void)
 
   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>();
@@ -1606,8 +1823,8 @@ int UtcDaliAnimatedVectorImageVisualFrameDrops(void)
   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();
@@ -1616,3 +1833,61 @@ int UtcDaliAnimatedVectorImageVisualFrameDrops(void)
 
   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;
+}
index b6458d3..b55622f 100644 (file)
@@ -28,8 +28,8 @@
 #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;
index 95c6abd..7a7bf26 100644 (file)
@@ -3703,7 +3703,7 @@ int UtcDaliImageViewCheckVariousCaseSendOnResourceReadySignal(void)
 
     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();
   };
@@ -3750,7 +3750,7 @@ int UtcDaliImageViewCheckVariousCaseSendOnResourceReadySignal(void)
   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
 
@@ -3761,7 +3761,7 @@ int UtcDaliImageViewCheckVariousCaseSendOnResourceReadySignal(void)
   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
@@ -3779,8 +3779,7 @@ int UtcDaliImageViewCheckVariousCaseSendOnResourceReadySignal(void)
   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);
 
@@ -3791,7 +3790,6 @@ int UtcDaliImageViewCheckVariousCaseSendOnResourceReadySignal(void)
   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);
index ba39604..2bfef0a 100644 (file)
@@ -64,7 +64,8 @@ const char* TEST_ROTATED_IMAGE            = TEST_RESOURCE_DIR "/keyboard-Landsca
 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                 = {};
@@ -2989,6 +2990,7 @@ int UtcDaliImageVisualLoadReady01(void)
 int UtcDaliImageVisualLoadImagePlanes01(void)
 {
   EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+  EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
 
   ToolkitTestApplication application;
 
@@ -3034,6 +3036,7 @@ int UtcDaliImageVisualLoadImagePlanes01(void)
 int UtcDaliImageVisualLoadImagePlanes02(void)
 {
   EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+  EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
 
   ToolkitTestApplication application;
 
@@ -3077,6 +3080,7 @@ int UtcDaliImageVisualLoadImagePlanes02(void)
 int UtcDaliImageVisualLoadImagePlanes03(void)
 {
   EnvironmentVariable::SetTestEnvironmentVariable(LOAD_IMAGE_YUV_PLANES_ENV, "1");
+  EnvironmentVariable::SetTestEnvironmentVariable(ENABLE_DECODE_JPEG_TO_YUV_420_ENV, "1");
 
   ToolkitTestApplication application;
 
index f54a7f0..dae8540 100644 (file)
@@ -4197,7 +4197,8 @@ int UtcDaliVisualRoundedCorner(void)
     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();
@@ -4573,7 +4574,8 @@ int UtcDaliVisualBorderline(void)
     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();
@@ -5605,8 +5607,8 @@ int UtcDaliVisualGetVisualProperty07(void)
   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();
index 48edaf8..442d75d 100644 (file)
 #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>
index 64e1397..390cabd 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,8 +22,8 @@
 #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
 {
index 8b3d8e1..9881636 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -19,7 +19,7 @@
 #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
 {
index 0b015bc..1c0ca6e 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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>
 
index bba91c6..128546b 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -19,7 +19,7 @@
 #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
 {
index 69e723b..ebdbae0 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
index 421db32..b7b5bf1 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
index b17f48d..385ecc6 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -19,7 +19,7 @@
 #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
 {
index af7a058..55908e8 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -24,7 +24,7 @@
 
 // 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
 {
index d1d6900..401b82f 100644 (file)
@@ -34,7 +34,7 @@
 #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>
index 4e492eb..92110f0 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -19,9 +19,9 @@
  */
 
 // 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>
 
index f89bb91..8e96367 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -18,7 +18,7 @@
  */
 
 // 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>
index a0d0ad4..a21dc86 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -29,7 +29,7 @@
 #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>
 
index c62988a..aaa58f7 100644 (file)
@@ -37,7 +37,7 @@
 #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>
index 403f777..067023a 100644 (file)
@@ -20,7 +20,7 @@
 #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>
index 6c4faa6..bed947d 100644 (file)
@@ -34,7 +34,7 @@
 #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>
index f1247f9..45af9b7 100644 (file)
@@ -21,7 +21,7 @@
 #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>
index 49f9197..f4dac1d 100644 (file)
@@ -29,7 +29,7 @@
 #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>
index 09bea45..4beea3f 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * 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>
index 6a0da6e..6fe96ad 100755 (executable)
@@ -2,7 +2,7 @@
 #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.
@@ -21,7 +21,7 @@
 // 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>
index d80bffe..2d71f4b 100644 (file)
@@ -44,6 +44,7 @@ SET( toolkit_src_files
    ${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
@@ -149,19 +150,6 @@ SET( toolkit_src_files
    ${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
@@ -171,18 +159,6 @@ SET( toolkit_src_files
    ${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
@@ -194,8 +170,33 @@ SET( toolkit_src_files
    ${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
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-shader.frag
deleted file mode 100644 (file)
index e9e1069..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-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 );
-}
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-with-style-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-with-style-shader.frag
deleted file mode 100644 (file)
index ca42ca6..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-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 );
-}
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-shader.frag
new file mode 100644 (file)
index 0000000..0fc642e
--- /dev/null
@@ -0,0 +1,63 @@
+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
+                 );
+}
index 4cc1212..6e90fe9 100644 (file)
@@ -1,9 +1,9 @@
-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;
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-shader.frag
deleted file mode 100644 (file)
index ab44460..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-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 );
-}
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-emoji-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-emoji-shader.frag
deleted file mode 100644 (file)
index 544f0be..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-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 );
-}
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-and-emoji-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-and-emoji-shader.frag
deleted file mode 100644 (file)
index 0d82aa7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-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 );
-}
diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-shader.frag b/dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-shader.frag
deleted file mode 100644 (file)
index cf93f15..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-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
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -25,9 +25,9 @@
 
 // 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
@@ -2,7 +2,7 @@
 #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.
@@ -26,8 +26,8 @@
 
 // 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
 {
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
 
 namespace Dali::Toolkit::Text
 {
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/controller/text-controller-impl.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -2,7 +2,7 @@
 #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.
@@ -19,7 +19,7 @@
  */
 
 // 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
 {
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -26,7 +26,7 @@
 // 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
 {
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -16,7 +16,7 @@
  */
 
 // 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
@@ -2,7 +2,7 @@
 #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
 {
@@ -1,5 +1,5 @@
 /*
- * 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>
 
@@ -2,7 +2,7 @@
 #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.
@@ -23,7 +23,7 @@
 #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
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -24,8 +24,8 @@
 
 // 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
 {
@@ -2,7 +2,7 @@
 #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.
@@ -24,7 +24,7 @@
 #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
 {
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -26,9 +26,9 @@
 #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
@@ -473,6 +473,7 @@ bool Controller::TextUpdater::RemoveText(
   UpdateInputStyleType type)
 {
   bool removed = false;
+  bool removeAll = false;
 
   Controller::Impl& impl      = *controller.mImpl;
   EventData*&       eventData = impl.mEventData;
@@ -526,9 +527,14 @@ bool Controller::TextUpdater::RemoveText(
       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.
@@ -574,7 +580,7 @@ bool Controller::TextUpdater::RemoveText(
 
       // 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;
@@ -617,6 +623,7 @@ bool Controller::TextUpdater::RemoveText(
       }
 
       DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", &controller, numberOfCharacters);
+      removeAll = false;
       removed = true;
     }
   }
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #include <string>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/controller/text-controller.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // 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>
 
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -24,7 +24,7 @@
 
 // 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
@@ -2,7 +2,7 @@
 #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>
@@ -2,7 +2,7 @@
 #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.
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -24,7 +24,7 @@
 
 // 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
@@ -2,7 +2,7 @@
 #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
@@ -2,7 +2,7 @@
 #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.
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -24,7 +24,7 @@
 
 // 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
@@ -2,7 +2,7 @@
 #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.
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -24,8 +24,8 @@
 
 // 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>
 
@@ -2,7 +2,7 @@
 #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.
@@ -16,7 +16,7 @@
  */
 
 // 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
@@ -16,7 +16,7 @@
  */
 
 // 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>
@@ -16,7 +16,7 @@
  */
 
 // 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>
 
@@ -941,10 +941,13 @@ void ResizeModelVectors(MarkupProcessData& markupProcessData,
   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
 }
index ec0fc94..9265472 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -24,7 +24,7 @@
 // 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
 {
index 1a1063c..1d8731d 100644 (file)
@@ -802,11 +802,14 @@ struct AtlasRenderer::Impl
     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
   }
index 14f3da7..5543d79 100644 (file)
@@ -983,7 +983,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
       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();
@@ -1004,17 +1004,6 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
       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();
@@ -1040,20 +1029,40 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
       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
@@ -1490,20 +1499,6 @@ Devel::PixelBuffer Typesetter::ApplyStrikethroughMarkupImageBuffer(Devel::PixelB
   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))
 {
index 3a71c31..296126e 100644 (file)
@@ -147,21 +147,6 @@ private:
   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.
index 9cfba93..0c4aeb3 100644 (file)
@@ -245,6 +245,11 @@ bool ViewModel::IsUnderlineEnabled() const
   return mModel->IsUnderlineEnabled();
 }
 
+bool const ViewModel::IsMarkupUnderlineSet() const
+{
+  return mModel->IsMarkupUnderlineSet();
+}
+
 float ViewModel::GetUnderlineHeight() const
 {
   return mModel->GetUnderlineHeight();
@@ -699,6 +704,11 @@ bool ViewModel::IsStrikethroughEnabled() const
   return mModel->IsStrikethroughEnabled();
 }
 
+bool const ViewModel::IsMarkupStrikethroughSet() const
+{
+  return mModel->IsMarkupStrikethroughSet();
+}
+
 Length ViewModel::GetNumberOfStrikethroughRuns() const
 {
   return mModel->GetNumberOfStrikethroughRuns();
index c7b0b18..c127ebb 100644 (file)
@@ -207,6 +207,11 @@ public:
   bool IsUnderlineEnabled() const override;
 
   /**
+   * @copydoc ModelInterface::IsMarkupUnderlineSet()
+   */
+  bool const IsMarkupUnderlineSet() const override;
+
+  /**
    * @copydoc ModelInterface::GetUnderlineHeight()
    */
   float GetUnderlineHeight() const override;
@@ -303,13 +308,27 @@ public:
    */
   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;
index 90c570a..c15a11d 100644 (file)
@@ -20,7 +20,7 @@
 
 // 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>
 
index d87e810..0ceeab3 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // 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>
 
index 117268a..ce5e860 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -22,7 +22,7 @@
 #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
index c85ec58..e2955c7 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -22,7 +22,7 @@
 #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
 {
index 0f2bd7b..0ccbb45 100644 (file)
@@ -262,6 +262,13 @@ public:
   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
@@ -376,6 +383,13 @@ public:
   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
index 0ac67ca..ba6dbcf 100644 (file)
@@ -187,6 +187,11 @@ bool Model::IsUnderlineEnabled() const
   return mVisualModel->IsUnderlineEnabled();
 }
 
+bool const Model::IsMarkupUnderlineSet() const
+{
+  return (mVisualModel->mUnderlineRuns.Count() > 0u);
+}
+
 float Model::GetUnderlineHeight() const
 {
   return mVisualModel->GetUnderlineHeight();
@@ -266,6 +271,11 @@ bool Model::IsStrikethroughEnabled() const
   return mVisualModel->IsStrikethroughEnabled();
 }
 
+bool const Model::IsMarkupStrikethroughSet() const
+{
+  return (mVisualModel->mStrikethroughRuns.Count() > 0u);
+}
+
 float Model::GetStrikethroughHeight() const
 {
   return mVisualModel->GetStrikethroughHeight();
index 416df17..a3a42a2 100644 (file)
@@ -205,6 +205,11 @@ public:
   bool IsUnderlineEnabled() const override;
 
   /**
+   * @copydoc ModelInterface::IsMarkupUnderlineSet()
+   */
+  bool const IsMarkupUnderlineSet() const override;
+
+  /**
    * @copydoc ModelInterface::GetUnderlineHeight()
    */
   float GetUnderlineHeight() const override;
@@ -274,11 +279,26 @@ public:
   */
   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()
    */
index e4bf91c..fef3baa 100644 (file)
@@ -25,7 +25,7 @@
 #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;
 
index 62032fd..a021009 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -21,7 +21,7 @@
 // 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
 {
index 98b420d..2fcf548 100644 (file)
@@ -175,6 +175,13 @@ public:
   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.
@@ -311,6 +318,13 @@ public:
   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
index 0be5ac6..0b81484 100644 (file)
@@ -670,6 +670,11 @@ bool View::IsUnderlineEnabled() const
   return false;
 }
 
+bool const View::IsMarkupUnderlineSet() const
+{
+  return (GetNumberOfUnderlineRuns() > 0u);
+}
+
 const GlyphInfo* View::GetHyphens() const
 {
   if(mImpl->mVisualModel)
@@ -865,6 +870,11 @@ bool View::IsStrikethroughEnabled() const
   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;
index 93542cc..7cccf19 100644 (file)
@@ -135,6 +135,11 @@ public:
   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;
@@ -232,6 +237,11 @@ public:
   bool IsStrikethroughEnabled() const override;
 
   /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupStrikethroughSet()
+   */
+  bool const IsMarkupStrikethroughSet() const;
+
+  /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughHeight()
    */
   float GetStrikethroughHeight() const override;
index 223208a..e23ee49 100644 (file)
@@ -39,7 +39,7 @@ constexpr auto DEFAULT_NUMBER_OF_REMOTE_LOADER_THREADS = size_t{8u};
 
 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)
 {
index 1017ae0..4b547b4 100644 (file)
@@ -102,12 +102,9 @@ AnimatedVectorImageVisual::AnimatedVectorImageVisual(VisualFactoryCache& factory
   // 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();
@@ -127,7 +124,7 @@ AnimatedVectorImageVisual::~AnimatedVectorImageVisual()
     }
 
     // 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();
   }
 }
@@ -146,10 +143,28 @@ void AnimatedVectorImageVisual::GetNaturalSize(Vector2& naturalSize)
   }
   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);
@@ -308,6 +323,8 @@ void AnimatedVectorImageVisual::OnInitialize(void)
 
   // Register transform properties
   mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
+
+  mVectorAnimationTask->SetRenderer(mImpl->mRenderer);
 }
 
 void AnimatedVectorImageVisual::DoSetOnScene(Actor& actor)
@@ -319,16 +336,13 @@ 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);
@@ -343,6 +357,15 @@ void AnimatedVectorImageVisual::DoSetOnScene(Actor& actor)
     {
       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);
@@ -351,7 +374,7 @@ void AnimatedVectorImageVisual::DoSetOnScene(Actor& actor)
 void AnimatedVectorImageVisual::DoSetOffScene(Actor& actor)
 {
   StopAnimation();
-  SendAnimationData();
+  TriggerVectorRasterization();
 
   if(mImpl->mRenderer)
   {
@@ -374,8 +397,10 @@ void AnimatedVectorImageVisual::DoSetOffScene(Actor& actor)
   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);
 }
@@ -398,7 +423,7 @@ void AnimatedVectorImageVisual::OnSetTransform()
       mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
     }
 
-    SendAnimationData();
+    TriggerVectorRasterization();
   }
 }
 
@@ -464,19 +489,41 @@ void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const
   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()
@@ -528,9 +575,12 @@ void AnimatedVectorImageVisual::SetVectorImageSize()
   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()
@@ -562,7 +612,7 @@ void AnimatedVectorImageVisual::OnScaleNotification(PropertyNotification& source
   {
     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;
@@ -582,16 +632,20 @@ void AnimatedVectorImageVisual::OnSizeNotification(PropertyNotification& source)
   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
+    }
   }
 }
 
index 4b14fc3..221cf23 100644 (file)
@@ -168,9 +168,10 @@ private:
   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.
index f23439d..7971b4d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -57,7 +57,7 @@ VectorAnimationManager::~VectorAnimationManager()
 
   if(mProcessorRegistered)
   {
-    Adaptor::Get().UnregisterProcessor(*this);
+    Adaptor::Get().UnregisterProcessor(*this, true);
   }
 
   for(auto observer : mLifecycleObservers)
@@ -97,7 +97,7 @@ void VectorAnimationManager::RegisterEventCallback(CallbackBase* callback)
 
   if(!mProcessorRegistered)
   {
-    Adaptor::Get().RegisterProcessor(*this);
+    Adaptor::Get().RegisterProcessor(*this, true); // Use post processor to trigger after layoutting
     mProcessorRegistered = true;
   }
 }
@@ -113,7 +113,7 @@ void VectorAnimationManager::UnregisterEventCallback(CallbackBase* callback)
     {
       if(Adaptor::IsAvailable())
       {
-        Adaptor::Get().UnregisterProcessor(*this);
+        Adaptor::Get().UnregisterProcessor(*this, true);
         mProcessorRegistered = false;
       }
     }
@@ -129,7 +129,7 @@ void VectorAnimationManager::Process(bool postProcessor)
   }
   mEventCallbacks.clear();
 
-  Adaptor::Get().UnregisterProcessor(*this);
+  Adaptor::Get().UnregisterProcessor(*this, true);
   mProcessorRegistered = false;
 }
 
index 86a37ab..b79f422 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -51,7 +51,9 @@ VectorAnimationTask::VectorAnimationTask(VisualFactoryCache& factoryCache)
   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),
@@ -72,8 +74,11 @@ VectorAnimationTask::VectorAnimationTask(VisualFactoryCache& factoryCache)
   mUpdateFrameNumber(false),
   mNeedAnimationFinishedTrigger(true),
   mAnimationDataUpdated(false),
-  mDestroyTask(false)
+  mDestroyTask(false),
+  mLoadRequest(false),
+  mLoadFailed(false)
 {
+  mVectorRenderer.UploadCompletedSignal().Connect(this, &VectorAnimationTask::OnUploadCompleted);
 }
 
 VectorAnimationTask::~VectorAnimationTask()
@@ -96,13 +101,14 @@ void VectorAnimationTask::Finalize()
   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;
   }
 
@@ -113,10 +119,8 @@ bool VectorAnimationTask::Load(const std::string& url)
   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);
 
@@ -132,6 +136,14 @@ void VectorAnimationTask::SetRenderer(Renderer renderer)
   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);
@@ -293,12 +305,12 @@ void VectorAnimationTask::SetPlayRange(const Property::Array& playRange)
         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;
   }
 }
@@ -326,7 +338,7 @@ void VectorAnimationTask::SetCurrentFrameNumber(uint32_t frameNumber)
   }
   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);
   }
 }
 
@@ -364,15 +376,16 @@ void VectorAnimationTask::GetLayerInfo(Property::Map& map) const
   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);
@@ -381,13 +394,23 @@ bool VectorAnimationTask::Rasterize()
       // 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);
   }
 
@@ -479,13 +502,12 @@ bool VectorAnimationTask::Rasterize()
     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)
@@ -600,6 +622,11 @@ void VectorAnimationTask::ApplyAnimationData()
     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)
@@ -619,6 +646,22 @@ void VectorAnimationTask::ApplyAnimationData()
   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
index 3c0b8e3..1e4ff4c 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -42,10 +42,17 @@ typedef IntrusivePtr<VectorAnimationTask> VectorAnimationTaskPtr;
 /**
  * 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>;
 
@@ -54,13 +61,14 @@ public:
    */
   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
   };
 
   /**
@@ -124,19 +132,18 @@ public:
   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.
@@ -182,16 +189,17 @@ public:
   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.
@@ -207,6 +215,13 @@ public:
 
 private:
   /**
+   * @brief Loads the animation file.
+   *
+   * @return True if loading succeeded, false otherwise.
+   */
+  bool Load();
+
+  /**
    * @brief Play the vector animation.
    */
   void PlayAnimation();
@@ -271,6 +286,16 @@ private:
    */
   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;
 
@@ -291,7 +316,9 @@ private:
   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;
@@ -313,6 +340,8 @@ private:
   bool                                 mNeedAnimationFinishedTrigger;
   bool                                 mAnimationDataUpdated;
   bool                                 mDestroyTask;
+  bool                                 mLoadRequest;
+  bool                                 mLoadFailed;
 };
 
 } // namespace Internal
index 97634f6..7e505c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -112,7 +112,7 @@ void VectorAnimationThread::AddTask(VectorAnimationTaskPtr task)
   }
 }
 
-void VectorAnimationThread::OnTaskCompleted(VectorAnimationTaskPtr task, bool keepAnimation)
+void VectorAnimationThread::OnTaskCompleted(VectorAnimationTaskPtr task, bool success, bool keepAnimation)
 {
   if(!mDestroyThread)
   {
@@ -131,7 +131,7 @@ void VectorAnimationThread::OnTaskCompleted(VectorAnimationTaskPtr task, bool ke
       needRasterize = true;
     }
 
-    if(keepAnimation)
+    if(keepAnimation && success)
     {
       if(mCompletedTasks.end() == std::find(mCompletedTasks.begin(), mCompletedTasks.end(), task))
       {
@@ -220,9 +220,9 @@ void VectorAnimationThread::Rasterize()
     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)
@@ -330,9 +330,9 @@ void VectorAnimationThread::SleepThread::Run()
     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);
index 8190e7b..b752105 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -60,9 +60,11 @@ public:
 
   /**
    * @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.
index 9a3f909..0ba9f52 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -125,11 +125,12 @@ void VectorRasterizeThread::Rasterize()
 
   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);
     }
   }
 }
diff --git a/dali-toolkit/internal/visuals/text-visual-shader-factory.cpp b/dali-toolkit/internal/visuals/text-visual-shader-factory.cpp
new file mode 100644 (file)
index 0000000..5a2eba8
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * 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
diff --git a/dali-toolkit/internal/visuals/text-visual-shader-factory.h b/dali-toolkit/internal/visuals/text-visual-shader-factory.h
new file mode 100644 (file)
index 0000000..4a9969b
--- /dev/null
@@ -0,0 +1,172 @@
+#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
index 777e48f..aa205cf 100644 (file)
@@ -148,9 +148,9 @@ void OpacityConstraint(float& current, const PropertyInputContainer& inputs)
 
 } // 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;
@@ -249,10 +249,12 @@ void TextVisual::EnablePreMultipliedAlpha(bool preMultiplied)
   }
 }
 
-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)
@@ -268,7 +270,7 @@ TextVisual::~TextVisual()
 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);
@@ -560,13 +562,14 @@ void TextVisual::UpdateRenderer()
         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);
@@ -604,7 +607,7 @@ PixelData TextVisual::ConvertToPixelData(unsigned char* buffer, int width, int h
   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;
@@ -618,21 +621,21 @@ void TextVisual::CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sa
     ++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);
@@ -651,14 +654,14 @@ void TextVisual::CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sa
   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.
@@ -667,7 +670,7 @@ void TextVisual::AddRenderer(Actor& actor, const Vector2& size, bool hasMultiple
   // 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
@@ -703,23 +706,23 @@ void TextVisual::AddRenderer(Actor& actor, const Vector2& size, bool hasMultiple
     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);
@@ -737,7 +740,7 @@ void TextVisual::AddRenderer(Actor& actor, const Vector2& size, bool hasMultiple
     }
 
     // Create a textureset in the default renderer.
-    CreateTextureSet(info, mImpl->mRenderer, sampler, hasMultipleTextColors, containsColorGlyph, styleEnabled, isOverlayStyle);
+    CreateTextureSet(info, mImpl->mRenderer, sampler);
 
     verifiedHeight -= maxTextureSize;
 
@@ -756,7 +759,7 @@ void TextVisual::AddRenderer(Actor& actor, const Vector2& size, bool hasMultiple
       // 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;
     }
@@ -800,7 +803,7 @@ void TextVisual::AddRenderer(Actor& actor, const Vector2& size, bool hasMultiple
   }
 }
 
-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();
@@ -809,7 +812,7 @@ TextureSet TextVisual::GetTextTexture(const Vector2& size, bool hasMultipleTextC
   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();
@@ -823,23 +826,23 @@ TextureSet TextVisual::GetTextTexture(const Vector2& size, bool hasMultipleTextC
   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);
@@ -850,73 +853,13 @@ TextureSet TextVisual::GetTextTexture(const Vector2& size, bool hasMultipleTextC
   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;
 }
 
index c79c254..c81fbce 100644 (file)
@@ -25,8 +25,9 @@
 #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
@@ -72,10 +73,11 @@ public:
    * @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.
@@ -153,8 +155,9 @@ protected:
    * @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().
@@ -274,16 +277,12 @@ private:
   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.
@@ -297,23 +296,17 @@ private:
   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.
@@ -328,32 +321,20 @@ private:
 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
index 6d9f28c..0edda01 100644 (file)
@@ -104,12 +104,18 @@ public:
     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,
index a4b0a0a..57290a1 100644 (file)
@@ -40,6 +40,7 @@
 #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>
@@ -77,6 +78,7 @@ const char* const BROKEN_IMAGE_FILE_NAME = "broken.png"; ///< The file name of t
 VisualFactory::VisualFactory(bool debugEnabled)
 : mFactoryCache(),
   mImageVisualShaderFactory(),
+  mTextVisualShaderFactory(),
   mSlotDelegate(this),
   mDebugEnabled(debugEnabled),
   mPreMultiplyOnLoad(true)
@@ -207,7 +209,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual(const Property::Map& propertyM
 
     case Toolkit::Visual::TEXT:
     {
-      visualPtr = TextVisual::New(GetFactoryCache(), propertyMap);
+      visualPtr = TextVisual::New(GetFactoryCache(), GetTextVisualShaderFactory(), propertyMap);
       break;
     }
 
@@ -426,6 +428,15 @@ ImageVisualShaderFactory& VisualFactory::GetImageVisualShaderFactory()
   return *mImageVisualShaderFactory;
 }
 
+TextVisualShaderFactory& VisualFactory::GetTextVisualShaderFactory()
+{
+  if(!mTextVisualShaderFactory)
+  {
+    mTextVisualShaderFactory = std::unique_ptr<TextVisualShaderFactory>(new TextVisualShaderFactory());
+  }
+  return *mTextVisualShaderFactory;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index a5ecda8..616b8d0 100644 (file)
@@ -2,7 +2,7 @@
 #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.
@@ -35,6 +35,7 @@ namespace Internal
 {
 class VisualFactoryCache;
 class ImageVisualShaderFactory;
+class TextVisualShaderFactory;
 
 /**
  * @copydoc Toolkit::VisualFactory
@@ -112,6 +113,11 @@ private:
    */
   ImageVisualShaderFactory& GetImageVisualShaderFactory();
 
+  /**
+   * Get the text visual shader factory, creating it if necessary.
+   */
+  TextVisualShaderFactory& GetTextVisualShaderFactory();
+
   VisualFactory(const VisualFactory&) = delete;
 
   VisualFactory& operator=(const VisualFactory& rhs) = delete;
@@ -119,6 +125,7 @@ private:
 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
index f04adf2..56a7313 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 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
index a643452..8619802 100644 (file)
@@ -1,6 +1,6 @@
 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