X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fmanager%2Fupdate-manager.h;h=a2bed89253967d2a47846c40b42690c755b80157;hb=86d50396aaa49828f4f0e3b333f0211e8765cb4f;hp=74719806b5db032523d963d74e3099406f4afe1f;hpb=4bd2fbea750e7dc85627868d8d276cc416b01b5a;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 7471980..a2bed89 100644 --- a/dali/internal/update/manager/update-manager.h +++ b/dali/internal/update/manager/update-manager.h @@ -37,6 +37,7 @@ #include #include #include +#include namespace Dali { @@ -57,6 +58,10 @@ class CompleteNotificationInterface; class ResourceManager; class TouchResampler; +namespace Render +{ +class Sampler; +} // value types used by messages template <> struct ParameterType< PropertyNotification::NotifyMode > : public BasicType< PropertyNotification::NotifyMode > {}; @@ -74,7 +79,6 @@ class TextureCache; class Geometry; class PropertyBuffer; class Material; -class Sampler; /** * UpdateManager maintains a scene graph i.e. a tree of nodes and attachments and @@ -265,13 +269,6 @@ public: ObjectOwnerContainer< Material >& GetMaterialOwner(); /** - * @brief Get the sampler owner - * - * @return The sampler owner - */ - ObjectOwnerContainer< Sampler >& GetSamplerOwner(); - - /** * @brief Get the property buffer owner * * @return The property buffer owner @@ -370,6 +367,76 @@ public: */ bool FlushQueue(); + /** + * Add a new sampler to RenderManager + * @param[in] sampler The sampler to add + * @post Sends a message to RenderManager to add the sampler. + * The sampler will be owned by RenderManager + */ + void AddSampler( Render::Sampler* sampler ); + + /** + * Removes an existing sampler from RenderManager + * @param[in] sampler The sampler to remove + * @post The sampler will be destroyed in the render thread + */ + void RemoveSampler( Render::Sampler* sampler ); + + /** + * Sets the filter modes for an existing sampler + * @param[in] sampler The sampler + * @param[in] minFilterMode The filter to use under minification + * @param[in] magFilterMode The filter to use under magnification + */ + void SetFilterMode( Render::Sampler* sampler, unsigned int minFilterMode, unsigned int magFilterMode ); + + /** + * Sets the wrap mode for an existing sampler + * @param[in] sampler The sampler + * @param[in] uWrapMode Wrapping mode in x direction + * @param[in] vWrapMode Wrapping mode in y direction + */ + void SetWrapMode( Render::Sampler* sampler, unsigned int uWrapMode, unsigned int vWrapMode ); + + /** + * Add a new sampler to RenderManager + * @param[in] propertryBuffer The property buffer to add + * @post Sends a message to RenderManager to add the property buffer. + * The property buffer will be owned by RenderManager + */ + void AddPropertyBuffer( Render::PropertyBuffer* propertryBuffer ); + + /** + * Removes an existing PropertyBuffer from RenderManager + * @param[in] propertryBuffer The property buffer to remove + * @post The property buffer will be destroyed in the render thread + */ + void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer ); + + /** + * Sets the format of an existing property buffer + * @param[in] propertyBuffer The property buffer. + * @param[in] format The new format of the buffer + * @post Sends a message to RenderManager to set the new format to the property buffer. + */ + void SetPropertyBufferFormat(Render::PropertyBuffer* propertyBuffer, Render::PropertyBuffer::Format* format ); + + /** + * Sets the data of an existing property buffer + * @param[in] propertyBuffer The property buffer. + * @param[in] data The new data of the buffer + * @post Sends a message to RenderManager to set the new data to the property buffer. + */ + void SetPropertyBufferData(Render::PropertyBuffer* propertyBuffer, Dali::Vector* data); + + /** + * Sets the size of an existing property buffer + * @param[in] propertyBuffer The property buffer. + * @param[in] size The new size of the buffer + * @post Sends a message to RenderManager to set the new size to the property buffer. + */ + void SetPropertyBufferSize(Render::PropertyBuffer* propertyBuffer, size_t size ); + public: /** @@ -573,7 +640,6 @@ inline void AttachToNodeMessage( UpdateManager& manager, const Node& constParent // Scene graph thread can modify this object. Node& parent = const_cast< Node& >( constParent ); - // @todo MESH_REWORK Don't pass by owner pointer after merge with SceneGraph::RenderableAttachment ? (not needed if we split RendererAttachment to 2 objects) typedef MessageValue2< UpdateManager, Node*, NodeAttachmentOwner > LocalType; // Reserve some memory inside the message queue @@ -817,6 +883,106 @@ inline void RemoveMessage( UpdateManager& manager, ObjectOwnerContainer& owne new (slot) LocalType( &owner, &ObjectOwnerContainer::Remove, &object ); } +inline void AddSamplerMessage( UpdateManager& manager, Render::Sampler& sampler ) +{ + typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType; + + // Reserve some memory inside the message queue + 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::AddSampler, &sampler ); +} + +inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler ) +{ + typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType; + + // Reserve some memory inside the message queue + 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::RemoveSampler, &sampler ); +} + +inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, unsigned int minFilterMode, unsigned int magFilterMode ) +{ + typedef MessageValue3< UpdateManager, Render::Sampler*, unsigned int, unsigned int > LocalType; + + // Reserve some memory inside the message queue + 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::SetFilterMode, &sampler, minFilterMode, magFilterMode ); +} + +inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, unsigned int uWrapMode, unsigned int vWrapMode ) +{ + typedef MessageValue3< UpdateManager, Render::Sampler*, unsigned int, unsigned int > LocalType; + + // Reserve some memory inside the message queue + 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::SetWrapMode, &sampler, uWrapMode, vWrapMode ); +} + +inline void AddPropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer ) +{ + typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType; + + // Reserve some memory inside the message queue + 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::AddPropertyBuffer, &propertyBuffer ); +} + +inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer ) +{ + typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType; + + // Reserve some memory inside the message queue + 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::RemovePropertyBuffer, &propertyBuffer ); +} + +inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, Render::PropertyBuffer::Format* format ) +{ + typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, Render::PropertyBuffer::Format* > LocalType; + + // Reserve some memory inside the message queue + 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::SetPropertyBufferFormat, &propertyBuffer, format ); +} + +inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, Vector* data ) +{ + typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, Vector* > LocalType; + + // Reserve some memory inside the message queue + 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::SetPropertyBufferData, &propertyBuffer, data ); +} + +inline void SetPropertyBufferSize( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, size_t size ) +{ + typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, size_t > LocalType; + + // Reserve some memory inside the message queue + 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::SetPropertyBufferSize, &propertyBuffer, size ); +} + + } // namespace SceneGraph } // namespace Internal