X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fmanager%2Fupdate-manager.h;h=a11fc40d28496ad794cf0dffdde88d488b76d14f;hb=2fc7116e4a394fb0997a4c7298a77305d9a09e67;hp=38d970408d9d7df7bba1906c687dce9adf33498f;hpb=15bd1b3858f6ba396685bc68eb9b196fc388d777;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/manager/update-manager.h b/dali/internal/update/manager/update-manager.h index 38d9704..a11fc40 100644 --- a/dali/internal/update/manager/update-manager.h +++ b/dali/internal/update/manager/update-manager.h @@ -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 ); /** + * 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 @@ -586,12 +594,6 @@ 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. */ @@ -741,6 +743,20 @@ inline void InstallRootMessage( UpdateManager& manager, OwnerPointer& 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 ) { // Message has ownership of Node while in transit from event -> update @@ -986,17 +1002,6 @@ inline void SetShaderProgramMessage( UpdateManager& manager, new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast( &shader ), shaderData, modifiesGeometry ); } -inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color ) -{ - typedef MessageValue1< UpdateManager, Vector4 > 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 ); -} - inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect& rect ) { typedef MessageValue1< UpdateManager, Rect > LocalType; @@ -1336,15 +1341,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 )