namespace Internal
{
class FrameBufferTexture;
-class CompleteStatusManager;
+class ResourceManager;
+
+namespace Render
+{
+class RenderTracker;
+}
namespace SceneGraph
{
class Node;
class CameraAttachment;
class RenderInstruction;
+class RenderMessageDispatcher;
/**
* RenderTasks describe how the Dali scene should be rendered.
class RenderTask : public PropertyOwner
{
public:
+
enum State
{
RENDER_CONTINUOUSLY, ///< mRefreshRate > 0
virtual ~RenderTask();
/**
+ * Initialize the render task. Called in update thread
+ * @param[in] renderMessageDispatcher to send messages to render thread
+ * @param[in] resourceManager to check and update status of FBOs
+ */
+ void Initialize( RenderMessageDispatcher& renderMessageDispatcher, ResourceManager& resourceManager );
+
+ /**
* Set the nodes to be rendered.
* @param[in] node This node and its children will be rendered.
*/
/**
* Set the frame-buffer used as a render target.
* @param[in] resourceId The resource ID of the frame-buffer, or zero if not rendering off-screen.
+ * @param[in] isNativeFBO if this render task is targeting a native FBO
*/
- void SetFrameBufferId( unsigned int resourceId );
+ void SetFrameBufferId( unsigned int resourceId, bool isNativeFBO );
/**
* Retrieve the resource ID of the frame-buffer.
/**
* Prepares the render-instruction buffer to be populated with instructions.
+ *
+ * If the render task is a render-once framebuffer backed by a native image,
+ * then this method will ensure that a GL sync object is created to track
+ * when the rendering has finished.
+ *
* @param[out] instruction to prepare
* @param[in] updateBufferIndex The current update buffer index.
*/
bool ViewMatrixUpdated();
/**
- * Set the complete status tracker.
- * @param[in] completeStatusManager The complete status Tracker (not owned)
- */
- void SetCompleteStatusManager( CompleteStatusManager* completeStatusManager );
-
- /**
* @return A pointer to the camera used by the RenderTask
*/
Node* GetCamera() const;
AnimatableProperty< Vector4 > mClearColor; ///< clearColor
private:
- CompleteStatusManager* mCompleteStatusManager;
+ RenderMessageDispatcher* mRenderMessageDispatcher;
+ ResourceManager* mResourceManager;
+ Render::RenderTracker* mRenderSyncTracker;
Node* mSourceNode;
Node* mCameraNode;
CameraAttachment* mCameraAttachment;
unsigned int mFrameCounter; ///< counter for rendering every N frames
unsigned int mRenderedOnceCounter; ///< Incremented whenever state changes to RENDERED_ONCE_AND_NOTIFIED
+ bool mTargetIsNativeFramebuffer; ///< Tells if our target is a native framebuffer
};
// Messages for RenderTask
-inline void SetFrameBufferIdMessage( EventThreadServices& eventThreadServices, RenderTask& task, unsigned int resourceId )
+inline void SetFrameBufferIdMessage( EventThreadServices& eventThreadServices, RenderTask& task, unsigned int resourceId, bool isNativeFBO )
{
- typedef MessageValue1< RenderTask, unsigned int > LocalType;
+ typedef MessageValue2< RenderTask, unsigned int, bool > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &task, &RenderTask::SetFrameBufferId, resourceId );
+ new (slot) LocalType( &task, &RenderTask::SetFrameBufferId, resourceId, isNativeFBO );
}
inline void SetClearColorMessage( EventThreadServices& eventThreadServices, RenderTask& task, const Vector4& value )