[Tizen] Implement partial update
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / update-manager.h
old mode 100644 (file)
new mode 100755 (executable)
index 38d9704..72df33c
@@ -132,6 +132,7 @@ public:
    * @param[in] renderManager This is responsible for rendering the results of each "update".
    * @param[in] renderQueue Used to queue messages for the next render.
    * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
+   * @param[in] partialUpdateAvailble whether the partial update is available 
    */
   UpdateManager( NotificationManager& notificationManager,
                  CompleteNotificationInterface& animationPlaylist,
@@ -140,7 +141,8 @@ public:
                  Integration::RenderController& controller,
                  RenderManager& renderManager,
                  RenderQueue& renderQueue,
-                 RenderTaskProcessor& renderTaskProcessor );
+                 RenderTaskProcessor& renderTaskProcessor,
+                 bool partialUpdateAvailable );
 
   /**
    * Destructor.
@@ -151,7 +153,6 @@ public:
 
   /**
    * Installs a new layer as the root node.
-   * @pre The UpdateManager does not already have an installed root node.
    * @pre The layer is of derived Node type Layer.
    * @pre The layer does not have a parent.
    * @param[in] layer The new root node.
@@ -160,6 +161,15 @@ public:
   void InstallRoot( OwnerPointer<Layer>& layer );
 
   /**
+   * Uninstalls the root node.
+   * @pre The layer is of derived Node type Layer.
+   * @pre The layer does not have a parent.
+   * @param[in] layer The root node.
+   * @post The node is owned by UpdateManager.
+   */
+  void UninstallRoot( Layer* layer );
+
+  /**
    * Add a Node; UpdateManager takes ownership.
    * @pre The node does not have a parent.
    * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
@@ -550,7 +560,7 @@ public:
    * @param[in] frameBuffer The framebuffer to add
    * The framebuffer will be owned by RenderManager
    */
-  void AddFrameBuffer( Render::FrameBuffer* frameBuffer );
+  void AddFrameBuffer( OwnerPointer< Render::FrameBuffer >& frameBuffer );
 
   /**
    * Removes a FrameBuffer from the render manager
@@ -586,18 +596,18 @@ public:
                    bool isRenderingToFbo );
 
   /**
-   * Set the background color i.e. the glClear color used at the beginning of each frame.
-   * @param[in] color The new background color.
-   */
-  void SetBackgroundColor(const Vector4& color);
-
-  /**
    * Set the default surface rect.
    * @param[in] rect The rect value representing the surface.
    */
   void SetDefaultSurfaceRect( const Rect<int>& rect );
 
   /**
+   * Set the default surface orientation.
+   * @param[in] orientation The orientation value representing the surface.
+   */
+  void SetDefaultSurfaceOrientation( int orientation );
+
+  /**
    * @copydoc Dali::Stage::KeepRendering()
    */
   void KeepRendering( float durationSeconds );
@@ -741,6 +751,20 @@ inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& roo
   new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
 }
 
+inline void UninstallRootMessage( UpdateManager& manager, const Layer* constRoot )
+{
+  // Scene graph thread can destroy this object.
+  Layer* root = const_cast< Layer* >( constRoot );
+
+  typedef MessageValue1< UpdateManager, Layer* > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::UninstallRoot, root );
+}
+
 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
 {
   // Message has ownership of Node while in transit from event -> update
@@ -986,26 +1010,26 @@ inline void SetShaderProgramMessage( UpdateManager& manager,
   new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
 }
 
-inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
+inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect  )
 {
-  typedef MessageValue1< UpdateManager, Vector4 > LocalType;
+  typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
+  new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
 }
 
-inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect  )
+inline void SetDefaultSurfaceOrientationMessage( UpdateManager& manager, int orientation  )
 {
-  typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
+  typedef MessageValue1< UpdateManager, int > LocalType;
 
   // Reserve some memory inside the message queue
-  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
+  new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceOrientation, orientation );
 }
 
 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
@@ -1336,15 +1360,15 @@ inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& tex
 }
 
 
-inline void AddFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
+inline void AddFrameBuffer( UpdateManager& manager, OwnerPointer< Render::FrameBuffer >& frameBuffer )
 {
-  typedef MessageValue1< UpdateManager, Render::FrameBuffer*  > LocalType;
+  typedef MessageValue1< UpdateManager, OwnerPointer< Render::FrameBuffer > > LocalType;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, &frameBuffer );
+  new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, frameBuffer );
 }
 
 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )