Update the preferred size after relayoutting
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-impl.cpp
index ed2ea15..6247000 100644 (file)
 #include <dali/public-api/object/type-registry.h>
 
 #include <dali/devel-api/actors/actor-devel.h>
-#include <dali/devel-api/actors/layer-devel.h>
 #include <dali/devel-api/common/capabilities.h>
 
 #include <dali/integration-api/debug.h>
 
+#include <dali/internal/event/actors/actor-coords.h>
 #include <dali/internal/event/actors/actor-parent.h>
 #include <dali/internal/event/actors/actor-property-handler.h>
 #include <dali/internal/event/actors/actor-relayouter.h>
 #include <dali/internal/event/actors/camera-actor-impl.h>
 #include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/common/projection.h>
 #include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/common/stage-impl.h>
@@ -148,6 +147,8 @@ DALI_PROPERTY("updateSizeHint", VECTOR2, true, false, false, Dali::DevelActor::P
 DALI_PROPERTY("captureAllTouchAfterStart", BOOLEAN, true, false, false, Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START)
 DALI_PROPERTY("touchAreaOffset", RECTANGLE, true, false, false, Dali::DevelActor::Property::TOUCH_AREA_OFFSET)
 DALI_PROPERTY("blendEquation", INTEGER, true, false, false, Dali::DevelActor::Property::BLEND_EQUATION)
+DALI_PROPERTY("touchFocusable", BOOLEAN, true, false, false, Dali::DevelActor::Property::TOUCH_FOCUSABLE)
+DALI_PROPERTY("keyboardFocusableChildren", BOOLEAN, true, false, false, Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN)
 DALI_PROPERTY_TABLE_END(DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties)
 
 // Signals
@@ -254,60 +255,6 @@ void EmitSignal(Actor& actor, Signal& signal, Param... params)
   }
 }
 
-bool ScreenToLocalInternal(
-  const Matrix&   viewMatrix,
-  const Matrix&   projectionMatrix,
-  const Matrix&   worldMatrix,
-  const Viewport& viewport,
-  const Vector3&  currentSize,
-  float&          localX,
-  float&          localY,
-  float           screenX,
-  float           screenY)
-{
-  // Get the ModelView matrix
-  Matrix modelView;
-  Matrix::Multiply(modelView, worldMatrix, viewMatrix);
-
-  // Calculate the inverted ModelViewProjection matrix; this will be used for 2 unprojects
-  Matrix invertedMvp(false /*don't init*/);
-  Matrix::Multiply(invertedMvp, modelView, projectionMatrix);
-  bool success = invertedMvp.Invert();
-
-  // Convert to GL coordinates
-  Vector4 screenPos(screenX - static_cast<float>(viewport.x), static_cast<float>(viewport.height) - screenY - static_cast<float>(viewport.y), 0.f, 1.f);
-
-  Vector4 nearPos;
-  if(success)
-  {
-    success = Unproject(screenPos, invertedMvp, static_cast<float>(viewport.width), static_cast<float>(viewport.height), nearPos);
-  }
-
-  Vector4 farPos;
-  if(success)
-  {
-    screenPos.z = 1.0f;
-    success     = Unproject(screenPos, invertedMvp, static_cast<float>(viewport.width), static_cast<float>(viewport.height), farPos);
-  }
-
-  if(success)
-  {
-    Vector4 local;
-    if(XyPlaneIntersect(nearPos, farPos, local))
-    {
-      Vector3 size = currentSize;
-      localX       = local.x + size.x * 0.5f;
-      localY       = local.y + size.y * 0.5f;
-    }
-    else
-    {
-      success = false;
-    }
-  }
-
-  return success;
-}
-
 } // unnamed namespace
 
 ActorPtr Actor::New()
@@ -811,6 +758,18 @@ void Actor::SetSizeInternal(const Vector3& size)
   {
     mTargetSize = size;
 
+    // Update the preferred size after relayoutting
+    // It should be used in the next relayoutting
+    if(mUseAnimatedSize & AnimatedSizeFlag::WIDTH && mRelayoutData)
+    {
+      mRelayoutData->preferredSize.width = mAnimatedSize.width;
+    }
+
+    if(mUseAnimatedSize & AnimatedSizeFlag::HEIGHT && mRelayoutData)
+    {
+      mRelayoutData->preferredSize.height = mAnimatedSize.height;
+    }
+
     // node is being used in a separate thread; queue a message to set the value & base value
     SceneGraph::NodeTransformPropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, mTargetSize);
 
@@ -1027,67 +986,34 @@ uint32_t Actor::AddRenderer(Renderer& renderer)
 {
   if(!mRenderers)
   {
-    mRenderers = new RendererContainer;
+    mRenderers = new RendererContainer(GetEventThreadServices());
   }
-
-  if(mIsBlendEquationSet)
-  {
-    renderer.SetBlendEquation(static_cast<DevelBlendEquation::Type>(mBlendEquation));
-  }
-
-  uint32_t    index       = static_cast<uint32_t>(mRenderers->size()); //  4,294,967,295 renderers per actor
-  RendererPtr rendererPtr = RendererPtr(&renderer);
-  mRenderers->push_back(rendererPtr);
-  AttachRendererMessage(GetEventThreadServices().GetUpdateManager(), GetNode(), renderer.GetRendererSceneObject());
-  return index;
+  return mRenderers->Add(GetNode(), renderer, mIsBlendEquationSet, mBlendEquation);
 }
 
 uint32_t Actor::GetRendererCount() const
 {
-  uint32_t rendererCount(0);
-  if(mRenderers)
-  {
-    rendererCount = static_cast<uint32_t>(mRenderers->size()); //  4,294,967,295 renderers per actor
-  }
-
-  return rendererCount;
+  return mRenderers ? mRenderers->GetCount() : 0u;
 }
 
 RendererPtr Actor::GetRendererAt(uint32_t index)
 {
-  RendererPtr renderer;
-  if(index < GetRendererCount())
-  {
-    renderer = (*mRenderers)[index];
-  }
-
-  return renderer;
+  return mRenderers ? mRenderers->GetRendererAt(index) : nullptr;
 }
 
 void Actor::RemoveRenderer(Renderer& renderer)
 {
   if(mRenderers)
   {
-    RendererIter end = mRenderers->end();
-    for(RendererIter iter = mRenderers->begin(); iter != end; ++iter)
-    {
-      if((*iter).Get() == &renderer)
-      {
-        mRenderers->erase(iter);
-        DetachRendererMessage(GetEventThreadServices(), GetNode(), renderer.GetRendererSceneObject());
-        break;
-      }
-    }
+    mRenderers->Remove(GetNode(), renderer);
   }
 }
 
 void Actor::RemoveRenderer(uint32_t index)
 {
-  if(index < GetRendererCount())
+  if(mRenderers)
   {
-    RendererPtr renderer = (*mRenderers)[index];
-    DetachRendererMessage(GetEventThreadServices(), GetNode(), renderer.Get()->GetRendererSceneObject());
-    mRenderers->erase(mRenderers->begin() + index);
+    mRenderers->Remove(GetNode(), index);
   }
 }
 
@@ -1097,12 +1023,10 @@ void Actor::SetBlendEquation(DevelBlendEquation::Type blendEquation)
   {
     if(mBlendEquation != blendEquation)
     {
-      mBlendEquation         = blendEquation;
-      uint32_t rendererCount = GetRendererCount();
-      for(uint32_t i = 0; i < rendererCount; ++i)
+      mBlendEquation = blendEquation;
+      if(mRenderers)
       {
-        RendererPtr renderer = GetRendererAt(i);
-        renderer->SetBlendEquation(static_cast<DevelBlendEquation::Type>(blendEquation));
+        mRenderers->SetBlending(blendEquation);
       }
     }
     mIsBlendEquationSet = true;
@@ -1139,54 +1063,17 @@ void Actor::SetDrawMode(DrawMode::Type drawMode)
 
 bool Actor::ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const
 {
-  // only valid when on-stage
-  if(mScene && OnScene())
-  {
-    const RenderTaskList& taskList = mScene->GetRenderTaskList();
-
-    Vector2 converted(screenX, screenY);
-
-    // do a reverse traversal of all lists (as the default onscreen one is typically the last one)
-    uint32_t taskCount = taskList.GetTaskCount();
-    for(uint32_t i = taskCount; i > 0; --i)
-    {
-      RenderTaskPtr task = taskList.GetTask(i - 1);
-      if(ScreenToLocal(*task, localX, localY, screenX, screenY))
-      {
-        // found a task where this conversion was ok so return
-        return true;
-      }
-    }
-  }
-  return false;
+  return mScene && OnScene() && ConvertScreenToLocalRenderTaskList(mScene->GetRenderTaskList(), GetNode().GetWorldMatrix(0), GetCurrentSize(), localX, localY, screenX, screenY);
 }
 
 bool Actor::ScreenToLocal(const RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY) const
 {
-  bool retval = false;
-  // only valid when on-stage
-  if(OnScene())
-  {
-    CameraActor* camera = renderTask.GetCameraActor();
-    if(camera)
-    {
-      Viewport viewport;
-      renderTask.GetViewport(viewport);
-
-      // need to translate coordinates to render tasks coordinate space
-      Vector2 converted(screenX, screenY);
-      if(renderTask.TranslateCoordinates(converted))
-      {
-        retval = ScreenToLocal(camera->GetViewMatrix(), camera->GetProjectionMatrix(), viewport, localX, localY, converted.x, converted.y);
-      }
-    }
-  }
-  return retval;
+  return OnScene() && ConvertScreenToLocalRenderTask(renderTask, GetNode().GetWorldMatrix(0), GetCurrentSize(), localX, localY, screenX, screenY);
 }
 
 bool Actor::ScreenToLocal(const Matrix& viewMatrix, const Matrix& projectionMatrix, const Viewport& viewport, float& localX, float& localY, float screenX, float screenY) const
 {
-  return OnScene() && ScreenToLocalInternal(viewMatrix, projectionMatrix, GetNode().GetWorldMatrix(0), viewport, GetCurrentSize(), localX, localY, screenX, screenY);
+  return OnScene() && ConvertScreenToLocal(viewMatrix, projectionMatrix, GetNode().GetWorldMatrix(0), GetCurrentSize(), viewport, localX, localY, screenX, screenY);
 }
 
 ActorGestureData& Actor::GetGestureData()
@@ -1342,6 +1229,8 @@ Actor::Actor(DerivedType derivedType, const SceneGraph::Node& node)
   mSensitive(true),
   mLeaveRequired(false),
   mKeyboardFocusable(false),
+  mKeyboardFocusableChildren(true),
+  mTouchFocusable(false),
   mOnSceneSignalled(false),
   mInsideOnSizeSet(false),
   mInheritPosition(true),
@@ -1455,7 +1344,7 @@ void Actor::UnparentChildren()
   mParentImpl.UnparentChildren();
 }
 
-void Actor::ConnectToScene(uint32_t parentDepth)
+void Actor::ConnectToScene(uint32_t parentDepth, bool notify)
 {
   // This container is used instead of walking the Actor hierarchy.
   // It protects us when the Actor hierarchy is modified during OnSceneConnectionExternal callbacks.
@@ -1466,44 +1355,18 @@ void Actor::ConnectToScene(uint32_t parentDepth)
     mScene->RequestRebuildDepthTree();
   }
 
-  // This stage is atomic i.e. not interrupted by user callbacks.
-  RecursiveConnectToScene(connectionList, parentDepth + 1);
+  // This stage is not interrupted by user callbacks.
+  mParentImpl.RecursiveConnectToScene(connectionList, parentDepth + 1);
 
   // Notify applications about the newly connected actors.
   for(const auto& actor : connectionList)
   {
-    actor->NotifyStageConnection();
+    actor->NotifyStageConnection(notify);
   }
 
   RelayoutRequest();
 }
 
-void Actor::RecursiveConnectToScene(ActorContainer& connectionList, uint32_t depth)
-{
-  DALI_ASSERT_ALWAYS(!OnScene());
-
-  mIsOnScene = true;
-  mDepth     = static_cast<uint16_t>(depth); // overflow ignored, not expected in practice
-
-  ConnectToSceneGraph();
-
-  // Notification for internal derived classes
-  OnSceneConnectionInternal();
-
-  // This stage is atomic; avoid emitting callbacks until all Actors are connected
-  connectionList.push_back(ActorPtr(this));
-
-  // Recursively connect children
-  if(GetChildCount() > 0)
-  {
-    for(const auto& child : mParentImpl.GetChildrenInternal())
-    {
-      child->SetScene(*mScene);
-      child->RecursiveConnectToScene(connectionList, depth + 1);
-    }
-  }
-}
-
 /**
  * This method is called when the Actor is connected to the Stage.
  * The parent must have added its Node to the scene-graph.
@@ -1524,19 +1387,22 @@ void Actor::ConnectToSceneGraph()
   OnSceneObjectAdd();
 }
 
-void Actor::NotifyStageConnection()
+void Actor::NotifyStageConnection(bool notify)
 {
   // Actors can be removed (in a callback), before the on-stage stage is reported.
   // The actor may also have been reparented, in which case mOnSceneSignalled will be true.
   if(OnScene() && !mOnSceneSignalled)
   {
-    // Notification for external (CustomActor) derived classes
-    OnSceneConnectionExternal(mDepth);
-
-    if(!mOnSceneSignal.Empty())
+    if(notify)
     {
-      Dali::Actor handle(this);
-      mOnSceneSignal.Emit(handle);
+      // Notification for external (CustomActor) derived classes
+      OnSceneConnectionExternal(mDepth);
+
+      if(!mOnSceneSignal.Empty())
+      {
+        Dali::Actor handle(this);
+        mOnSceneSignal.Emit(handle);
+      }
     }
 
     // Guard against Remove during callbacks
@@ -1547,7 +1413,7 @@ void Actor::NotifyStageConnection()
   }
 }
 
-void Actor::DisconnectFromStage()
+void Actor::DisconnectFromStage(bool notify)
 {
   // This container is used instead of walking the Actor hierachy.
   // It protects us when the Actor hierachy is modified during OnSceneDisconnectionExternal callbacks.
@@ -1558,39 +1424,16 @@ void Actor::DisconnectFromStage()
     mScene->RequestRebuildDepthTree();
   }
 
-  // This stage is atomic i.e. not interrupted by user callbacks
-  RecursiveDisconnectFromStage(disconnectionList);
+  // This stage is not interrupted by user callbacks
+  mParentImpl.RecursiveDisconnectFromScene(disconnectionList);
 
   // Notify applications about the newly disconnected actors.
   for(const auto& actor : disconnectionList)
   {
-    actor->NotifyStageDisconnection();
+    actor->NotifyStageDisconnection(notify);
   }
 }
 
-void Actor::RecursiveDisconnectFromStage(ActorContainer& disconnectionList)
-{
-  // need to change state first so that internals relying on IsOnScene() inside OnSceneDisconnectionInternal() get the correct value
-  mIsOnScene = false;
-
-  // Recursively disconnect children
-  if(GetChildCount() > 0)
-  {
-    for(const auto& child : mParentImpl.GetChildrenInternal())
-    {
-      child->RecursiveDisconnectFromStage(disconnectionList);
-    }
-  }
-
-  // This stage is atomic; avoid emitting callbacks until all Actors are disconnected
-  disconnectionList.push_back(ActorPtr(this));
-
-  // Notification for internal derived classes
-  OnSceneDisconnectionInternal();
-
-  DisconnectFromSceneGraph();
-}
-
 /**
  * This method is called by an actor or its parent, before a node removal message is sent.
  * This is recursive; the child calls DisconnectFromStage() for its children.
@@ -1601,20 +1444,23 @@ void Actor::DisconnectFromSceneGraph()
   OnSceneObjectRemove();
 }
 
-void Actor::NotifyStageDisconnection()
+void Actor::NotifyStageDisconnection(bool notify)
 {
   // Actors can be added (in a callback), before the off-stage state is reported.
   // Also if the actor was added & removed before mOnSceneSignalled was set, then we don't notify here.
   // only do this step if there is a stage, i.e. Core is not being shut down
   if(EventThreadServices::IsCoreRunning() && !OnScene() && mOnSceneSignalled)
   {
-    // Notification for external (CustomeActor) derived classes
-    OnSceneDisconnectionExternal();
-
-    if(!mOffSceneSignal.Empty())
+    if(notify)
     {
-      Dali::Actor handle(this);
-      mOffSceneSignal.Emit(handle);
+      // Notification for external (CustomeActor) derived classes
+      OnSceneDisconnectionExternal();
+
+      if(!mOffSceneSignal.Empty())
+      {
+        Dali::Actor handle(this);
+        mOffSceneSignal.Emit(handle);
+      }
     }
 
     // Guard against Add during callbacks
@@ -1627,17 +1473,7 @@ void Actor::NotifyStageDisconnection()
 
 bool Actor::IsNodeConnected() const
 {
-  bool connected(false);
-
-  if(OnScene())
-  {
-    if(IsRoot() || GetNode().GetParent())
-    {
-      connected = true;
-    }
-  }
-
-  return connected;
+  return OnScene() && (IsRoot() || GetNode().GetParent());
 }
 
 // This method initiates traversal of the actor tree using depth-first
@@ -1655,29 +1491,12 @@ void Actor::RebuildDepthTree()
   OwnerPointer<SceneGraph::NodeDepths> sceneGraphNodeDepths(new SceneGraph::NodeDepths());
 
   int32_t depthIndex = 1;
-  DepthTraverseActorTree(sceneGraphNodeDepths, depthIndex);
+  mParentImpl.DepthTraverseActorTree(sceneGraphNodeDepths, depthIndex);
 
   SetDepthIndicesMessage(GetEventThreadServices().GetUpdateManager(), sceneGraphNodeDepths);
   DALI_LOG_TIMER_END(depthTimer, gLogFilter, Debug::Concise, "Depth tree traversal time: ");
 }
 
-void Actor::DepthTraverseActorTree(OwnerPointer<SceneGraph::NodeDepths>& sceneGraphNodeDepths, int32_t& depthIndex)
-{
-  mSortedDepth = depthIndex * DevelLayer::SIBLING_ORDER_MULTIPLIER;
-  sceneGraphNodeDepths->Add(const_cast<SceneGraph::Node*>(&GetNode()), mSortedDepth);
-
-  // Create/add to children of this node
-  if(GetChildCount() > 0)
-  {
-    for(const auto& child : mParentImpl.GetChildrenInternal())
-    {
-      Actor* childActor = child.Get();
-      ++depthIndex;
-      childActor->DepthTraverseActorTree(sceneGraphNodeDepths, depthIndex);
-    }
-  }
-}
-
 void Actor::SetDefaultProperty(Property::Index index, const Property::Value& property)
 {
   PropertyHandler::SetDefaultProperty(*this, index, property);
@@ -1834,7 +1653,7 @@ void Actor::LowerBelow(Internal::Actor& target)
   }
 }
 
-void Actor::SetParent(ActorParent* parent, bool keepOnScene)
+void Actor::SetParent(ActorParent* parent, bool notify)
 {
   if(parent)
   {
@@ -1845,10 +1664,10 @@ void Actor::SetParent(ActorParent* parent, bool keepOnScene)
     mScene             = parentActor->mScene;
 
     if(EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
-       parentActor->OnScene() && !keepOnScene)
+       parentActor->OnScene())
     {
       // Instruct each actor to create a corresponding node in the scene graph
-      ConnectToScene(parentActor->GetHierarchyDepth());
+      ConnectToScene(parentActor->GetHierarchyDepth(), notify);
     }
 
     // Resolve the name and index for the child properties if any
@@ -1861,13 +1680,13 @@ void Actor::SetParent(ActorParent* parent, bool keepOnScene)
     mParent = nullptr;
 
     if(EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
-       OnScene() && !keepOnScene)
+       OnScene())
     {
       // Disconnect the Node & its children from the scene-graph.
       DisconnectNodeMessage(GetEventThreadServices().GetUpdateManager(), GetNode());
 
       // Instruct each actor to discard pointers to the scene-graph
-      DisconnectFromStage();
+      DisconnectFromStage(notify);
     }
 
     mScene = nullptr;
@@ -2060,36 +1879,14 @@ bool Actor::IsLayoutNegotiated(Dimension::Type dimension) const
 
 float Actor::GetHeightForWidthBase(float width)
 {
-  float height = 0.0f;
-
   const Vector3 naturalSize = GetNaturalSize();
-  if(naturalSize.width > 0.0f)
-  {
-    height = naturalSize.height * width / naturalSize.width;
-  }
-  else // we treat 0 as 1:1 aspect ratio
-  {
-    height = width;
-  }
-
-  return height;
+  return naturalSize.width > 0.0f ? naturalSize.height * width / naturalSize.width : width;
 }
 
 float Actor::GetWidthForHeightBase(float height)
 {
-  float width = 0.0f;
-
   const Vector3 naturalSize = GetNaturalSize();
-  if(naturalSize.height > 0.0f)
-  {
-    width = naturalSize.width * height / naturalSize.height;
-  }
-  else // we treat 0 as 1:1 aspect ratio
-  {
-    width = height;
-  }
-
-  return width;
+  return naturalSize.height > 0.0f ? naturalSize.width * height / naturalSize.height : height;
 }
 
 float Actor::CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
@@ -2279,6 +2076,8 @@ void Actor::SetNegotiatedSize(RelayoutContainer& container)
     Dali::Actor handle(this);
     mOnRelayoutSignal.Emit(handle);
   }
+
+  mRelayoutData->relayoutRequested = false;
 }
 
 void Actor::NegotiateSize(const Vector2& allocatedSize, RelayoutContainer& container)
@@ -2306,6 +2105,11 @@ void Actor::RelayoutRequest(Dimension::Type dimension)
   {
     Dali::Actor self(this);
     relayoutController->RequestRelayout(self, dimension);
+
+    if(mRelayoutData)
+    {
+      mRelayoutData->relayoutRequested = true;
+    }
   }
 }
 
@@ -2316,12 +2120,7 @@ void Actor::SetPreferredSize(const Vector2& size)
 
 Vector2 Actor::GetPreferredSize() const
 {
-  if(mRelayoutData)
-  {
-    return Vector2(mRelayoutData->preferredSize);
-  }
-
-  return Relayouter::DEFAULT_PREFERRED_SIZE;
+  return mRelayoutData ? Vector2(mRelayoutData->preferredSize) : Relayouter::DEFAULT_PREFERRED_SIZE;
 }
 
 void Actor::SetMinimumSize(float size, Dimension::Type dimension)
@@ -2332,12 +2131,7 @@ void Actor::SetMinimumSize(float size, Dimension::Type dimension)
 
 float Actor::GetMinimumSize(Dimension::Type dimension) const
 {
-  if(mRelayoutData)
-  {
-    return mRelayoutData->GetMinimumSize(dimension);
-  }
-
-  return 0.0f; // Default
+  return mRelayoutData ? mRelayoutData->GetMinimumSize(dimension) : 0.0f;
 }
 
 void Actor::SetMaximumSize(float size, Dimension::Type dimension)
@@ -2348,12 +2142,7 @@ void Actor::SetMaximumSize(float size, Dimension::Type dimension)
 
 float Actor::GetMaximumSize(Dimension::Type dimension) const
 {
-  if(mRelayoutData)
-  {
-    return mRelayoutData->GetMaximumSize(dimension);
-  }
-
-  return FLT_MAX; // Default
+  return mRelayoutData ? mRelayoutData->GetMaximumSize(dimension) : FLT_MAX;
 }
 
 void Actor::SetVisibleInternal(bool visible, SendMessage::Type sendMessage)
@@ -2371,7 +2160,7 @@ void Actor::SetVisibleInternal(bool visible, SendMessage::Type sendMessage)
     mVisible = visible;
 
     // Emit the signal on this actor and all its children
-    EmitVisibilityChangedSignalRecursively(visible, DevelActor::VisibilityChange::SELF);
+    mParentImpl.EmitVisibilityChangedSignalRecursively(visible, DevelActor::VisibilityChange::SELF);
   }
 }
 
@@ -2423,28 +2212,7 @@ void Actor::SetInheritLayoutDirection(bool inherit)
 
     if(inherit && mParent)
     {
-      InheritLayoutDirectionRecursively(GetParent()->mLayoutDirection);
-    }
-  }
-}
-
-void Actor::InheritLayoutDirectionRecursively(Dali::LayoutDirection::Type direction, bool set)
-{
-  if(mInheritLayoutDirection || set)
-  {
-    if(mLayoutDirection != direction)
-    {
-      mLayoutDirection = direction;
-      EmitLayoutDirectionChangedSignal(direction);
-      RelayoutRequest();
-    }
-
-    if(GetChildCount() > 0)
-    {
-      for(const auto& child : mParentImpl.GetChildrenInternal())
-      {
-        child->InheritLayoutDirectionRecursively(direction);
-      }
+      mParentImpl.InheritLayoutDirectionRecursively(GetParent()->mLayoutDirection);
     }
   }
 }
@@ -2455,20 +2223,6 @@ void Actor::SetUpdateSizeHint(const Vector2& updateSizeHint)
   SceneGraph::NodePropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mUpdateSizeHint, &AnimatableProperty<Vector3>::Bake, Vector3(updateSizeHint.width, updateSizeHint.height, 0.f));
 }
 
-void Actor::EmitVisibilityChangedSignalRecursively(bool                               visible,
-                                                   DevelActor::VisibilityChange::Type type)
-{
-  EmitVisibilityChangedSignal(visible, type);
-
-  if(GetChildCount() > 0)
-  {
-    for(auto& child : mParentImpl.GetChildrenInternal())
-    {
-      child->EmitVisibilityChangedSignalRecursively(visible, DevelActor::VisibilityChange::PARENT);
-    }
-  }
-}
-
 } // namespace Internal
 
 } // namespace Dali