X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fmanager%2Fupdate-manager.h;h=899db924d02ac425417fc2ea8c0354749d9170e9;hb=ff234de0568247f0260a6d5402d18b2cc75e3d8f;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..899db92 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,18 +594,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& 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 +749,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,26 +1008,26 @@ inline void SetShaderProgramMessage( UpdateManager& manager, new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast( &shader ), shaderData, modifiesGeometry ); } -inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color ) +inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect& rect ) { - typedef MessageValue1< UpdateManager, Vector4 > LocalType; + typedef MessageValue1< UpdateManager, Rect > 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& rect ) +inline void SetDefaultSurfaceOrientationMessage( UpdateManager& manager, int orientation ) { - typedef MessageValue1< UpdateManager, Rect > 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 +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 )