Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / scene-holder-impl.cpp
index 081131f..7162a1c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -120,6 +120,7 @@ SceneHolder::SceneHolder()
   mId( mSceneHolderCounter++ ),
   mSurface( nullptr ),
   mAdaptor( nullptr ),
+  mIsBeingDeleted( false ),
   mAdaptorStarted( false ),
   mVisible( true )
 {
@@ -188,7 +189,9 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface)
 {
   mSurface.reset( surface );
 
-  mScene.SetSurface( *mSurface.get() );
+  mScene.SurfaceReplaced();
+
+  SurfaceResized();
 
   unsigned int dpiHorizontal, dpiVertical;
   dpiHorizontal = dpiVertical = 0;
@@ -201,9 +204,10 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface)
   OnSurfaceSet( surface );
 }
 
-void SceneHolder::SurfaceResized( bool forceUpdate )
+void SceneHolder::SurfaceResized()
 {
-  mScene.SurfaceResized( forceUpdate );
+  PositionSize surfacePositionSize = mSurface->GetPositionSize();
+  mScene.SurfaceResized( static_cast<float>( surfacePositionSize.width ), static_cast<float>( surfacePositionSize.height ) );
 }
 
 Dali::RenderSurfaceInterface* SceneHolder::GetSurface() const
@@ -235,7 +239,8 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor)
   mAdaptorStarted = true;
 
   // Create the scene
-  mScene = Dali::Integration::Scene::New( *mSurface );
+  PositionSize surfacePositionSize = mSurface->GetPositionSize();
+  mScene = Dali::Integration::Scene::New( Size(static_cast<float>( surfacePositionSize.width ), static_cast<float>( surfacePositionSize.height )) );
 
   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor );
   mAdaptor = &adaptorImpl;