Merge "Enable Property::LABEL visual of a button when CreateVisuals" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 27 Dec 2018 14:02:25 +0000 (14:02 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 27 Dec 2018 14:02:25 +0000 (14:02 +0000)
14 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp [changed mode: 0644->0755]
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
dali-toolkit/devel-api/layouting/layout-group-impl.cpp
dali-toolkit/devel-api/layouting/layout-item-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/text/rendering/view-model.cpp
dali-toolkit/internal/visuals/svg/svg-visual.cpp

old mode 100644 (file)
new mode 100755 (executable)
index 49d36e0..fc87193
@@ -71,6 +71,7 @@ struct ElideData
   unsigned int numberOfLines;
   unsigned int numberOfGlyphs;
   float*       positions;
+  unsigned int ignoreOfGlyphs;
 };
 
 bool ElideTest( const ElideData& data )
@@ -130,7 +131,7 @@ bool ElideTest( const ElideData& data )
   if( numberOfLines != 0u )
   {
     const LineRun& lastLine = *( model->GetLines() + numberOfLines - 1u );
-    const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex;
+    const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex + data.ignoreOfGlyphs;
 
     std::cout << "  last line alignment offset : " << lastLine.alignmentOffset << std::endl;
 
@@ -594,6 +595,9 @@ int UtcDaliTextViewModelElideText02(void)
   Size textSize04( 80.f, 10.f );
   float positions04[] = { 2.f };
 
+  Size textSize05( 180.f, 100.f );
+  float positions05[] = { 0.f, 0.f };
+
   struct ElideData data[] =
   {
     {
@@ -602,7 +606,8 @@ int UtcDaliTextViewModelElideText02(void)
       textSize00,
       0u,
       0u,
-      NULL
+      NULL,
+      0u
     },
     {
       "Latin script",
@@ -610,7 +615,8 @@ int UtcDaliTextViewModelElideText02(void)
       textSize01,
       5u,
       42u,
-      positions01
+      positions01,
+      0u
     },
     {
       "Hebrew script",
@@ -618,7 +624,8 @@ int UtcDaliTextViewModelElideText02(void)
       textSize02,
       5u,
       49u,
-      positions02
+      positions02,
+      0u
     },
     {
       "Arabic script",
@@ -626,7 +633,8 @@ int UtcDaliTextViewModelElideText02(void)
       textSize03,
       5u,
       79u,
-      positions03
+      positions03,
+      0u
     },
     {
       "Small control size, no line fits.",
@@ -634,10 +642,20 @@ int UtcDaliTextViewModelElideText02(void)
       textSize04,
       1u,
       1u,
-      positions04
-    }
+      positions04,
+      0u
+    },
+    {
+      "Include newline character",
+      "<font family='TizenSans'>yesterday\n all\n my troubles\n seemed so far\n\n away now it looks</font>",
+      textSize05,
+      5u,
+      40,
+      positions05,
+      5u
+    },
   };
-  const unsigned int numberOfTests = 5u;
+  const unsigned int numberOfTests = 6u;
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
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 835aa66..a27f060 100644 (file)
@@ -614,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 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 3543fce..27932b2 100755 (executable)
@@ -349,6 +349,11 @@ void ViewModel::ElideGlyphs()
           {
             if( index > 0u )
             {
+              // If the index decreases to the previous line, firstPenX must be recalculated.
+              if( numberOfLaidOutGlyphs - index == lastLine.glyphRun.numberOfGlyphs)
+              {
+                firstPenSet = false;
+              }
               --index;
             }
             else
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