[dali_1.2.65] Merge branch 'devel/master' 25/159625/1
authorVictor Cebollada <v.cebollada@samsung.com>
Fri, 10 Nov 2017 07:21:37 +0000 (07:21 +0000)
committerVictor Cebollada <v.cebollada@samsung.com>
Fri, 10 Nov 2017 07:21:37 +0000 (07:21 +0000)
Change-Id: Ieb3fed1d33b2fa9a096ab75d924c262d6a6d0a2c

18 files changed:
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/text/text-scroller.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.h
dali-toolkit/public-api/controls/control.h
dali-toolkit/public-api/controls/video-view/video-view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index dc30007..2cc4328 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
+#include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
@@ -171,6 +172,18 @@ Integration::TapGestureEvent GenerateTap(
   return tap;
 }
 
+Integration::LongPressGestureEvent GenerateLongPress(
+    Gesture::State state,
+    unsigned int numberOfTouches,
+    Vector2 point)
+{
+  Integration::LongPressGestureEvent longPress( state );
+
+  longPress.numberOfTouches = numberOfTouches;
+  longPress.point = point;
+  return longPress;
+}
+
 // Generate a PanGestureEvent to send to Core
 Integration::PanGestureEvent GeneratePan( Gesture::State state,
                                           const Vector2& previousPosition,
@@ -896,6 +909,12 @@ int UtcDaliTextEditorSetPropertyP(void)
   placeholderConversionMap[ Text::PlaceHolder::Property::FONT_STYLE ] = placeholderMapSet["fontStyle"];
   DALI_TEST_EQUALS( DaliTestCheckMaps( placeholderMapGet, placeholderConversionMap ), true, TEST_LOCATION );
 
+  editor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
+  DALI_TEST_EQUALS( editor.GetProperty<int>( Actor::Property::LAYOUT_DIRECTION ), static_cast<int>( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
   END_TEST;
 }
 
@@ -1751,6 +1770,14 @@ int utcDaliTextEditorEvent03(void)
     DALI_TEST_CHECK( renderer );
   }
 
+  // Long Press
+  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) );
+  application.ProcessEvent( GenerateLongPress( Gesture::Started,  1u, Vector2( 1.f, 25.0f ) ) );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
   END_TEST;
 }
 
@@ -2305,3 +2332,36 @@ int UtcDaliToolkitTextEditorTextWrapMode(void)
 
   END_TEST;
 }
+
+int UtcDaliTextEditorSetPaddingProperty(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliTextEditorSetPaddingProperty\n");
+
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+  editor.SetSize( 300.f, 50.f );
+  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  Stage::GetCurrent().Add( editor );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector3 originalSize = editor.GetNaturalSize();
+
+  editor.SetProperty( Toolkit::Control::Property::PADDING, Extents( 10, 10, 10, 10 ) );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( editor.GetProperty<Extents>( Toolkit::Control::Property::PADDING ), Extents( 10, 10, 10, 10 ), TEST_LOCATION );
+
+  Vector3 paddingAddedSize = editor.GetNaturalSize();
+
+  DALI_TEST_EQUALS( originalSize.width + 10 + 10 , paddingAddedSize.width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( originalSize.height + 10 + 10 , paddingAddedSize.height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+  END_TEST;
+}
index c3da54d..0074c78 100644 (file)
@@ -972,6 +972,12 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( TextField::Property::ELLIPSIS, true );
   DALI_TEST_CHECK( field.GetProperty<bool>( TextField::Property::ELLIPSIS ) );
 
+  field.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
+  DALI_TEST_EQUALS( field.GetProperty<int>( Actor::Property::LAYOUT_DIRECTION ), static_cast<int>( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
   END_TEST;
 }
 
@@ -2684,3 +2690,36 @@ int UtcDaliTextFieldSettingPlaceholder(void)
 
   END_TEST;
 }
+
+int UtcDaliTextFieldSetPaddingProperty(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliTextFieldSetPaddingProperty\n");
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+  field.SetSize( 300.f, 50.f );
+  field.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  Stage::GetCurrent().Add( field );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector3 originalSize = field.GetNaturalSize();
+
+  field.SetProperty( Toolkit::Control::Property::PADDING, Extents( 10, 10, 10, 10 ) );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( field.GetProperty<Extents>( Toolkit::Control::Property::PADDING ), Extents( 10, 10, 10, 10 ), TEST_LOCATION );
+
+  Vector3 paddingAddedSize = field.GetNaturalSize();
+
+  DALI_TEST_EQUALS( originalSize.width + 10 + 10 , paddingAddedSize.width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( originalSize.height + 10 + 10 , paddingAddedSize.height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+
+  END_TEST;
+}
index 31b147b..659eb54 100644 (file)
@@ -630,6 +630,12 @@ int UtcDaliToolkitTextlabelScrollingP(void)
     // Render some text with the shared atlas backend
     labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
     labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+
+    labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+
+    labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
     application.SendNotification();
     application.Render();
 
index e64a216..121d5f4 100644 (file)
@@ -826,6 +826,7 @@ int UtcDaliVisualGetPropertyMap7(void)
   propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::SVG );
   propertyMap.Insert( Visual::Property::MIX_COLOR, Color::WHITE );
   propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
+  propertyMap.Insert( ImageVisual::Property::ATLASING, false );
   Visual::Base svgVisual = factory.CreateVisual( propertyMap );
 
   Property::Map resultMap;
@@ -839,6 +840,33 @@ int UtcDaliVisualGetPropertyMap7(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == TEST_SVG_FILE_NAME );
 
+  value = resultMap.Find( ImageVisual::Property::ATLASING, Property::BOOLEAN );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<bool>() == false );
+
+  // request SvgVisual with a property map 2
+  propertyMap.Clear();
+  propertyMap[ "visualType" ] = Visual::SVG;
+  propertyMap[ "mixColor" ] = Color::WHITE;
+  propertyMap[ "url" ] = TEST_SVG_FILE_NAME;
+  propertyMap[ "atlasing" ] = true;
+  Visual::Base svgVisual1 = factory.CreateVisual( propertyMap );
+
+  resultMap.Clear();
+  svgVisual1.CreatePropertyMap( resultMap );
+  // check the property values from the returned map from a visual
+  value = resultMap.Find( Toolkit::Visual::Property::TYPE,  Property::INTEGER );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<int>() == Visual::SVG );
+
+  value = resultMap.Find( ImageVisual::Property::URL,  Property::STRING );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<std::string>() == TEST_SVG_FILE_NAME );
+
+  value = resultMap.Find( ImageVisual::Property::ATLASING, Property::BOOLEAN );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get<bool>() == true );
+
   // request SvgVisual with an URL
   Visual::Base svgVisual2 = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions() );
   resultMap.Clear();
index 91c25fd..950b3e1 100644 (file)
@@ -1023,6 +1023,52 @@ int UtcDaliVisualFactoryGetSvgVisualLarge(void)
   END_TEST;
 }
 
+int UtcDaliVisualFactoryGetSvgVisualAtlas(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with enabled atlas" );
+
+  VisualFactory factory = VisualFactory::Get();
+
+  Property::Map propertyMap;
+  propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::SVG );
+  propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
+  propertyMap.Insert( ImageVisual::Property::ATLASING, true );
+
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
+  DummyControl actor = DummyControl::New(true);
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+  actor.SetSize( 200.f, 200.f );
+  Stage::GetCurrent().Add( actor );
+  visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f) );
+
+  application.SendNotification();
+  application.Render();
+
+  // renderer is not added to actor until the rasterization is completed.
+  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  // renderer is added to actor
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+
+  // waiting for the resource uploading
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 //Creates a mesh visual from the given propertyMap and tries to load it on stage in the given application.
 //This is expected to succeed, which will then pass the test.
 void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
index 4fd92a7..ddcd598 100644 (file)
@@ -368,6 +368,7 @@ ALIASES += PRIVILEGE_DISPLAY=""
 ALIASES += PRIVILEGE_WINDOW_PRIORITY=""
 ALIASES += REMARK_INTERNET=""
 ALIASES += REMARK_STORAGE=""
+ALIASES += REMARK_RAWVIDEO=""
 
 ############################################
 ## For Tizen Native API Reference
@@ -399,6 +400,7 @@ ALIASES += REMARK_STORAGE=""
 #ALIASES += PRIVILEGE_WINDOW_PRIORITY="\par Privilege:\n http://tizen.org/privilege/window.priority.set"
 #ALIASES += REMARK_INTERNET="@remarks %http://tizen.org/privilege/internet is needed if @a url is a http or https address."
 #ALIASES += REMARK_STORAGE="@remarks %http://tizen.org/privilege/mediastorage is needed if @a url is relevant to media storage. @remarks %http://tizen.org/privilege/externalstorage is needed if @a url is relevant to external storage."
+#ALIASES += REMARK_RAWVIDEO="@remarks %http://tizen.org/feature/multimedia.raw_video is needed if UNDERLAY is false. If the feature isn't supported, UNDERLAY is always true."
 
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
 # A mapping has the form "name=value". For example adding "class=itcl::class"
index ef122fb..835bb4e 100644 (file)
@@ -262,18 +262,14 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
   if( mVisual )
   {
-    Extents margin;
-    margin = Self().GetProperty<Extents>( Toolkit::Control::Property::MARGIN );
-
     Extents padding;
     padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
 
     Property::Map transformMap = Property::Map();
 
-    if( ( padding.start != 0 ) || ( padding.end != 0 ) || ( padding.top != 0 ) || ( padding.bottom != 0 ) ||
-        ( margin.start != 0 ) || ( margin.end != 0 ) || ( margin.top != 0 ) || ( margin.bottom != 0 ) )
+    if( ( padding.start != 0 ) || ( padding.end != 0 ) || ( padding.top != 0 ) || ( padding.bottom != 0 ) )
     {
-      transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( margin.start + padding.start, margin.top + padding.top ) )
+      transformMap.Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( padding.start, padding.top ) )
                   .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
                   .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
                   .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
index bb84a5b..8ac3938 100644 (file)
@@ -1250,13 +1250,20 @@ void TextEditor::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange:
 
 Vector3 TextEditor::GetNaturalSize()
 {
-  return mController->GetNaturalSize();
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+
+  Vector3 naturalSize = mController->GetNaturalSize();
+  naturalSize.width += ( padding.start + padding.end );
+  naturalSize.height += ( padding.top + padding.bottom );
+
+  return naturalSize;
 }
 
 float TextEditor::GetHeightForWidth( float width )
 {
-  Padding padding;
-  Self().GetPadding( padding );
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
   return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
 }
 
@@ -1265,21 +1272,28 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor OnRelayout\n");
 
   Actor self = Self();
-  Padding padding;
 
-  self.GetPadding( padding );
-  Vector2 contentSize( size.x - ( padding.left + padding.right ), size.y - ( padding.top + padding.bottom ) );
+  Extents padding;
+  padding = self.GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+
+  Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) );
+
+  // Support Right-To-Left of padding
+  Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+  if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
+  {
+    std::swap( padding.start, padding.end );
+  }
 
   if( mStencil )
   {
-    mStencil.SetPosition( padding.left , padding.top  );
+    mStencil.SetPosition( padding.start, padding.top );
   }
   if( mActiveLayer )
   {
-    mActiveLayer.SetPosition( padding.left , padding.top  );
+    mActiveLayer.SetPosition( padding.start, padding.top );
   }
 
-
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize );
 
   if( ( Text::Controller::NONE_UPDATED != updateTextType ) ||
@@ -1427,9 +1441,9 @@ void TextEditor::OnTap( const TapGesture& gesture )
   mImfManager.Activate();
 
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
-  Padding padding;
-  Self().GetPadding( padding );
-  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
@@ -1443,9 +1457,9 @@ void TextEditor::OnLongPress( const LongPressGesture& gesture )
 {
   mImfManager.Activate();
 
-  Padding padding;
-  Self().GetPadding( padding );
-  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
index 0961fa1..1417743 100644 (file)
@@ -1303,13 +1303,20 @@ void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::
 
 Vector3 TextField::GetNaturalSize()
 {
-  return mController->GetNaturalSize();
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+
+  Vector3 naturalSize = mController->GetNaturalSize();
+  naturalSize.width += ( padding.start + padding.end );
+  naturalSize.height += ( padding.top + padding.bottom );
+
+  return naturalSize;
 }
 
 float TextField::GetHeightForWidth( float width )
 {
-  Padding padding;
-  Self().GetPadding( padding );
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
   return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
 }
 
@@ -1318,18 +1325,26 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField OnRelayout\n");
 
   Actor self = Self();
-  Padding padding;
 
-  self.GetPadding( padding );
-  Vector2 contentSize( size.x - ( padding.left + padding.right ), size.y - ( padding.top + padding.bottom ) );
+  Extents padding;
+  padding = self.GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+
+  Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) );
+
+  // Support Right-To-Left of padding
+  Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+  if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
+  {
+    std::swap( padding.start, padding.end );
+  }
 
   if( mStencil )
   {
-    mStencil.SetPosition( padding.left , padding.top  );
+    mStencil.SetPosition( padding.start, padding.top );
   }
   if( mActiveLayer )
   {
-    mActiveLayer.SetPosition( padding.left , padding.top  );
+    mActiveLayer.SetPosition( padding.start, padding.top );
   }
 
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize );
@@ -1404,13 +1419,21 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType )
 
     if( mStencil )
     {
-       mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset, scrollOffset.y );
+      mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset, scrollOffset.y );
     }
     else
     {
-       Padding padding;
-       Self().GetPadding( padding );
-       mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset + padding.left, scrollOffset.y + padding.top );
+      Extents padding;
+      padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+
+      // Support Right-To-Left of padding
+      Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+      if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
+      {
+        std::swap( padding.start, padding.end );
+      }
+
+      mRenderableActor.SetPosition( scrollOffset.x + mAlignmentOffset + padding.start, scrollOffset.y + padding.top );
     }
 
 
@@ -1491,9 +1514,9 @@ void TextField::OnTap( const TapGesture& gesture )
   mImfManager.Activate();
 
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
-  Padding padding;
-  Self().GetPadding( padding );
-  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
@@ -1507,9 +1530,9 @@ void TextField::OnLongPress( const LongPressGesture& gesture )
 {
   mImfManager.Activate();
 
-  Padding padding;
-  Self().GetPadding( padding );
-  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
index e8436ed..94957db 100644 (file)
@@ -819,7 +819,14 @@ void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::
 
 Vector3 TextLabel::GetNaturalSize()
 {
-  return mController->GetNaturalSize();
+  Extents padding;
+  padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
+
+  Vector3 naturalSize = mController->GetNaturalSize();
+  naturalSize.width += ( padding.start + padding.end );
+  naturalSize.height += ( padding.top + padding.bottom );
+
+  return naturalSize;
 }
 
 float TextLabel::GetHeightForWidth( float width )
@@ -873,16 +880,17 @@ void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container )
     // Update the visual
     TextVisual::EnableRendererUpdate( mVisual );
 
-    Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( Self().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>() );
+    // Support Right-To-Left of padding
+    Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
     if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
     {
-      std::swap(padding.start, padding.end);
+      std::swap( padding.start, padding.end );
     }
 
     Property::Map visualTransform;
     visualTransform.Add( Toolkit::Visual::Transform::Property::SIZE, contentSize )
                    .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
-                   .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2(padding.start, padding.top) )
+                   .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( padding.start, padding.top ) )
                    .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
                    .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
                    .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
index 466bfa6..f8089a2 100644 (file)
@@ -233,6 +233,10 @@ void TextScroller::StopScrolling()
       }
     }
   }
+  else
+  {
+    mScrollerInterface.ScrollingFinished();
+  }
 }
 
 TextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const
index 59cccd5..7ef4669 100644 (file)
@@ -508,8 +508,7 @@ void ImageVisual::DoSetProperty( Property::Index index, const Property::Value& v
 
     case Toolkit::ImageVisual::Property::ATLASING:
     {
-      bool atlasing = false;
-      mAttemptAtlasing = value.Get( atlasing );
+      value.Get( mAttemptAtlasing );
       break;
     }
 
@@ -1080,6 +1079,13 @@ void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, Textur
       ResourceReady( resourceStatus );
     }
   }
+
+  // Storing TextureSet needed when renderer staged.
+  if( ! mImpl->mRenderer )
+  {
+    mTextures = textureSet;
+  }
+
   mLoading = false;
 }
 
index a9d0c0c..eef883c 100644 (file)
@@ -41,6 +41,9 @@ namespace
 {
 const char * const UNITS("px");
 
+// property name
+const char * const IMAGE_ATLASING( "atlasing" );
+
 const Dali::Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
 }
 
@@ -76,7 +79,8 @@ SvgVisual::SvgVisual( VisualFactoryCache& factoryCache )
   mImageUrl( ),
   mParsedImage( NULL ),
   mPlacementActor(),
-  mVisualSize(Vector2::ZERO)
+  mVisualSize(Vector2::ZERO),
+  mAttemptAtlasing( false )
 {
   // the rasterized image is with pre-multiplied alpha format
   mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
@@ -93,11 +97,35 @@ SvgVisual::~SvgVisual()
 void SvgVisual::DoSetProperties( const Property::Map& propertyMap )
 {
   // url already passed in from constructor
+  for( Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter )
+  {
+    KeyValuePair keyValue = propertyMap.GetKeyValue( iter );
+    if( keyValue.first.type == Property::Key::INDEX )
+    {
+      DoSetProperty( keyValue.first.indexKey, keyValue.second );
+    }
+    else if( keyValue.first == IMAGE_ATLASING )
+    {
+      DoSetProperty( Toolkit::ImageVisual::Property::ATLASING, keyValue.second );
+    }
+  }
+}
+
+void SvgVisual::DoSetProperty( Property::Index index, const Property::Value& value )
+{
+  switch( index )
+  {
+    case Toolkit::ImageVisual::Property::ATLASING:
+    {
+      value.Get( mAttemptAtlasing );
+      break;
+    }
+  }
 }
 
 void SvgVisual::DoSetOnStage( Actor& actor )
 {
-  Shader shader = ImageVisual::GetImageShader( mFactoryCache, true, true );
+  Shader shader = ImageVisual::GetImageShader( mFactoryCache, mAttemptAtlasing, true );
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
   TextureSet textureSet = TextureSet::New();
   mImpl->mRenderer = Renderer::New( geometry, shader );
@@ -144,6 +172,7 @@ void SvgVisual::DoCreatePropertyMap( Property::Map& map ) const
   if( mImageUrl.IsValid() )
   {
     map.Insert( Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl() );
+    map.Insert( Toolkit::ImageVisual::Property::ATLASING, mAttemptAtlasing );
   }
 }
 
@@ -180,24 +209,30 @@ void SvgVisual::ApplyRasterizedImage( PixelData rasterizedPixelData )
   if( IsOnStage()  )
   {
     TextureSet currentTextureSet = mImpl->mRenderer.GetTextures();
-    if( mAtlasRect != FULL_TEXTURE_RECT )
+    if( mImpl->mFlags |= Impl::IS_ATLASING_APPLIED )
     {
       mFactoryCache.GetAtlasManager()->Remove( currentTextureSet, mAtlasRect );
     }
 
-    Vector4 atlasRect;
-    TextureSet textureSet = mFactoryCache.GetAtlasManager()->Add(atlasRect, rasterizedPixelData );
-    if( textureSet ) // atlasing
+    TextureSet textureSet;
+
+    if( mAttemptAtlasing )
     {
-      if( textureSet != currentTextureSet )
+      Vector4 atlasRect;
+      textureSet = mFactoryCache.GetAtlasManager()->Add(atlasRect, rasterizedPixelData );
+      if( textureSet ) // atlasing
       {
-        mImpl->mRenderer.SetTextures( textureSet );
+        if( textureSet != currentTextureSet )
+        {
+          mImpl->mRenderer.SetTextures( textureSet );
+        }
+        mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
+        mAtlasRect = atlasRect;
+        mImpl->mFlags |= Impl::IS_ATLASING_APPLIED;
       }
-      mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
-      mAtlasRect = atlasRect;
-      mImpl->mFlags |= Impl::IS_ATLASING_APPLIED;
     }
-    else // no atlasing
+
+    if( !textureSet ) // no atlasing - mAttemptAtlasing is false or adding to atlas is failed
     {
       Texture texture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888,
                                       rasterizedPixelData.GetWidth(), rasterizedPixelData.GetHeight() );
index 0bce4b0..7852bfc 100644 (file)
@@ -155,6 +155,13 @@ private:
    */
   void AddRasterizationTask( const Vector2& size );
 
+  /**
+   * Helper method to set individual values by index key.
+   * @param[in] index The index key of the value
+   * @param[in] value The value
+   */
+  void DoSetProperty( Property::Index index, const Property::Value& value );
+
 
   // Undefined
   SvgVisual( const SvgVisual& svgRenderer );
@@ -168,6 +175,7 @@ private:
   NSVGimage*           mParsedImage;
   WeakHandle<Actor>    mPlacementActor;
   Vector2              mVisualSize;
+  bool                 mAttemptAtlasing;  ///< If true will attempt atlasing, otherwise create unique texture
 };
 
 } // namespace Internal
index 5fd8933..6d2f7e7 100644 (file)
@@ -146,6 +146,7 @@ public:
        * @brief The outer space around the control.
        * @details Name "margin", type Property::EXTENTS.
        * @SINCE_1_2.62
+       * @note Margin property is to be supported by Layout algorithms and containers in future.
        */
       MARGIN,
 
index 154d93e..f88a9b2 100644 (file)
@@ -111,6 +111,7 @@ public:
        * If false, video-view shows decoded frame images sequentially.
        * If Platform or video plugin doesn't support decoded frame images, this should always be true.
        * @SINCE_1_2.62
+       * @REMARK_RAWVIDEO
        */
       UNDERLAY
     };
index a9f5cdc..43fe66a 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 64;
+const unsigned int TOOLKIT_MICRO_VERSION = 65;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 326f03a..4f57197 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.2.64
+Version:    1.2.65
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT