Applying changes to Scene::New() 82/210682/4
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 23 Jul 2019 16:14:09 +0000 (17:14 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 24 Jul 2019 14:48:31 +0000 (15:48 +0100)
Change-Id: Ifb45d1e05d161387dba09574e63cb832e8c21d28

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp

index 7ffb5e5..f3029fa 100644 (file)
@@ -78,8 +78,7 @@ void TestApplication::CreateCore()
 void TestApplication::CreateScene()
 {
   mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) );
-  mScene = Dali::Integration::Scene::New( Vector2( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
-  mScene.SetSurface( *mRenderSurface );
+  mScene = Dali::Integration::Scene::New( *mRenderSurface );
   mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
 }
 
index 1b8cdbd..2726434 100644 (file)
@@ -45,25 +45,20 @@ class Window : public Dali::BaseObject
 public:
 
   Window( const PositionSize& positionSize )
-  : mScene( Dali::Integration::Scene::New( Size( positionSize.width, positionSize.height ) ) ),
-    mRenderSurface( new TestRenderSurface( positionSize ) )
+  : mRenderSurface( positionSize ),
+    mScene( Dali::Integration::Scene::New( mRenderSurface ) )
   {
-    mScene.SetSurface( *mRenderSurface );
   }
 
-  virtual ~Window()
-  {
-    delete mRenderSurface;
-    mRenderSurface = nullptr;
-  }
+  virtual ~Window() = default;
 
   static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
   {
     return new Window( positionSize );
   }
 
+  TestRenderSurface mRenderSurface;
   Integration::Scene mScene;
-  TestRenderSurface* mRenderSurface;
 };
 
 } // Adaptor
@@ -124,7 +119,7 @@ Integration::Scene Window::GetScene()
 
 Integration::RenderSurface& Window::GetRenderSurface()
 {
-  return *GetImplementation( *this ).mRenderSurface;
+  return GetImplementation( *this ).mRenderSurface;
 }
 
 namespace DevelWindow