Merge branch 'devel/master' into tizen
authorSunghyun kim <scholb.kim@samsung.com>
Wed, 2 Jan 2019 01:55:33 +0000 (10:55 +0900)
committerSunghyun kim <scholb.kim@samsung.com>
Wed, 2 Jan 2019 01:55:41 +0000 (10:55 +0900)
Change-Id: Idb9b197d97e8879a17b4b6a316c0dd6f12be5bcf

18 files changed:
automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/utc-Dali-LayoutingAnimation.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/devel-api/layouting/layout-group-impl.cpp
dali-toolkit/devel-api/layouting/layout-item-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp
dali-toolkit/internal/layouting/layout-controller-impl.cpp
dali-toolkit/internal/layouting/layout-controller-impl.h
dali-toolkit/internal/layouting/layout-item-data-impl.cpp
dali-toolkit/internal/layouting/layout-item-data-impl.h
dali-toolkit/internal/layouting/layout-transition-data-impl.cpp
dali-toolkit/internal/layouting/layout-transition-data-impl.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 832d73e..465e7f3 100644 (file)
@@ -15,6 +15,8 @@
  *
  */
 
+#include <cstdlib>
+
 #include <dali-toolkit-test-suite-utils.h>
 // GTest fails to compile with "error: return-statement with a value, in function returning 'void'" error
 // if using dali assert function so define new assert with returning void.
@@ -26,7 +28,7 @@
         fprintf(stderr, \
             "Following expression is not true:\n" \
                 "%s\n", #exp); \
-        return; \
+        std::abort(); \
     }
 #include <gtest/gtest.h>
 #undef GTEST_HAS_DEATH_TEST
 
 int UtcDaliFlexboxLayoutTest(void)
 {
-  ToolkitTestApplication application;
   tet_infoline("UtcDaliFlexboxLayoutTest");
-  int argc = 0;
-  testing::InitGoogleTest( &argc, static_cast<char**>(nullptr) );
+  int argc = 1;
+  const char* argv = "yoga-gtest";
+  testing::InitGoogleTest( &argc,  const_cast< char** >( &argv ) );
 
   // The test function is a 3rd party function that should return true if the test passes
   if( !RUN_ALL_TESTS() )
index 96699ec..9825b56 100644 (file)
@@ -201,6 +201,8 @@ Toolkit::DummyControl Impl::DummyControl::New()
   return control;
 }
 
+int Impl::DummyControl::constructorCount;
+int Impl::DummyControl::destructorCount;
 
 Impl::DummyControl::DummyControl()
 : DummyControlImpl(),
@@ -227,10 +229,13 @@ Impl::DummyControl::DummyControl()
   keyInputFocusGained(false),
   keyInputFocusLost(false)
 {
+  ++constructorCount;
 }
 
-Impl::DummyControl::~DummyControl() { }
-
+Impl::DummyControl::~DummyControl()
+{
+  ++destructorCount;
+}
 
 void Impl::DummyControl::OnInitialize() { initializeCalled = true; }
 bool Impl::DummyControl::OnAccessibilityActivated() { activatedCalled = true; return true; }
index 5988284..d991a82 100644 (file)
@@ -207,6 +207,8 @@ public:
   bool keyEventCalled;
   bool keyInputFocusGained;
   bool keyInputFocusLost;
+  static int constructorCount;
+  static int destructorCount;
 
   Property::Map mLayouts;
   RelayoutCallbackFunc mRelayoutCallback;
index 2bf827a..9750070 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
 
 #include <../custom-layout.h>
+#include <dummy-control.h>
 
 #include <layout-utils.h>
 
@@ -1797,3 +1798,72 @@ int UtcDaliLayouting_DefaultTransition01(void)
   END_TEST;
 }
 
+int UtcDaliLayouting_CheckResourceLeak01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliLayouting_CheckResourceLeak01 - Remove animating layout and add child to stage" );
+
+  Dali::Toolkit::Impl::DummyControl::constructorCount = 0;
+  Dali::Toolkit::Impl::DummyControl::destructorCount = 0;
+
+  Stage stage = Stage::GetCurrent();
+  auto container = Control::New();
+  auto linearLayout = LinearLayout::New();
+  linearLayout.SetAnimateLayout( true );
+
+  DevelControl::SetLayout( container, linearLayout );
+  container.SetName( "Container" );
+
+  stage.Add( container );
+
+  DummyControl control = DummyControl::New( true );
+  control.SetName( "DummyControl01" );
+  control.SetSize( 100, 100 );
+  container.Add( control );
+
+  control = DummyControl::New( true );
+  control.SetName( "DummyControl02" );
+  control.SetSize( 100, 100 );
+  container.Add( control );
+
+  linearLayout.SetAnimateLayout( true );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 0, TEST_LOCATION );
+
+  // Initial rendering done
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 0, TEST_LOCATION );
+
+  stage.Remove( container );
+  container.Reset();
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 1, TEST_LOCATION );
+
+  Stage::GetCurrent().Add( control );
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 1, TEST_LOCATION );
+
+  stage.Remove( control );
+  control.Reset();
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 2, TEST_LOCATION );
+
+  END_TEST;
+}
+
index 98106dc..4fcf095 100755 (executable)
@@ -346,6 +346,7 @@ ALIASES += SINCE_1_0="@since 1.0"
 ALIASES += SINCE_1_1="@since 1.1"
 ALIASES += SINCE_1_2="@since 1.2"
 ALIASES += SINCE_1_3="@since 1.3"
+ALIASES += SINCE_1_4="@since 1.4"
 
 # Extra tags for Tizen 3.0
 ALIASES += SINCE_1_2_2="@since 1.2.2"
@@ -367,6 +368,7 @@ ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 1.2.8"
 ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 1.2.10"
 ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 1.2"
 ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 1.3"
+ALIASES += DEPRECATED_1_4="@deprecated Deprecated since 1.4"
 
 ALIASES += PLATFORM=""
 ALIASES += PRIVLEVEL_PLATFORM=""
@@ -384,6 +386,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += SINCE_1_1="\par Since:\n 3.0, DALi version 1.1"
 #ALIASES += SINCE_1_2="\par Since:\n 4.0, DALi version 1.2"
 #ALIASES += SINCE_1_3="\par Since:\n 5.0, DALi version 1.3"
+#ALIASES += SINCE_1_4="\par Since:\n 6.0, DALi version 1.4"
 
 ## Extra tags for Tizen 3.0
 #ALIASES += SINCE_1_2_2="\par Since:\n 3.0, DALi version 1.2.2"
@@ -407,6 +410,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 3.0, DALi version 1.2.10"
 #ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 4.0, DALi version 1.2"
 #ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 5.0, DALi version 1.3"
+#ALIASES += DEPRECATED_1_4="@deprecated Deprecated since 6.0, DALi version 1.4"
 
 #ALIASES += PLATFORM="@platform"
 #ALIASES += PRIVLEVEL_PLATFORM="\par Privilege Level:\n platform"
index a8927f9..a27f060 100644 (file)
@@ -59,6 +59,7 @@ LayoutGroup::~LayoutGroup()
 {
   // An object with a unique_ptr to an opaque structure must define it's destructor in the translation unit
   // where the opaque structure is defined. It cannot use the default method in the header file.
+  RemoveAll();
 }
 
 Toolkit::LayoutGroup::LayoutId LayoutGroup::Add( LayoutItem& child )
@@ -613,7 +614,7 @@ void LayoutGroup::ChildRemovedFromOwner( Actor child )
     if( childLayout )
     {
       Remove( *childLayout.Get() );
-      RequestLayout( Dali::Toolkit::LayoutTransitionData::Type::ON_CHILD_REMOVE, child, Actor() );
+      RequestLayout( Dali::Toolkit::LayoutTransitionData::Type::ON_CHILD_REMOVE, Actor(), child );
     }
   }
 }
index fe26362..a41a13e 100644 (file)
@@ -66,14 +66,14 @@ LayoutItemPtr LayoutItem::New( Handle& owner )
 
 void LayoutItem::Initialize( Handle& owner, const std::string& containerType )
 {
-  mImpl->mOwner = &(owner.GetBaseObject());
+  mImpl->mOwner = owner;
   RegisterChildProperties( containerType );
   OnInitialize(); // Ensure direct deriving class gets initialized
 }
 
 Handle LayoutItem::GetOwner() const
 {
-  return Handle::DownCast(BaseHandle(mImpl->mOwner));
+  return mImpl->mOwner.GetHandle();
 }
 
 void LayoutItem::Unparent()
@@ -92,7 +92,7 @@ void LayoutItem::Unparent()
   SetParent(nullptr);
 
   // Last, clear owner
-  mImpl->mOwner = NULL;
+  mImpl->mOwner.Reset();
 }
 
 LayoutTransitionDataPtr LayoutItem::GetDefaultTransition()
@@ -317,7 +317,7 @@ void LayoutItem::SetMinimumHeight( LayoutLength minimumHeight )
 
 Extents LayoutItem::GetPadding() const
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if( control )
   {
     Extents padding = control.GetProperty<Extents>( Toolkit::Control::Property::PADDING );
@@ -336,7 +336,7 @@ Extents LayoutItem::GetPadding() const
 
 Extents LayoutItem::GetMargin() const
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if ( control )
   {
     return control.GetProperty<Extents>( Toolkit::Control::Property::MARGIN );
@@ -415,44 +415,47 @@ LayoutParent* LayoutItem::GetParent()
 
 void LayoutItem::RequestLayout()
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if( control )
   {
     DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::RequestLayout control(%s)\n",
         control.GetName().c_str() );
+
+    // @todo Enforce failure if called in Measure/Layout passes.
+    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+    Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
+    layoutController.RequestLayout( Toolkit::LayoutItem( this ) );
   }
-  // @todo Enforce failure if called in Measure/Layout passes.
-  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
-  Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
-  layoutController.RequestLayout( Toolkit::LayoutItem( this ) );
 }
 
 void LayoutItem::RequestLayout( Dali::Toolkit::LayoutTransitionData::Type layoutAnimationType )
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if ( control )
   {
     DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::RequestLayout control(%s) layoutTranstionType(%d)\n",
         control.GetName().c_str(), (int)layoutAnimationType );
+
+    // @todo Enforce failure if called in Measure/Layout passes.
+    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+    Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
+    layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType );
   }
-  // @todo Enforce failure if called in Measure/Layout passes.
-  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
-  Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
-  layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType );
 }
 
 void LayoutItem::RequestLayout( Dali::Toolkit::LayoutTransitionData::Type layoutAnimationType, Actor gainedChild, Actor lostChild )
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if ( control )
   {
     DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::RequestLayout control(%s) layoutTranstionType(%d)\n",
         control.GetName().c_str(), (int)layoutAnimationType );
+
+    // @todo Enforce failure if called in Measure/Layout passes.
+    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+    Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
+    layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType, gainedChild, lostChild );
   }
-  // @todo Enforce failure if called in Measure/Layout passes.
-  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
-  Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
-  layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType, gainedChild, lostChild );
 }
 
 bool LayoutItem::IsLayoutRequested() const
@@ -517,7 +520,7 @@ MeasuredSize LayoutItem::GetMeasuredHeightAndState() const
 LayoutLength LayoutItem::GetSuggestedMinimumWidth() const
 {
   auto owner = GetOwner();
-  auto actor = Actor::DownCast(owner);
+  auto actor = Actor::DownCast( owner );
   auto naturalSize = actor ? actor.GetNaturalSize() : Vector3::ZERO;
 
   return std::max( mImpl->mMinimumSize.GetWidth(), LayoutLength( naturalSize.width ) );
@@ -526,7 +529,7 @@ LayoutLength LayoutItem::GetSuggestedMinimumWidth() const
 LayoutLength LayoutItem::GetSuggestedMinimumHeight() const
 {
   auto owner = GetOwner();
-  auto actor = Actor::DownCast(owner);
+  auto actor = Actor::DownCast( owner );
   auto naturalSize = actor ? actor.GetNaturalSize() : Vector3::ZERO;
 
   return std::max( mImpl->mMinimumSize.GetHeight(), LayoutLength( naturalSize.height ) );
index 8c35f25..3207f9b 100644 (file)
@@ -445,7 +445,8 @@ void Button::CreateVisualsForComponent( Property::Index index, const Property::V
                    index, DevelControl::IsVisualEnabled( *this, index )?"true":"false" );
     // enable the visual if needed for current state
     const bool enabled = ( ( index == VISUAL_INDEX_FOR_STATE[ mButtonState ][ BACKGROUND ] )||
-                           ( index == VISUAL_INDEX_FOR_STATE[ mButtonState ][ FOREGROUND ] ) );
+                           ( index == VISUAL_INDEX_FOR_STATE[ mButtonState ][ FOREGROUND ] )||
+                           ( index == Toolkit::Button::Property::LABEL ) );
     DevelControl::RegisterVisual( *this, index, buttonVisual, enabled, visualDepth );
   }
   else
index 0ecae06..ccc515d 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -305,8 +305,17 @@ const std::vector<std::string>& ToggleButton::GetToggleTooltips() const
 
 void ToggleButton::PrepareVisual(Property::Index index, Toolkit::Visual::Base& visual)
 {
-  DevelControl::RegisterVisual( *this, index, visual, true );
-  DevelControl::EnableVisual( *this, index, false );
+  bool enabled = false; // Disabled by default
+
+  // Unregister the visual with the given index if registered previously
+  if( DevelControl::GetVisual( *this, index ) )
+  {
+    // Check whether it was enabled to ensure we do the same with the new visual we're registering
+    enabled = DevelControl::IsVisualEnabled( *this, index );
+    DevelControl::UnregisterVisual( *this, index );
+  }
+
+  DevelControl::RegisterVisual( *this, index, visual, enabled );
 }
 
 void ToggleButton::RelayoutVisual( Property::Index index, const Vector2& size )
index 746e8e5..9d0b947 100644 (file)
@@ -82,7 +82,10 @@ void LayoutController::RequestLayout( LayoutItem& layoutItem, int layoutTransiti
   auto actor = Actor::DownCast( layoutItem.GetOwner() );
   if ( actor )
   {
-    DALI_LOG_INFO( gLogFilter, Debug::Concise, "LayoutController::RequestLayout owner[%s] layoutItem[%p] layoutTransitionType(%d)\n", actor.GetName().c_str(), &layoutItem, layoutTransitionType );
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "LayoutController::RequestLayout owner[%s] layoutItem[%p] layoutTransitionType(%d) gainedChild[%s] lostChild[%s]\n",
+      actor.GetName().c_str(), &layoutItem, layoutTransitionType,
+      gainedChild ? gainedChild.GetName().c_str() : "",
+      lostChild ? lostChild.GetName().c_str() : "");
   }
   else
   {
@@ -236,16 +239,19 @@ void LayoutController::UpdateMeasureHierarchyForAnimation( LayoutData& layoutDat
       continue;
     }
 
-    Actor actor = Actor::DownCast( layoutDataElement.handle );
-    LayoutDataAnimator animator = layoutData.layoutAnimatorArray[ layoutDataElement.animatorIndex ];
-    float width = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION );
-    float height = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION );
-
-    if( layoutDataElement.AdjustMeasuredSize( width, height, animator.animatorType ) )
+    Actor actor = layoutDataElement.handle.GetHandle();
+    if( actor )
     {
-      mActorSizeSpecs.push_back( ActorSizeSpec( actor ) );
-      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, static_cast<int>( width ) );
-      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, static_cast<int>( height ) );
+      LayoutDataAnimator animator = layoutData.layoutAnimatorArray[ layoutDataElement.animatorIndex ];
+      float width = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION );
+      float height = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION );
+
+      if( layoutDataElement.AdjustMeasuredSize( width, height, animator.animatorType ) )
+      {
+        mActorSizeSpecs.push_back( ActorSizeSpec( actor ) );
+        actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, static_cast<int>( width ) );
+        actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, static_cast<int>( height ) );
+      }
     }
   }
 
@@ -294,9 +300,12 @@ void LayoutController::RestoreActorsSpecs()
 {
   for( auto& actorSizeSpec : mActorSizeSpecs )
   {
-    Actor actor = actorSizeSpec.actor;
-    actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, actorSizeSpec.widthSpec );
-    actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, actorSizeSpec.heightSpec );
+    Actor actor = actorSizeSpec.actor.GetHandle();
+    if( actor )
+    {
+      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, actorSizeSpec.widthSpec );
+      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, actorSizeSpec.heightSpec );
+    }
   }
 }
 
@@ -333,10 +342,10 @@ void LayoutController::PerformLayoutPositioning( LayoutPositionDataArray& layout
 
   for( auto layoutPositionData : layoutPositionDataArray )
   {
-    Actor actor = Actor::DownCast( layoutPositionData.handle );
+    Actor actor = layoutPositionData.handle.GetHandle();
     if( actor && ( !layoutPositionData.animated || all ) )
     {
-      if ( !layoutPositionData.animated )
+      if( !layoutPositionData.animated )
       {
         actor.SetPosition( layoutPositionData.left, layoutPositionData.top );
         actor.SetSize( layoutPositionData.right - layoutPositionData.left, layoutPositionData.bottom - layoutPositionData.top );
@@ -365,7 +374,7 @@ void LayoutController::PerformLayoutAnimation( LayoutTransition& layoutTransitio
   {
     if( layoutDataElement.animatorIndex >= 0 )
     {
-      Actor actor = Actor::DownCast( layoutDataElement.handle );
+      Actor actor = layoutDataElement.handle.GetHandle();
       if ( actor )
       {
         LayoutDataAnimator animator = layoutAnimatorArray[ layoutDataElement.animatorIndex ];
index 7443776..8f78c32 100644 (file)
@@ -101,7 +101,7 @@ private:
     {
     }
 
-    Actor actor;
+    WeakHandle<Actor> actor;
     int widthSpec;
     int heightSpec;
   };
@@ -129,7 +129,7 @@ private:
     {
       layoutController.PerformLayoutPositioning( layoutDataPositionArray, true );
       layoutController.mAnimationFinishedFunctors.pop_front();
-      if (layoutTransitionType != -1)
+      if( layoutTransitionType != -1 )
       {
         LayoutTransitionDataPtr layoutTransitionDataPtr = layoutItem->GetTransitionData( layoutTransitionType );
         layoutTransitionDataPtr->EmitSignalFinish( layoutTransitionType );
index c97a8df..e6e41b6 100644 (file)
@@ -30,7 +30,7 @@ bool LayoutItem::Impl::sUseZeroUnspecifiedMeasureSpec = false;
 LayoutData* LayoutItem::Impl::sLayoutData = nullptr;
 
 LayoutItem::Impl::Impl()
-: mOwner( nullptr ),
+: mOwner(),
   mLayoutParent( nullptr ),
   mOldWidthMeasureSpec( 0 ),
   mOldHeightMeasureSpec( 0 ),
index 0b415ad..e7b2819 100644 (file)
@@ -16,7 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+#include <dali/public-api/object/weak-handle.h>
 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
 #include <dali-toolkit/devel-api/layouting/layout-controller.h>
 #include <dali-toolkit/devel-api/layouting/layout-size.h>
@@ -35,7 +35,7 @@ public:
   Impl();
 
 public:
-  BaseObject* mOwner; ///< Control or Visual that owns this layout. Raw pointer to prevent cyclic references
+  WeakHandle<Handle> mOwner; ///< Control or Visual that owns this layout. Weak pointer to prevent cyclic references
   LayoutParent* mLayoutParent; ///< The containing layout parent.
 
   MeasureSpec mOldWidthMeasureSpec;
index fa24192..07a32ca 100644 (file)
@@ -88,7 +88,7 @@ bool LayoutDataElement::AdjustMeasuredSize( float& width, float& height, Toolkit
     return false;
   }
 
-  Actor actor = Actor::DownCast( handle );
+  Actor actor = handle.GetHandle();
   float animateByMultiplier = ( animatorType == Toolkit::LayoutTransitionData::Animator::Type::ANIMATE_BY ) ? 1.0f : 0.0f;
   Vector3 size = actor.GetCurrentSize();
 
@@ -164,10 +164,13 @@ bool LayoutDataElement::AdjustMeasuredSize( float& width, float& height, Toolkit
 
 void LayoutDataElement::UpdatePropertyIndex()
 {
-  if( propertyIndex == -1 && handle && !propertyName.empty() )
+  if( propertyIndex == -1 && !propertyName.empty() )
   {
-    Actor actor = Actor::DownCast( handle );
-    propertyIndex = DevelHandle::GetPropertyIndex( actor, Property::Key( propertyName ) );
+    Actor actor = handle.GetHandle();
+    if( actor )
+    {
+      propertyIndex = DevelHandle::GetPropertyIndex( actor, Property::Key( propertyName ) );
+    }
   }
 }
 
@@ -223,7 +226,7 @@ LayoutTransitionDataPtr LayoutTransitionData::New()
 }
 
 LayoutTransitionData::PropertyAnimator::PropertyAnimator( )
-  : handle( Actor( ) )
+  : handle()
   , map()
   , interpolation( Animation::Linear )
 {
@@ -638,38 +641,41 @@ void LayoutTransitionData::CollectChildrenLayoutDataElements( Actor child, Layou
   // Add the children animators
   for( const LayoutDataElement& iter : layoutData.childrenLayoutDataArray )
   {
-    if( iter.handle != nullptr && iter.handle != child )
+    Actor actor = iter.handle.GetHandle();
+    if( actor && actor != child )
     {
       continue;
     }
 
     LayoutDataElement layoutDataElement = iter;
+    Actor gainedChild = layoutData.layoutTransition.gainedChild.GetHandle();
+    Actor lostChild = layoutData.layoutTransition.lostChild.GetHandle();
     switch ( layoutDataElement.condition )
     {
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_ADD:
         if ( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_ADD
-            || layoutData.layoutTransition.gainedChild != child )
+            || gainedChild != child )
         {
           continue;
         }
         break;
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_REMOVE:
         if( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_REMOVE
-            || layoutData.layoutTransition.lostChild != child )
+            || lostChild != child )
         {
           continue;
         }
         break;
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_FOCUS_GAINED:
         if( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_FOCUS
-            || layoutData.layoutTransition.gainedChild != child )
+            || gainedChild != child )
         {
           continue;
         }
         break;
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_FOCUS_LOST:
         if( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_FOCUS
-            || layoutData.layoutTransition.lostChild != child )
+            || lostChild != child )
         {
           continue;
         }
@@ -713,7 +719,8 @@ void LayoutTransitionData::CollectLayoutDataElements( Actor owner, LayoutData& l
   // Collect the transition animators
   for( const LayoutDataElement& iter : mLayoutDataElements )
   {
-    if( iter.handle == nullptr || iter.handle != owner )
+    Actor actor = iter.handle.GetHandle();
+    if( !actor || actor != owner )
     {
       layoutData.childrenLayoutDataArray.push_back( iter );
       continue;
index 348f2d9..354a1bd 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/weak-handle.h>
 #include <dali/public-api/actors/actor-enumerations.h>
 #include <dali/public-api/animation/animation.h>
 
@@ -60,8 +61,8 @@ struct LayoutTransition
 
   LayoutItemPtr layoutItem;
   int layoutTransitionType;
-  Actor gainedChild;
-  Actor lostChild;
+  WeakHandle<Actor> gainedChild;
+  WeakHandle<Actor> lostChild;
 };
 
 const float DEFAULT_TRANSITION_DURATION( 0.5f );
@@ -92,12 +93,12 @@ using LayoutAnimatorArray = std::vector< LayoutDataAnimator >;
 
 struct LayoutPositionData
 {
-  LayoutPositionData( Handle handle, float left, float top, float right, float bottom, bool animated ) :
+  LayoutPositionData( Actor handle, float left, float top, float right, float bottom, bool animated ) :
       handle( handle ), left( left ), top( top ), right( right ), bottom( bottom ), animated( animated ), updateWithCurrentSize(false)
   {
   };
 
-  BaseHandle handle;
+  WeakHandle<Actor> handle;
   float left;
   float top;
   float right;
@@ -124,7 +125,7 @@ struct LayoutDataElement
   void UpdateAnimatorIndex( const LayoutAnimatorArray& animators );
   void UpdatePositionDataIndex( LayoutData& layoutData );
 
-  BaseHandle handle;
+  WeakHandle<Actor> handle;
   std::string propertyName;
   Property::Index propertyIndex;
   Property::Value initialValue;
@@ -154,7 +155,7 @@ public:
     PropertyAnimator( Actor actor, Property::Map map, Path path, Vector3 forward );
     PropertyAnimator( Actor actor, Property::Map map, KeyFrames keyFrames, Animation::Interpolation interpolation );
 
-    BaseHandle handle;
+    WeakHandle<Actor> handle;
 
     Property::Map map;
 
index f59901c..d9ca38b 100644 (file)
@@ -300,6 +300,11 @@ void SvgVisual::OnSetTransform()
       mVisualSize = visualSize;
     }
   }
+
+  if(mImpl->mRenderer)
+  {
+    mImpl->mTransform.RegisterUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
+  }
 }
 
 } // namespace Internal
index 5b6ff25..f18f84e 100644 (file)
@@ -30,8 +30,8 @@ namespace Toolkit
 {
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
-const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 54;
+const unsigned int TOOLKIT_MINOR_VERSION = 4;
+const unsigned int TOOLKIT_MICRO_VERSION = 0;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 763a9e9..b320c53 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.3.54
+Version:    1.4.0
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT