Check if the surfarce rect is changed 17/185617/1
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 29 Jun 2018 07:55:00 +0000 (16:55 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Wed, 1 Aug 2018 06:53:01 +0000 (15:53 +0900)
Change-Id: Id2c20944ca990848a3ff841298466e678fa2e74d

dali/integration-api/core.h
dali/internal/common/core-impl.cpp
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h

index 7db841a..39f3416 100644 (file)
@@ -95,6 +95,12 @@ public:
   bool NeedsNotification() { return needsNotification; }
 
   /**
+   * Query wheter the default surface rect is changed or not.
+   * @return true if the default surface rect is changed.
+   */
+  bool SurfaceRectChanged() { return surfaceRectChanged; }
+
+  /**
    * This method is provided so that FPS can be easily calculated with a release version
    * of Core.
    * @return the seconds from last frame as float
@@ -105,6 +111,7 @@ public:
 
   unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
   bool needsNotification;
+  bool surfaceRectChanged;
   float secondsFromLastFrame;
 };
 
index 7637a27..53378e0 100644 (file)
@@ -227,6 +227,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
 }
index 6ef46be..1722334 100644 (file)
@@ -201,7 +201,8 @@ struct UpdateManager::Impl
     animationFinishedDuringUpdate( false ),
     previousUpdateScene( false ),
     renderTaskWaiting( false ),
-    renderersAdded( false )
+    renderersAdded( false ),
+    surfaceRectChanged( false )
   {
     sceneController = new SceneControllerImpl( renderMessageDispatcher, renderQueue, discardQueue );
 
@@ -306,6 +307,7 @@ struct UpdateManager::Impl
   bool                                 previousUpdateScene;           ///< True if the scene was updated in the previous frame (otherwise it was optimized out)
   bool                                 renderTaskWaiting;             ///< A REFRESH_ONCE render task is waiting to be rendered
   bool                                 renderersAdded;                ///< Flag to keep track when renderers have been added to avoid unnecessary processing
+  bool                                 surfaceRectChanged;            ///< True if the default surface rect is changed
 
 private:
 
@@ -1006,6 +1008,8 @@ void UpdateManager::SetBackgroundColor( const Vector4& color )
 
 void UpdateManager::SetDefaultSurfaceRect( const Rect<int>& rect )
 {
+  mImpl->surfaceRectChanged = true;
+
   typedef MessageValue1< RenderManager, Rect<int> > DerivedType;
 
   // Reserve some memory inside the render queue
@@ -1046,6 +1050,16 @@ void UpdateManager::SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths )
   SortSiblingNodesRecursively( *( mImpl->root ) );
 }
 
+bool UpdateManager::IsDefaultSurfaceRectChanged()
+{
+  bool surfaceRectChanged = mImpl->surfaceRectChanged;
+
+  // Reset the flag
+  mImpl->surfaceRectChanged = false;
+
+  return surfaceRectChanged;
+}
+
 void UpdateManager::AddSampler( OwnerPointer< Render::Sampler >& sampler )
 {
   // Message has ownership of Sampler while in transit from update to render
index ccecef8..8e381fc 100644 (file)
@@ -597,6 +597,12 @@ public:
    */
   void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
 
+  /**
+   * Query wheter the default surface rect is changed or not.
+   * @return true if the default surface rect is changed.
+   */
+  bool IsDefaultSurfaceRectChanged();
+
 private:
 
   // Undefined