X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fmanager%2Fupdate-manager.h;h=e90ab9dbacca43df6c6ac25ac631f2ec46d2c231;hb=485765dab55e1b81644d15aa867abf8173c6e0ee;hp=cdec3ec06f2753af57d793d9fc5b8b14607b2c23;hpb=33b53cef3dbb23a5973065b3f0836adfc00a6ba8;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 cdec3ec..e90ab9d 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 { @@ -59,7 +60,8 @@ class TouchResampler; namespace Render { -class Sampler; +struct Sampler; +class FrameBuffer; } // value types used by messages template <> struct ParameterType< PropertyNotification::NotifyMode > @@ -102,7 +104,6 @@ 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] textureCacheDispatcher Used for sending messages to texture cache. - * @param[in] touchResampler Used for re-sampling touch events. */ UpdateManager( NotificationManager& notificationManager, CompleteNotificationInterface& animationFinishedNotifier, @@ -112,8 +113,7 @@ public: Integration::RenderController& controller, RenderManager& renderManager, RenderQueue& renderQueue, - TextureCacheDispatcher& textureCacheDispatcher, - TouchResampler& touchResampler ); + TextureCacheDispatcher& textureCacheDispatcher ); /** * Destructor. @@ -393,10 +393,11 @@ public: /** * 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 + * @param[in] rWrapMode Wrapping mode in z direction + * @param[in] sWrapMode Wrapping mode in x direction + * @param[in] tWrapMode Wrapping mode in y direction */ - void SetWrapMode( Render::Sampler* sampler, unsigned int uWrapMode, unsigned int vWrapMode ); + void SetWrapMode( Render::Sampler* sampler, unsigned int rWrapMode, unsigned int sWrapMode, unsigned int tWrapMode ); /** * Add a new property buffer to RenderManager @@ -473,6 +474,56 @@ public: */ void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer ); + /** + * Adds a texture to the render manager + * @param[in] texture The texture to add + * The texture will be owned by RenderManager + */ + void AddTexture( Render::NewTexture* texture ); + + /** + * Removes a texture from the render manager + * @param[in] texture The texture to remove + * @post The texture will be destroyed in the render thread + */ + void RemoveTexture( Render::NewTexture* texture ); + + /** + * Uploads data to a texture owned by the RenderManager + * @param[in] texture The texture + * @param[in] pixelData The pixel data object + * @param[in] params The parameters for the upload + */ + void UploadTexture( Render::NewTexture* texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params ); + + /** + * Generates mipmaps for a texture owned by the RenderManager + * @param[in] texture The texture + */ + void GenerateMipmaps( Render::NewTexture* texture ); + + /** + * Adds a framebuffer to the render manager + * @param[in] frameBuffer The framebuffer to add + * The framebuffer will be owned by RenderManager + */ + void AddFrameBuffer( Render::FrameBuffer* frameBuffer ); + + /** + * Removes a FrameBuffer from the render manager + * @param[in] frameBuffer The FrameBuffer to remove + * @post The FrameBuffer will be destroyed in the render thread + */ + void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer ); + + /** + * Attach a texture as color output to an existing FrameBuffer + * @param[in] frameBuffer The FrameBuffer + * @param[in] texture The texture that will be used as output when rendering + * @param[in] mipmapLevel The mipmap of the texture to be attached + * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures + */ + void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int face ); public: @@ -988,15 +1039,15 @@ inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampl new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode ); } -inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, unsigned int uWrapMode, unsigned int vWrapMode ) +inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, unsigned int rWrapMode, unsigned int sWrapMode, unsigned int tWrapMode ) { - typedef MessageValue3< UpdateManager, Render::Sampler*, unsigned int, unsigned int > LocalType; + typedef MessageValue4< UpdateManager, Render::Sampler*, unsigned int, 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 ); + new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode ); } inline void AddPropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer ) @@ -1149,6 +1200,84 @@ inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& ge new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType ); } +inline void AddTexture( UpdateManager& manager, Render::NewTexture& texture ) +{ + typedef MessageValue1< UpdateManager, Render::NewTexture* > 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::AddTexture, &texture ); +} + +inline void RemoveTexture( UpdateManager& manager, Render::NewTexture& texture ) +{ + typedef MessageValue1< UpdateManager, Render::NewTexture* > 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::RemoveTexture, &texture ); +} + +inline void UploadTextureMessage( UpdateManager& manager, Render::NewTexture& texture, PixelDataPtr pixelData, const NewTexture::UploadParams& params ) +{ + typedef MessageValue3< UpdateManager, Render::NewTexture*, PixelDataPtr, NewTexture::UploadParams > 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::UploadTexture, &texture, pixelData, params ); +} + +inline void GenerateMipmapsMessage( UpdateManager& manager, Render::NewTexture& texture ) +{ + typedef MessageValue1< UpdateManager, Render::NewTexture* > 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::GenerateMipmaps, &texture ); +} + + +inline void AddFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer ) +{ + typedef MessageValue1< UpdateManager, Render::FrameBuffer* > 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::AddFrameBuffer, &frameBuffer ); +} + +inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer ) +{ + typedef MessageValue1< UpdateManager, Render::FrameBuffer* > 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::RemoveFrameBuffer, &frameBuffer ); +} + +inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::NewTexture* texture, unsigned int mipmapLevel, unsigned int layer ) +{ + typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::NewTexture*, 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::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer ); +} + } // namespace SceneGraph } // namespace Internal