[4.0] Supports screen rotation.
[platform/core/uifw/dali-core.git] / dali / internal / common / core-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 873dbf5..ae5a35a
@@ -84,7 +84,9 @@ Core::Core( RenderController& renderController,
             GlSyncAbstraction& glSyncAbstraction,
             GestureManager& gestureManager,
             ResourcePolicy::DataRetention dataRetentionPolicy,
-            bool renderToFboEnabled )
+            Integration::RenderToFrameBuffer renderToFboEnabled,
+            Integration::DepthBufferAvailable depthBufferAvailable,
+            Integration::StencilBufferAvailable stencilBufferAvailable )
 : mRenderController( renderController ),
   mPlatform(platform),
   mProcessingEvent(false)
@@ -103,7 +105,7 @@ Core::Core( RenderController& renderController,
 
   mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
 
-  mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction );
+  mRenderManager = RenderManager::New( glAbstraction, glSyncAbstraction, depthBufferAvailable, stencilBufferAvailable );
 
   RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
 
@@ -125,7 +127,7 @@ Core::Core( RenderController& renderController,
   // This must be called after stage is created but before stage initialization
   mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController( mRenderController ) );
 
-  mStage->Initialize( renderToFboEnabled );
+  mStage->Initialize( renderToFboEnabled == Integration::RenderToFrameBuffer::TRUE );
 
   mGestureEventProcessor = new GestureEventProcessor( *mStage, *mUpdateManager, gestureManager, mRenderController );
   mEventProcessor = new EventProcessor( *mStage, *mNotificationManager, *mGestureEventProcessor );
@@ -194,6 +196,15 @@ void Core::SurfaceResized( unsigned int width, unsigned int height )
   mRelayoutController->SetStageSize( size.width, size.height );
 }
 
+void Core::SurfaceResized( unsigned int width, unsigned int height, int orientation )
+{
+  mStage->SurfaceResized( width, height, orientation );
+
+  // The stage-size may be less than surface-size (reduced by top-margin)
+  Vector2 size = mStage->GetSize();
+  mRelayoutController->SetStageSize( size.width, size.height );
+}
+
 void Core::SetTopMargin( unsigned int margin )
 {
   mStage->SetTopMargin( margin );
@@ -225,6 +236,9 @@ void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds,
   // Check the Notification Manager message queue to set needsNotification
   status.needsNotification = mNotificationManager->MessagesToProcess();
 
+  // Check if the default surface is changed
+  status.surfaceRectChanged = mUpdateManager->IsDefaultSurfaceRectChanged();
+
   // No need to keep update running if there are notifications to process.
   // Any message to update will wake it up anyways
 }