[dali_2.3.16] Merge branch 'devel/master' 79/308379/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 22 Mar 2024 10:33:19 +0000 (10:33 +0000)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 22 Mar 2024 10:33:19 +0000 (10:33 +0000)
Change-Id: I92b5bab080d6064d707aca291d70dc345f49ecd2

25 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.h
automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
dali-scene3d/internal/light/light-impl.cpp
dali-scene3d/internal/light/light-impl.h
dali-scene3d/internal/model-components/model-node-impl.cpp
dali-scene3d/internal/model-components/model-node-impl.h
dali-toolkit/devel-api/controls/control-accessible.cpp
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/tooltip/tooltip.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/image-visual-shader-factory.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 8a1772a..ad2fba7 100644 (file)
@@ -461,6 +461,10 @@ int utcDaliAccessibilityControlAttributes(void)
   auto ptr                  = Dali::Accessibility::Accessible::Get(check_box_button);
   auto attribute_map_bridge = TestGetAttributes(ptr->GetAddress());
   auto counter              = 0u;
+
+  // Refresh the attributes since ControlAccessible::GetAttributes() might have added something
+  attributes     = check_box_button.GetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
+  attributes_map = attributes.GetMap();
   for(auto i = 0u; i < attributes_map->Count(); ++i)
     if((attributes_map->GetValue(i)).GetType() != Property::NONE)
       ++counter;
index a705241..49c344a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_ADAPTOR_IMPL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -37,10 +37,8 @@ using WindowContainer = std::vector<Window>;
 
 namespace Internal
 {
-
 namespace Adaptor
 {
-
 class GraphicsInterface;
 class SceneHolder;
 
@@ -50,7 +48,6 @@ class SceneHolder;
 
 namespace Integration
 {
-
 class GlAbstraction;
 
 } // namespace Integration
@@ -59,7 +56,6 @@ namespace Internal
 {
 namespace Adaptor
 {
-
 class Adaptor
 {
 public:
@@ -68,45 +64,57 @@ public:
   Adaptor();
   ~Adaptor();
 
-  void Start( Dali::Window window );
+  void Start(Dali::Window window);
+  void Stop();
 
-  bool AddIdle( CallbackBase* callback, bool hasReturnValue );
-  void RemoveIdle( CallbackBase* callback );
+  bool AddIdle(CallbackBase* callback, bool hasReturnValue);
+  void RemoveIdle(CallbackBase* callback);
   void RunIdles();
 
-  static Integration::Scene GetScene( Dali::Window window );
+  static Integration::Scene GetScene(Dali::Window window);
 
   Dali::RenderSurfaceInterface& GetSurface();
-  Dali::WindowContainer GetWindows();
-  Dali::SceneHolderList GetSceneHolders();
+  Dali::WindowContainer         GetWindows();
+  Dali::SceneHolderList         GetSceneHolders();
+
+  Dali::Internal::Adaptor::SceneHolder* GetWindow(Dali::Actor& actor);
+  void                                  AddWindow(Internal::Adaptor::SceneHolder* window);
+  void                                  RemoveWindow(Internal::Adaptor::SceneHolder* window);
 
-  Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
-  void AddWindow( Internal::Adaptor::SceneHolder* window );
-  void RemoveWindow( Internal::Adaptor::SceneHolder* window );
+  void RegisterProcessor(Integration::Processor& processor, bool postProcessor = false);
+  void UnregisterProcessor(Integration::Processor& processor, bool postProcessor = false);
 
-  void RegisterProcessor( Integration::Processor& processor, bool postProcessor = false);
-  void UnregisterProcessor( Integration::Processor& processor, bool postProcessor = false);
+  void SetApplication(Dali::TestApplication& testApplication);
 
-  void SetApplication( Dali::TestApplication& testApplication );
+  bool IsStopped() const
+  {
+    return mStopped;
+  }
 
-  Dali::Adaptor::AdaptorSignalType& ResizedSignal();
-  Dali::Adaptor::AdaptorSignalType& LanguageChangedSignal();
+  Dali::Adaptor::AdaptorSignalType&       ResizedSignal();
+  Dali::Adaptor::AdaptorSignalType&       LanguageChangedSignal();
   Dali::Adaptor::WindowCreatedSignalType& WindowCreatedSignal();
   Dali::Adaptor::LocaleChangedSignalType& LocaleChangedSignal();
 
-  static Adaptor& GetImpl( Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
-  static const Adaptor& GetImpl( const Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
+  static Adaptor& GetImpl(Dali::Adaptor& adaptor)
+  {
+    return *adaptor.mImpl;
+  }
+  static const Adaptor& GetImpl(const Dali::Adaptor& adaptor)
+  {
+    return *adaptor.mImpl;
+  }
 
 private:
-
-  Vector<CallbackBase*> mCallbacks;
-  Vector<CallbackBase*> mReturnCallbacks;
+  Vector<CallbackBase*>                        mCallbacks;
+  Vector<CallbackBase*>                        mReturnCallbacks;
   std::vector<Internal::Adaptor::SceneHolder*> mWindows;
-  Dali::Adaptor::AdaptorSignalType mResizedSignal;
-  Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal;
-  Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal;
-  Dali::Adaptor::LocaleChangedSignalType mLocaleChangedSignal;
-  TestApplication* mTestApplication;
+  Dali::Adaptor::AdaptorSignalType             mResizedSignal;
+  Dali::Adaptor::AdaptorSignalType             mLanguageChangedSignal;
+  Dali::Adaptor::WindowCreatedSignalType       mWindowCreatedSignal;
+  Dali::Adaptor::LocaleChangedSignalType       mLocaleChangedSignal;
+  TestApplication*                             mTestApplication;
+  bool                                         mStopped{false};
 };
 
 } // namespace Adaptor
index 566ca08..4d77310 100644 (file)
@@ -79,6 +79,18 @@ void Adaptor::Start(Dali::Window window)
   AddWindow(&GetImplementation(window));
 }
 
+void Adaptor::Stop()
+{
+  if(mTestApplication)
+  {
+    Integration::Core& core = mTestApplication->GetCore();
+    tet_printf("Adaptor::UnregisterProcessors\n");
+    core.UnregisterProcessors();
+  }
+
+  mStopped = true;
+}
+
 Integration::Scene Adaptor::GetScene(Dali::Window window)
 {
   return window.GetScene();
@@ -266,6 +278,7 @@ void Adaptor::Resume()
 
 void Adaptor::Stop()
 {
+  mImpl->Stop();
 }
 
 bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
@@ -342,7 +355,7 @@ Adaptor& Adaptor::Get()
 
 bool Adaptor::IsAvailable()
 {
-  return Internal::Adaptor::gAdaptor;
+  return Internal::Adaptor::gAdaptor && (!Internal::Adaptor::Adaptor::GetImpl(*Internal::Adaptor::gAdaptor).IsStopped());
 }
 
 void Adaptor::NotifySceneCreated()
index 4c5fe55..aec90ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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,6 +18,7 @@
 #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/adaptor-framework/native-image-source.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/property-array.h>
 #include <toolkit-application.h>
@@ -55,6 +56,7 @@ public:
     mFrameRate(60.0f),
     mTestFrameDrop(false),
     mNeedDroppedFrames(false),
+    mUseNativeImage(false),
     mEventThreadCallback(new EventThreadCallback(MakeCallback(this, &VectorAnimationRenderer::OnTriggered)))
   {
     mCount++;
@@ -229,12 +231,22 @@ public:
       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);
+      if(mUseNativeImage)
+      {
+        Dali::NativeImageSourcePtr nativeImageSource = Dali::NativeImageSource::New(mWidth, mHeight, Dali::NativeImageSource::COLOR_DEPTH_32);
+        Dali::Texture              texture           = Dali::Texture::New(*nativeImageSource);
+        textureSet.SetTexture(0, texture);
+      }
+      else
+      {
+        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();
     }
@@ -263,6 +275,7 @@ public:
   bool     mResourceReady{false};
   bool     mNeedTrigger{true};
   bool     mEnableFixedCache{false};
+  bool     mUseNativeImage{false};
 
   Dali::VectorAnimationRenderer::UploadCompletedSignalType mUploadCompletedSignal;
   std::unique_ptr<EventThreadCallback>                     mEventThreadCallback;
@@ -403,7 +416,6 @@ void VectorAnimationRenderer::KeepRasterizedBuffer()
   Internal::Adaptor::GetImplementation(*this).KeepRasterizedBuffer();
 }
 
-
 VectorAnimationRenderer::UploadCompletedSignalType& VectorAnimationRenderer::UploadCompletedSignal()
 {
   return Internal::Adaptor::GetImplementation(*this).UploadCompletedSignal();
@@ -426,5 +438,10 @@ uint32_t GetDroppedFrames()
   return Dali::Internal::Adaptor::gVectorAnimationRenderer->mDroppedFrames;
 }
 
+void UseNativeImageTexture(bool useNativeImage)
+{
+  Dali::Internal::Adaptor::gVectorAnimationRenderer->mUseNativeImage = useNativeImage;
+}
+
 } // namespace VectorAnimationRenderer
 } // namespace Test
index bc241f1..9177afd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEST_VECTOR_ANIMATION_RENDERER_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -32,6 +32,7 @@ namespace VectorAnimationRenderer
 
 void     DelayRendering(uint32_t delay);
 uint32_t GetDroppedFrames();
+void     UseNativeImageTexture(bool useNativeImage);
 
 } // namespace VectorAnimationRenderer
 } // namespace Test
index 8136955..72a4966 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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,6 +24,7 @@
 #include <toolkit-timer.h>
 #include <toolkit-vector-animation-renderer.h>
 #include "dummy-control.h"
+#include "test-native-image-source.h"
 
 #include <dali-toolkit/dali-toolkit.h>
 
@@ -2501,4 +2502,48 @@ int UtcDaliAnimatedVectorImageVisualFlushAction(void)
   dummyControl.Unparent();
 
   END_TEST;
+}
+
+int UtcDaliAnimatedVectorImageNativeTextureChangeShader(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliAnimatedVectorImageNativeTextureChangeShader");
+
+  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);
+
+  // Make we use native texture now.
+  Test::VectorAnimationRenderer::UseNativeImageTexture(true);
+
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+  application.Render();
+
+  // Trigger count is 1 - resource ready
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+  application.SendNotification();
+  application.Render();
+
+  Renderer        renderer = actor.GetRendererAt(0);
+  Shader          shader   = renderer.GetShader();
+  Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
+  Property::Map*  map      = value.GetMap();
+  DALI_TEST_CHECK(map);
+
+  std::string      resultFragmentShader, resultVertexShader;
+  Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+  fragment->Get(resultFragmentShader);
+  DALI_TEST_CHECK(resultFragmentShader.find(NativeImageSourceTest::GetCustomFragmentPrefix()) != std::string::npos);
+
+  // Reset to make we use normal texture again.
+  Test::VectorAnimationRenderer::UseNativeImageTexture(false);
+
+  END_TEST;
 }
\ No newline at end of file
index 212f45e..5ec6b5f 100644 (file)
@@ -611,18 +611,18 @@ int UtcDaliTableViewSetGetProperty(void)
   // Test "rows" property
   DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_ROWS) == TableView::Property::ROWS);
 
-  tableView.SetProperty(TableView::Property::ROWS, 4);
+  tableView.SetProperty(TableView::Property::ROWS, 7);
 
-  DALI_TEST_CHECK(tableView.GetRows() == 4u);
-  DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4);
+  DALI_TEST_CHECK(tableView.GetRows() == 7u);
+  DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 7);
 
   // Test "columns" property
   DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_COLUMNS) == TableView::Property::COLUMNS);
 
-  tableView.SetProperty(TableView::Property::COLUMNS, 5);
+  tableView.SetProperty(TableView::Property::COLUMNS, 8);
 
-  DALI_TEST_CHECK(tableView.GetColumns() == 5u);
-  DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5);
+  DALI_TEST_CHECK(tableView.GetColumns() == 8u);
+  DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 8);
 
   // Test "cellPadding" property
   DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_CELL_PADDING) == TableView::Property::CELL_PADDING);
@@ -640,6 +640,12 @@ int UtcDaliTableViewSetGetProperty(void)
   Property::Map item2;
   item2["policy"] = "relative";
   item2["value"]  = 0.2f;
+  //{ "policy": "fill"},
+  Property::Map item3;
+  item3["policy"] = "fill";
+  //{ "policy": "fit"},
+  Property::Map item4;
+  item4["policy"] = "fit";
 
   // Test "layoutRows" property
   DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS);
@@ -648,12 +654,16 @@ int UtcDaliTableViewSetGetProperty(void)
    * "layoutRows":
    *  {
    *    "1": { "policy": "fixed", "value": 30 },
-   *    "3": { "policy": "relative", "value": 0.2 }
+   *    "3": { "policy": "relative", "value": 0.2 },
+   *    "4": { "policy": "fill" },
+   *    "6": { "policy": "fit" },
    *   }
    */
   Property::Map layoutRows;
   layoutRows["1"] = item1;
   layoutRows["3"] = item2;
+  layoutRows["4"] = item3;
+  layoutRows["6"] = item4;
   tableView.SetProperty(TableView::Property::LAYOUT_ROWS, layoutRows);
 
   DALI_TEST_EQUALS(tableView.GetFixedHeight(1u), 30.f, TEST_LOCATION);
@@ -671,6 +681,14 @@ int UtcDaliTableViewSetGetProperty(void)
   DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("relative") == 0);
   DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 0.2f, TEST_LOCATION);
 
+  childMap = layoutRowsGet.GetValue(4).GetMap();
+  DALI_TEST_CHECK(layoutRowsGet.GetKey(4).compare(layoutRows.GetKey(2)) == 0);
+  DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fill") == 0);
+
+  childMap = layoutRowsGet.GetValue(6).GetMap();
+  DALI_TEST_CHECK(layoutRowsGet.GetKey(6).compare(layoutRows.GetKey(3)) == 0);
+  DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fit") == 0);
+
   // Test "layoutColumns" property
   DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_COLUMNS) == TableView::Property::LAYOUT_COLUMNS);
 
@@ -678,27 +696,41 @@ int UtcDaliTableViewSetGetProperty(void)
    * "layoutColumns":
    *  {
    *    "2": { "policy": "relative", "value": 0.2 },
-   *    "3": { "policy": "fixed", "value": 30 }
+   *    "3": { "policy": "fixed", "value": 30 },
+   *    "5": { "policy": "fit" },
+   *    "7": { "policy": "fill" }
    *   }
    */
   Property::Map layoutColumns;
   layoutColumns["2"] = item2;
   layoutColumns["3"] = item1;
+  layoutColumns["5"] = item4;
+  layoutColumns["7"] = item3;
   tableView.SetProperty(TableView::Property::LAYOUT_COLUMNS, layoutColumns);
 
   DALI_TEST_EQUALS(tableView.GetRelativeWidth(2u), 0.2f, TEST_LOCATION);
   DALI_TEST_EQUALS(tableView.GetFixedWidth(3u), 30.f, TEST_LOCATION);
 
   Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
+
   DALI_TEST_CHECK(layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0);
   childMap = layoutColumnsGet.GetValue(2).GetMap();
   DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("relative") == 0);
   DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 0.2f, TEST_LOCATION);
+
   childMap = layoutColumnsGet.GetValue(3).GetMap();
   DALI_TEST_CHECK(layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0);
   DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fixed") == 0);
   DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 30.f, TEST_LOCATION);
 
+  childMap = layoutColumnsGet.GetValue(5).GetMap();
+  DALI_TEST_CHECK(layoutColumnsGet.GetKey(5).compare(layoutColumns.GetKey(2)) == 0);
+  DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fit") == 0);
+
+  childMap = layoutColumnsGet.GetValue(7).GetMap();
+  DALI_TEST_CHECK(layoutColumnsGet.GetKey(7).compare(layoutColumns.GetKey(3)) == 0);
+  DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fill") == 0);
+
   END_TEST;
 }
 
index cc7c639..e43986c 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-scene3d/internal/light/light-impl.h>
 
 // EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
@@ -78,113 +79,26 @@ Light::~Light()
 {
 }
 
-void Light::Initialize()
+// From Internal::Control.
+
+void Light::OnInitialize()
 {
-  Self().SetProperty(Dali::Actor::Property::COLOR, Color::WHITE);
+  Actor self = Self();
+
+  // TODO : We need to check this is enough.
+  Toolkit::DevelControl::EnableCreateAccessible(Toolkit::Control::DownCast(self), false);
+
+  self.SetProperty(Dali::Actor::Property::COLOR, Color::WHITE);
 
   // Directional Light setting
   mLightSourceActor = Dali::CameraActor::New();
   mLightSourceActor.SetProjectionMode(Dali::Camera::ORTHOGRAPHIC_PROJECTION);
   mLightSourceActor.SetProperty(Dali::Actor::Property::POSITION, Vector3::ZERO);
   mLightSourceActor.SetProperty(Dali::Actor::Property::ORIENTATION, Quaternion());
-  Self().Add(mLightSourceActor);
-}
-
-void Light::Enable(bool enable)
-{
-  if(enable == mIsEnabled)
-  {
-    return;
-  }
-  mIsEnabled = enable;
-
-  Scene3D::SceneView sceneView = mParentSceneView.GetHandle();
-  if(!sceneView)
-  {
-    return;
-  }
-
-  if(mIsEnabled)
-  {
-    GetImpl(sceneView).AddLight(Scene3D::Light::DownCast(Self()));
-  }
-  else
-  {
-    GetImpl(sceneView).RemoveLight(Scene3D::Light::DownCast(Self()));
-  }
-}
-
-bool Light::IsEnabled() const
-{
-  return mIsEnabled;
-}
-
-void Light::EnableShadow(bool enable)
-{
-  if(enable == mIsShadowEnabled)
-  {
-    return;
-  }
-  mIsShadowEnabled = enable;
-
-  Scene3D::SceneView sceneView = mParentSceneView.GetHandle();
-  if(!sceneView)
-  {
-    return;
-  }
-
-  if(mIsShadowEnabled)
-  {
-    GetImpl(sceneView).SetShadow(Scene3D::Light::DownCast(Self()));
-  }
-  else
-  {
-    GetImpl(sceneView).RemoveShadow(Scene3D::Light::DownCast(Self()));
-  }
+  self.Add(mLightSourceActor);
 }
 
-bool Light::IsShadowEnabled() const
-{
-  return mIsShadowEnabled;
-}
-
-CameraActor Light::GetCamera() const
-{
-  return mLightSourceActor;
-}
-
-void Light::EnableShadowSoftFiltering(bool useSoftFiltering)
-{
-  mUseSoftFiltering = useSoftFiltering;
-  UpdateShadowUniforms();
-}
-
-bool Light::IsShadowSoftFilteringEnabled() const
-{
-  return mUseSoftFiltering;
-}
-
-void Light::SetShadowIntensity(float shadowIntensity)
-{
-  mShadowIntensity = shadowIntensity;
-  UpdateShadowUniforms();
-}
-
-float Light::GetShadowIntensity() const
-{
-  return mShadowIntensity;
-}
-
-void Light::SetShadowBias(float shadowBias)
-{
-  mShadowBias = shadowBias;
-  UpdateShadowUniforms();
-}
-
-float Light::GetShadowBias() const
-{
-  return mShadowBias;
-}
+// From CustomActorImpl.
 
 void Light::OnSceneConnection(int depth)
 {
@@ -294,6 +208,104 @@ const Light& GetImplementation(const Dali::Scene3D::Light& handle)
 
 // Public Method
 
+void Light::Enable(bool enable)
+{
+  if(enable == mIsEnabled)
+  {
+    return;
+  }
+  mIsEnabled = enable;
+
+  Scene3D::SceneView sceneView = mParentSceneView.GetHandle();
+  if(!sceneView)
+  {
+    return;
+  }
+
+  if(mIsEnabled)
+  {
+    GetImpl(sceneView).AddLight(Scene3D::Light::DownCast(Self()));
+  }
+  else
+  {
+    GetImpl(sceneView).RemoveLight(Scene3D::Light::DownCast(Self()));
+  }
+}
+
+bool Light::IsEnabled() const
+{
+  return mIsEnabled;
+}
+
+void Light::EnableShadow(bool enable)
+{
+  if(enable == mIsShadowEnabled)
+  {
+    return;
+  }
+  mIsShadowEnabled = enable;
+
+  Scene3D::SceneView sceneView = mParentSceneView.GetHandle();
+  if(!sceneView)
+  {
+    return;
+  }
+
+  if(mIsShadowEnabled)
+  {
+    GetImpl(sceneView).SetShadow(Scene3D::Light::DownCast(Self()));
+  }
+  else
+  {
+    GetImpl(sceneView).RemoveShadow(Scene3D::Light::DownCast(Self()));
+  }
+}
+
+bool Light::IsShadowEnabled() const
+{
+  return mIsShadowEnabled;
+}
+
+CameraActor Light::GetCamera() const
+{
+  return mLightSourceActor;
+}
+
+void Light::EnableShadowSoftFiltering(bool useSoftFiltering)
+{
+  mUseSoftFiltering = useSoftFiltering;
+  UpdateShadowUniforms();
+}
+
+bool Light::IsShadowSoftFilteringEnabled() const
+{
+  return mUseSoftFiltering;
+}
+
+void Light::SetShadowIntensity(float shadowIntensity)
+{
+  mShadowIntensity = shadowIntensity;
+  UpdateShadowUniforms();
+}
+
+float Light::GetShadowIntensity() const
+{
+  return mShadowIntensity;
+}
+
+void Light::SetShadowBias(float shadowBias)
+{
+  mShadowBias = shadowBias;
+  UpdateShadowUniforms();
+}
+
+float Light::GetShadowBias() const
+{
+  return mShadowBias;
+}
+
+// Public Static Method
+
 uint32_t Light::GetMaximumEnabledLightCount()
 {
   return MAX_NUMBER_OF_LIGHT;
@@ -324,6 +336,8 @@ std::string_view Light::GetShadowViewProjectionMatrixUniformName()
   return SHADOW_VIEW_PROJECTION_MATRIX_STRING;
 }
 
+// Private Method
+
 void Light::UpdateShadowUniforms()
 {
   Scene3D::SceneView sceneView = mParentSceneView.GetHandle();
index bb46c5f..6f0ff24 100644 (file)
@@ -57,61 +57,6 @@ public:
    */
   static Scene3D::Light New();
 
-  /**
-   * @copydoc Scene3D::Light::Enable()
-   */
-  void Enable(bool enable);
-
-  /**
-   * @copydoc Scene3D::Light::IsEnabled()
-   */
-  bool IsEnabled() const;
-
-  /**
-   * @copydoc Scene3D::Light::EnableShadow()
-   */
-  void EnableShadow(bool enable);
-
-  /**
-   * @copydoc Scene3D::Light::IsShadowEnabled()
-   */
-  bool IsShadowEnabled() const;
-
-  /**
-   * @copydoc Scene3D::Light::GetCamera()
-   */
-  CameraActor GetCamera() const;
-
-  /**
-   * @copydoc Scene3D::Light::EnableShadowSoftFiltering()
-   */
-  void EnableShadowSoftFiltering(bool useSoftFiltering);
-
-  /**
-   * @copydoc Scene3D::Light::IsShadowSoftFilteringEnabled()
-   */
-  bool IsShadowSoftFilteringEnabled() const;
-
-  /**
-   * @copydoc Scene3D::Light::SetShadowIntensity()
-   */
-  void SetShadowIntensity(float shadowIntensity);
-
-  /**
-   * @copydoc Scene3D::Light::GetShadowIntensity()
-   */
-  float GetShadowIntensity() const;
-
-  /**
-   * @copydoc Scene3D::Light::SetShadowBias()
-   */
-  void SetShadowBias(float shadowBias);
-
-  /**
-   * @copydoc Scene3D::Light::GetShadowBias()
-   */
-  float GetShadowBias() const;
-
 protected:
   /**
    * @brief Virtual destructor.
@@ -119,7 +64,13 @@ protected:
    */
   virtual ~Light();
 
-protected: // From CustomActorImpl
+public: // From Internal::Control.
+  /**
+   * @copydoc Dali::Toolkit::Internal::Control::OnInitialize()
+   */
+  void OnInitialize() override;
+
+protected: // From CustomActorImpl. Note that it will make we can ignore many codes what Internal::Control using now.
   /**
    * @copydoc CustomActorImpl::OnSceneConnection()
    * @note If overridden, then an up-call to Light::OnSceneConnection MUST be made at the end.
@@ -209,12 +160,63 @@ protected:
    */
   Light();
 
+public: // Public Method
   /**
-   * @brief Second phase initialization.
+   * @copydoc Scene3D::Light::Enable()
    */
-  void Initialize();
+  void Enable(bool enable);
 
-public: // Public Method
+  /**
+   * @copydoc Scene3D::Light::IsEnabled()
+   */
+  bool IsEnabled() const;
+
+  /**
+   * @copydoc Scene3D::Light::EnableShadow()
+   */
+  void EnableShadow(bool enable);
+
+  /**
+   * @copydoc Scene3D::Light::IsShadowEnabled()
+   */
+  bool IsShadowEnabled() const;
+
+  /**
+   * @copydoc Scene3D::Light::GetCamera()
+   */
+  CameraActor GetCamera() const;
+
+  /**
+   * @copydoc Scene3D::Light::EnableShadowSoftFiltering()
+   */
+  void EnableShadowSoftFiltering(bool useSoftFiltering);
+
+  /**
+   * @copydoc Scene3D::Light::IsShadowSoftFilteringEnabled()
+   */
+  bool IsShadowSoftFilteringEnabled() const;
+
+  /**
+   * @copydoc Scene3D::Light::SetShadowIntensity()
+   */
+  void SetShadowIntensity(float shadowIntensity);
+
+  /**
+   * @copydoc Scene3D::Light::GetShadowIntensity()
+   */
+  float GetShadowIntensity() const;
+
+  /**
+   * @copydoc Scene3D::Light::SetShadowBias()
+   */
+  void SetShadowBias(float shadowBias);
+
+  /**
+   * @copydoc Scene3D::Light::GetShadowBias()
+   */
+  float GetShadowBias() const;
+
+public: // Public Static Method
   /**
    * @copydoc Scene3D::Light::GetMaximumEnabledLightCount()
    */
index 3338069..2505c35 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-scene3d/internal/model-components/model-node-impl.h>
 
 // EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
@@ -73,18 +74,21 @@ ModelNode::~ModelNode()
 {
 }
 
-void ModelNode::Initialize()
-{
-  OnInitialize();
-}
+// From Internal::Control.
 
 void ModelNode::OnInitialize()
 {
   Actor self = Self();
+
+  // TODO : We need to check this is enough.
+  Toolkit::DevelControl::EnableCreateAccessible(Toolkit::Control::DownCast(self), false);
+
   self.RegisterProperty("uIsShadowCasting", static_cast<int>(mIsShadowCasting));
   self.RegisterProperty("uIsShadowReceiving", static_cast<int>(mIsShadowReceiving));
 }
 
+// From CustomActorImpl.
+
 void ModelNode::OnSceneConnection(int depth)
 {
 }
index 2d8e31d..a357180 100644 (file)
@@ -78,7 +78,13 @@ protected:
    */
   virtual ~ModelNode();
 
-protected: // From CustomActorImpl
+public: // From Internal::Control.
+  /**
+   * @copydoc Dali::Toolkit::Internal::Control::OnInitialize()
+   */
+  void OnInitialize() override;
+
+protected: // From CustomActorImpl. Note that it will make we can ignore many codes what Internal::Control using now.
   /**
    * @copydoc CustomActorImpl::OnSceneConnection()
    * @note If overridden, then an up-call to ModelNode::OnSceneConnection MUST be made at the end.
@@ -176,23 +182,6 @@ protected:
    */
   ModelNode();
 
-  /**
-   * @brief Second phase initialization.
-   * @SINCE_2_2.99
-   */
-  void Initialize();
-
-public: // API for derived classes to override
-  // Lifecycle
-
-  /**
-   * @brief This method is called after the Node has been initialized.
-   *
-   * Derived classes should do any second phase initialization by overriding this method.
-   * @SINCE_2_2.99
-   */
-  virtual void OnInitialize();
-
 public: // Public Method
   /**
    * @copydoc Dali::Scene3D::ModelNode::GetModelPrimitiveCount()
index c4ad881..8788ade 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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,6 +25,7 @@
 
 #include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/public-api/object/type-info.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
@@ -208,36 +209,49 @@ Dali::Accessibility::States ControlAccessible::GetStates()
 
 Dali::Accessibility::Attributes ControlAccessible::GetAttributes() const
 {
-  std::unordered_map<std::string, std::string> attributeMap;
-  auto                                         control   = Dali::Toolkit::Control::DownCast(Self());
-  auto                                         attribute = control.GetProperty(Dali::Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
-  auto                                         map       = attribute.GetMap();
+  static const std::string automationIdKey = "automationId";
+  static const std::string classKey        = "class";
 
-  if(map)
+  Accessibility::Attributes result;
+  Toolkit::Control          control        = Toolkit::Control::DownCast(Self());
+  Dali::Property::Value     property       = control.GetProperty(DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
+  Dali::Property::Map*      attributeMap   = property.GetMap();
+  std::size_t               attributeCount = attributeMap ? attributeMap->Count() : 0U;
+
+  for(std::size_t i = 0; i < attributeCount; i++)
   {
-    auto mapSize = map->Count();
+    Dali::Property::Key mapKey = attributeMap->GetKeyAt(i);
+    std::string         mapValue;
 
-    for(unsigned int i = 0; i < mapSize; i++)
+    if(mapKey.type == Dali::Property::Key::STRING && attributeMap->GetValue(i).Get(mapValue))
     {
-      auto mapKey = map->GetKeyAt(i);
-      if(mapKey.type == Dali::Property::Key::STRING)
-      {
-        std::string mapValue;
-        if(map->GetValue(i).Get(mapValue))
-        {
-          attributeMap.emplace(std::move(mapKey.stringKey), std::move(mapValue));
-        }
-      }
+      result.emplace(std::move(mapKey.stringKey), std::move(mapValue));
     }
   }
 
-  auto automationId = control.GetProperty<std::string>(Dali::Toolkit::DevelControl::Property::AUTOMATION_ID);
+  auto automationId = control.GetProperty<std::string>(DevelControl::Property::AUTOMATION_ID);
   if(!automationId.empty())
   {
-    attributeMap.emplace("automationId", std::move(automationId));
+    result.emplace(automationIdKey, std::move(automationId));
+  }
+
+  // Add "class" if not present already
+  if(result.find(classKey) == result.end())
+  {
+    Dali::TypeInfo typeInfo;
+    Self().GetTypeInfo(typeInfo);
+    if(typeInfo)
+    {
+      const std::string& typeName = typeInfo.GetName();
+
+      result.emplace(classKey, typeName);
+
+      // Save the 'typeName' so we don't have to calculate it again
+      DevelControl::AppendAccessibilityAttribute(control, classKey, typeName);
+    }
   }
 
-  return attributeMap;
+  return result;
 }
 
 bool ControlAccessible::IsHidden() const
index 8b69071..08c8bb9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -773,7 +773,7 @@ void Builder::LoadConfiguration(const TreeNode& root, Property::Map& intoMap)
                 {
                   // If we find "{","}" pair but can't find matched constant
                   // try to find other "{","}" pair after current left position.
-                  pos = leftPos + 1;
+                  pos = rightPos + 1;
 
                   for(uint32_t i = 0; i < mReplacementMap.Count(); i++)
                   {
@@ -784,11 +784,12 @@ void Builder::LoadConfiguration(const TreeNode& root, Property::Map& intoMap)
                     if(0 == stringConfigValue.compare(leftPos + 1, rightPos - leftPos - 1, constant.stringKey))
                     {
                       std::string replaceString;
-                      mReplacementMap.GetValue(i).Get(replaceString);
-
-                      stringConfigValue.replace(leftPos, rightPos - leftPos + 1, replaceString);
-                      pos = leftPos + replaceString.size();
-                      break;
+                      if(DALI_LIKELY(mReplacementMap.GetValue(i).Get(replaceString)))
+                      {
+                        stringConfigValue.replace(leftPos, rightPos - leftPos + 1, replaceString);
+                        pos = leftPos + replaceString.size();
+                        break;
+                      }
                     }
                   }
                 }
index ef56202..deab292 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -144,11 +144,22 @@ void ToggleButton::SetProperty(BaseObject* object, Property::Index propertyIndex
           std::vector<std::string> tips;
           size_t                   tipsCount = tipArray->Count();
           tips.resize(tipsCount);
+
+          bool valid = true;
           for(size_t i = 0; i != tipsCount; ++i)
           {
-            tipArray->GetElementAt(i).Get(tips[i]);
+            if(DALI_UNLIKELY(!tipArray->GetElementAt(i).Get(tips[i])))
+            {
+              // Given array is invalid. Fast out.
+              valid = false;
+              break;
+            }
+          }
+
+          if(DALI_LIKELY(valid))
+          {
+            toggleButtonImpl.SetToggleTooltips(tips);
           }
-          toggleButtonImpl.SetToggleTooltips(tips);
         }
         break;
       }
index 907e7e0..4aedfc0 100644 (file)
@@ -353,20 +353,21 @@ void SuperBlurView::SetProperty(BaseObject* object, Property::Index propertyInde
 
     if(propertyIndex == Toolkit::SuperBlurView::Property::IMAGE_URL)
     {
-      value.Get(superBlurViewImpl.mUrl);
-
-      PixelData pixels = SyncImageLoader::Load(superBlurViewImpl.mUrl);
-
-      if(pixels)
-      {
-        Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight());
-        texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight());
-
-        superBlurViewImpl.SetTexture(texture);
-      }
-      else
+      if(DALI_LIKELY(value.Get(superBlurViewImpl.mUrl)))
       {
-        DALI_LOG_ERROR("Cannot create image from property value\n");
+        PixelData pixels = SyncImageLoader::Load(superBlurViewImpl.mUrl);
+
+        if(pixels)
+        {
+          Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight());
+          texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight());
+
+          superBlurViewImpl.SetTexture(texture);
+        }
+        else
+        {
+          DALI_LOG_ERROR("Cannot create image from property value\n");
+        }
       }
     }
   }
index d75d100..686c1ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -1224,31 +1224,50 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
       std::istringstream(map->GetKey(i)) >> index;
       if(childMap)
       {
-        Property::Value* policy        = childMap->Find("policy");
-        Property::Value* childMapValue = childMap->Find("value");
-        if(policy && childMapValue)
+        Property::Value* policy = childMap->Find("policy");
+        if(policy)
         {
           std::string policyValue;
-          policy->Get(policyValue);
-          Toolkit::TableView::LayoutPolicy policy;
-          if(Scripting::GetEnumeration<Toolkit::TableView::LayoutPolicy>(policyValue.c_str(),
-                                                                         LAYOUT_POLICY_STRING_TABLE,
-                                                                         LAYOUT_POLICY_STRING_TABLE_COUNT,
-                                                                         policy))
+          if(DALI_LIKELY(policy->Get(policyValue)))
           {
-            if(policy == Toolkit::TableView::FIXED)
+            Toolkit::TableView::LayoutPolicy policy;
+            if(Scripting::GetEnumeration<Toolkit::TableView::LayoutPolicy>(policyValue.c_str(),
+                                                                           LAYOUT_POLICY_STRING_TABLE,
+                                                                           LAYOUT_POLICY_STRING_TABLE_COUNT,
+                                                                           policy))
             {
-              (tableViewImpl.*funcFixed)(index, childMapValue->Get<float>());
-            }
-            else if(policy == Toolkit::TableView::RELATIVE)
-            {
-              (tableViewImpl.*funcRelative)(index, childMapValue->Get<float>());
-            }
-            else if(policy == Toolkit::TableView::FIT)
-            {
-              (tableViewImpl.*funcFit)(index);
+              switch(policy)
+              {
+                case Toolkit::TableView::FIXED:
+                case Toolkit::TableView::RELATIVE:
+                {
+                  Property::Value* childMapValue = childMap->Find("value");
+                  float            childValue    = 0.0f;
+                  if(DALI_LIKELY(childMapValue && childMapValue->Get(childValue)))
+                  {
+                    if(policy == Toolkit::TableView::FIXED)
+                    {
+                      (tableViewImpl.*funcFixed)(index, childValue);
+                    }
+                    else // if(policy == Toolkit::TableView::RELATIVE)
+                    {
+                      (tableViewImpl.*funcRelative)(index, childValue);
+                    }
+                  }
+                  break;
+                }
+                case Toolkit::TableView::FIT:
+                {
+                  (tableViewImpl.*funcFit)(index);
+                  break;
+                }
+                default:
+                {
+                  // do nothing for FILL policy
+                  break;
+                }
+              }
             }
-            // do nothing for FILL policy
           }
         }
       }
index 1b4c749..687d3ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -289,8 +289,10 @@ void Tooltip::SetBackground(const Property::Value& value)
 
   if(type == Property::STRING)
   {
-    value.Get(mBackgroundImage);
-    mBackgroundBorder.Set(0, 0, 0, 0);
+    if(DALI_LIKELY(value.Get(mBackgroundImage)))
+    {
+      mBackgroundBorder.Set(0, 0, 0, 0);
+    }
   }
   else if(type == Property::MAP)
   {
index 5d8a355..f078dc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -101,7 +101,8 @@ AnimatedVectorImageVisual::AnimatedVectorImageVisual(VisualFactoryCache& factory
   mRendererAdded(false),
   mCoreShutdown(false),
   mRedrawInScalingDown(true),
-  mEnableFrameCache(false)
+  mEnableFrameCache(false),
+  mUseNativeImage(false)
 {
   // the rasterized image is with pre-multiplied alpha format
   mImpl->mFlags |= Visual::Base::Impl::IS_PREMULTIPLIED_ALPHA;
@@ -457,6 +458,7 @@ void AnimatedVectorImageVisual::DoSetOnScene(Actor& actor)
     Vector2 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
     mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize, false);
     actor.AddRenderer(mImpl->mRenderer);
+    mRendererAdded = true;
     ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
   }
   else
@@ -645,6 +647,29 @@ void AnimatedVectorImageVisual::OnResourceReady(VectorAnimationTask::ResourceSta
   else
   {
     mLoadFailed = status == VectorAnimationTask::ResourceStatus::FAILED ? true : false;
+    if(status == VectorAnimationTask::ResourceStatus::READY)
+    {
+      // Texture was ready. Change the shader if we need.
+      bool useNativeImage = false;
+      if(mImpl->mRenderer)
+      {
+        auto textureSet = mImpl->mRenderer.GetTextures();
+        if(textureSet && textureSet.GetTextureCount() > 0)
+        {
+          auto texture = textureSet.GetTexture(0u);
+          if(texture)
+          {
+            useNativeImage = DevelTexture::IsNative(texture);
+
+            if(mUseNativeImage != useNativeImage)
+            {
+              mUseNativeImage = useNativeImage;
+              UpdateShader();
+            }
+          }
+        }
+      }
+    }
 
     // If weak handle is holding a placement actor, it is the time to add the renderer to actor.
     Actor actor = mPlacementActor.GetHandle();
@@ -850,7 +875,8 @@ Shader AnimatedVectorImageVisual::GenerateShader() const
       mFactoryCache,
       ImageVisualShaderFeatureBuilder()
         .EnableRoundedCorner(IsRoundedCornerRequired())
-        .EnableBorderline(IsBorderlineRequired()));
+        .EnableBorderline(IsBorderlineRequired())
+        .SetTextureForFragmentShaderCheck(mUseNativeImage ? mImpl->mRenderer.GetTextures().GetTexture(0) : Dali::Texture()));
   }
   return shader;
 }
index 5ebd051..493e621 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_ANIMATED_VECTOR_IMAGE_VISUAL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -249,11 +249,13 @@ private:
   WeakHandle<Actor>                  mPlacementActor;
   DevelImageVisual::PlayState::Type  mPlayState;
   CallbackBase*                      mEventCallback; // Not owned
-  bool                               mLoadFailed;
-  bool                               mRendererAdded;
-  bool                               mCoreShutdown;
-  bool                               mRedrawInScalingDown;
-  bool                               mEnableFrameCache;
+
+  bool mLoadFailed : 1;
+  bool mRendererAdded : 1;
+  bool mCoreShutdown : 1;
+  bool mRedrawInScalingDown : 1;
+  bool mEnableFrameCache : 1;
+  bool mUseNativeImage : 1;
 };
 
 } // namespace Internal
index cef0f45..f0e413c 100644 (file)
@@ -86,6 +86,9 @@ Shader ImageVisualShaderFactory::GetShader(VisualFactoryCache& factoryCache, Ima
      (mFragmentShaderNeedChange == ImageVisualShaderFeature::ChangeFragmentShader::UNDECIDED ||
       mFragmentShaderNeedChange == ImageVisualShaderFeature::ChangeFragmentShader::NEED_CHANGE))
   {
+    DALI_ASSERT_DEBUG((static_cast<int>(shaderType) >= static_cast<int>(VisualFactoryCache::IMAGE_SHADER)) &&
+                      (static_cast<int>(shaderType) <= static_cast<int>(VisualFactoryCache::IMAGE_SHADER_ATLAS_CUSTOM_WRAP)) &&
+                      "Do not support native image shader for given feature!!");
     shaderType = static_cast<VisualFactoryCache::ShaderType>(static_cast<int>(shaderType) + NATIVE_SHADER_TYPE_OFFSET);
   }
 
index 9806706..1b3f098 100644 (file)
@@ -106,6 +106,8 @@ public:
     NATIVE_IMAGE_SHADER_ROUNDED_CORNER_MASKING,
     NATIVE_IMAGE_SHADER_BORDERLINE_MASKING,
     NATIVE_IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING,
+    NATIVE_IMAGE_SHADER_ATLAS_DEFAULT_WRAP,
+    NATIVE_IMAGE_SHADER_ATLAS_CUSTOM_WRAP,
     NINE_PATCH_SHADER,
     NINE_PATCH_MASK_SHADER,
     TEXT_SHADER_SINGLE_COLOR_TEXT,
index f867a50..6d89342 100644 (file)
@@ -97,6 +97,8 @@ DALI_ENUM_TO_STRING_TABLE_BEGIN(VISUAL_SHADER_TYPE)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NATIVE_IMAGE_SHADER_ROUNDED_CORNER_MASKING)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NATIVE_IMAGE_SHADER_BORDERLINE_MASKING)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NATIVE_IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING)
+  DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NATIVE_IMAGE_SHADER_ATLAS_DEFAULT_WRAP)
+  DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NATIVE_IMAGE_SHADER_ATLAS_CUSTOM_WRAP)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NINE_PATCH_SHADER)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, NINE_PATCH_MASK_SHADER)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::Internal::VisualFactoryCache::ShaderType, TEXT_SHADER_SINGLE_COLOR_TEXT)
index fbf364a..9af21f6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/math/math-utils.h>
-#include <dali/public-api/object/type-info.h>
-#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <cstring> // for strcmp
 #include <limits>
 #include <stack>
-#include <typeinfo>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/dali-toolkit.h>
@@ -443,14 +440,6 @@ void Control::Initialize()
   {
     SetKeyboardNavigationSupport(true);
   }
-
-  Dali::TypeInfo type;
-  Self().GetTypeInfo(type);
-  if(type)
-  {
-    const auto& typeName = type.GetName();
-    DevelControl::AppendAccessibilityAttribute(Toolkit::Control::DownCast(Self()), "class", typeName);
-  }
 }
 
 void Control::OnInitialize()
index fdad5c6..b6f3ef2 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 15;
+const unsigned int TOOLKIT_MICRO_VERSION = 16;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index f8f8e6c..a8d2477 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.3.15
+Version:    2.3.16
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT