#include <dali/internal/update/rendering/scene-graph-renderer.h>
#include <dali/internal/render/shaders/scene-graph-shader.h>
#include <dali/internal/render/renderers/render-property-buffer.h>
+#include <dali/internal/event/rendering/texture-impl.h>
namespace Dali
{
namespace Render
{
-class Sampler;
+struct Sampler;
+class FrameBuffer;
}
// value types used by messages
template <> struct ParameterType< PropertyNotification::NotifyMode >
* @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,
Integration::RenderController& controller,
RenderManager& renderManager,
RenderQueue& renderQueue,
- TextureCacheDispatcher& textureCacheDispatcher,
- TouchResampler& touchResampler );
+ TextureCacheDispatcher& textureCacheDispatcher );
/**
* Destructor.
/**
* 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
*/
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:
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 )
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