Merge "DALi Version 1.3.46" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 18 Oct 2018 13:28:32 +0000 (13:28 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 18 Oct 2018 13:28:32 +0000 (13:28 +0000)
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h
automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp
dali-toolkit/internal/builder/builder-filesystem.h [changed mode: 0644->0755]
dali-toolkit/public-api/controls/control-impl.cpp

index e5d4a70..ee60af1 100644 (file)
@@ -26,6 +26,18 @@ class EglInterface;
 class DisplayConnection;
 class ThreadSynchronizationInterface;
 
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class GraphicsInterface;
+
+} // namespace Adaptor
+
+} // namespace Internal
+
 namespace Integration
 {
 
@@ -40,13 +52,13 @@ public:
 
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; }
 
-  virtual void InitializeEgl( EglInterface& egl ) {}
+  virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) {};
 
-  virtual void CreateEglSurface( EglInterface& egl ) {}
+  virtual void CreateSurface() {}
 
-  virtual void DestroyEglSurface( EglInterface& egl ) {}
+  virtual void DestroySurface() {}
 
-  virtual bool ReplaceEGLSurface( EglInterface& egl ) { return false; }
+  virtual bool ReplaceGraphicsSurface() { return false; }
 
   virtual void MoveResize( Dali::PositionSize positionSize ) {}
 
@@ -54,9 +66,9 @@ public:
 
   virtual void StartRender() {}
 
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) { return false; }
+  virtual bool PreRender( bool resizingSurface ) { return false; }
 
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) {}
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {}
 
   virtual void StopRender() {}
 
index 49da596..46ba80b 100644 (file)
@@ -3412,3 +3412,53 @@ int UtcDaliLayouting_SetLayout(void)
 
   END_TEST;
 }
+
+int UtcDaliLayouting_StageAdd(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliLayouting_StageAdd");
+
+  Stage stage = Stage::GetCurrent();
+
+  AbsoluteLayout absoluteLayout = AbsoluteLayout::New();
+  Control container = Control::New();
+  container.SetName( "Container" );
+  DevelControl::SetLayout( container, absoluteLayout );
+  container.SetAnchorPoint( Dali::AnchorPoint::CENTER );
+  container.SetParentOrigin( Dali::ParentOrigin::CENTER );
+
+  Control child = Control::New();
+  child.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
+  child.SetPosition( 0.0f, 0.0f );
+  child.SetSize( 480.0f, 180.0f );
+  child.SetName( "Child Control" );
+  container.Add( child );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION ); // Not re-laid out
+  DALI_TEST_EQUALS( child.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 180.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  // Add container to stage here
+  // Should call RequestLayout() to measure and layout
+  stage.Add( container );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION ); // Stage Size
+  DALI_TEST_EQUALS( child.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 180.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  END_TEST;
+}
old mode 100644 (file)
new mode 100755 (executable)
index bbb77d7..d7118dd
@@ -46,7 +46,9 @@ inline std::string ExpandPath(const std::string &name)
 inline std::string ExePath(void)
 {
   char buf[256];
-  readlink("/proc/self/exe", buf, sizeof(buf));
+  ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
+  len = len > 0 ? len : 0;
+  buf[len] = '\0';
   return std::string(buf);
 }
 
index 8f862f5..1804809 100755 (executable)
@@ -573,6 +573,9 @@ void Control::OnStageConnection( int depth )
 
   // The clipping renderer is only created if required.
   CreateClippingRenderer( *this );
+
+  // Request to be laid out when the control is connected to the Stage.
+  Toolkit::DevelControl::RequestLayout( *this );
 }
 
 void Control::OnStageDisconnection()