Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / scene-holder-impl.cpp
index efbbd60..d8d456f 100644 (file)
@@ -131,8 +131,16 @@ SceneHolder::~SceneHolder()
   {
     mAdaptor->RemoveObserver( *mLifeCycleObserver.get() );
     mAdaptor->RemoveWindow( this );
+
+    mAdaptor->DeleteSurface( *mSurface.get() );
+
     mAdaptor = nullptr;
   }
+
+  if ( mScene )
+  {
+    mScene.Discard();
+  }
 }
 
 void SceneHolder::Add( Dali::Actor actor )
@@ -193,6 +201,11 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface)
   OnSurfaceSet( surface );
 }
 
+void SceneHolder::SurfaceResized()
+{
+  mScene.SurfaceResized();
+}
+
 Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const
 {
   return mSurface.get();
@@ -200,15 +213,15 @@ Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const
 
 void SceneHolder::SetBackgroundColor( const Vector4& color )
 {
-  if ( mSurface )
+  if( mScene )
   {
-    mSurface->SetBackgroundColor( color );
+    mScene.SetBackgroundColor( color );
   }
 }
 
 Vector4 SceneHolder::GetBackgroundColor() const
 {
-  return mSurface ? mSurface->GetBackgroundColor() : Vector4();
+  return mScene ? mScene.GetBackgroundColor() : Color::BLACK;
 }
 
 void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor)
@@ -222,9 +235,7 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor)
   mAdaptorStarted = true;
 
   // Create the scene
-  PositionSize positionSize = mSurface->GetPositionSize();
-  mScene = Dali::Integration::Scene::New( Vector2( positionSize.width, positionSize.height ) );
-  mScene.SetSurface( *mSurface.get() );
+  mScene = Dali::Integration::Scene::New( *mSurface );
 
   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor );
   mAdaptor = &adaptorImpl;