Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / update-manager.h
index 7e89944..039e054 100644 (file)
@@ -151,7 +151,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 +159,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 +558,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
@@ -741,6 +749,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
@@ -1034,7 +1056,7 @@ inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Ren
  * Create a message for setting the depth of a layer
  * @param[in] manager The update manager
  * @param[in] layers list of layers
- * @param[in] rootLayer True if the layers are added via the SystemOverlay API
+ * @param[in] rootLayer The rool layer
  */
 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
 {
@@ -1336,15 +1358,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 )