-#ifndef __DALI_INTERNAL_RENDER_TASK_LIST_H__
-#define __DALI_INTERNAL_RENDER_TASK_LIST_H__
+#ifndef DALI_INTERNAL_RENDER_TASK_LIST_H
+#define DALI_INTERNAL_RENDER_TASK_LIST_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/render-tasks/render-task-list.h>
+
#include <dali/internal/event/common/complete-notification-interface.h>
+#include <dali/internal/event/events/actor-observer.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
namespace Dali
{
-
namespace Internal
{
-
class EventThreadServices;
class RenderTaskDefaults;
class Actor;
{
class RenderTaskList;
class UpdateManager;
-}
+} // namespace SceneGraph
/**
* A proxy for the scene-graph RenderTaskList.
class RenderTaskList : public BaseObject, public CompleteNotificationInterface
{
public:
-
- using RenderTaskContainer = std::vector< RenderTaskPtr >;
+ using RenderTaskContainer = std::vector<RenderTaskPtr>;
struct Exclusive
{
- RenderTask* renderTaskPtr; ///< Pointer for comparison with current rendertask.
- Actor* actorPtr; ///< Pointer for comparison with current actor.
+ RenderTask* renderTaskPtr; ///< Pointer for comparison with current rendertask.
+ ActorObserver actor; ///< For comparison with current actor.
+
+ bool operator==(const Exclusive& other) const
+ {
+ return renderTaskPtr == other.renderTaskPtr;
+ }
};
+ using ExclusivesContainer = std::vector<Exclusive>;
+ using ExclusiveIter = ExclusivesContainer::iterator;
+
/**
* Create a RenderTaskList.
* @return A newly allocated RenderTaskList; the caller takes ownership.
* @param[in] cameraActor The actor from which the scene is viewed for this render task.
* @return A valid handle to a new RenderTask
*/
- RenderTaskPtr CreateTask( Actor* sourceActor, CameraActor* cameraActor);
+ RenderTaskPtr CreateTask(Actor* sourceActor, CameraActor* cameraActor);
+
+ /**
+ * @brief Creates a new RenderTask for overlay.
+ * This will be appended to the end of render-task list.
+ * @param[in] sourceActor The actor and its children to be rendered for this render task.
+ * @param[in] cameraActor The actor from which the scene is viewed for this render task.
+ * @return A valid handle to a new overlay RenderTask
+ * @note The Overlay RenderTask will be rendered after all the other render tasks are rendered.
+ */
+ RenderTaskPtr CreateOverlayTask(Actor* sourceActor, CameraActor* cameraActor);
/**
* @copydoc Dali::RenderTaskList::RemoveTask()
*/
- void RemoveTask( Internal::RenderTask& task );
+ void RemoveTask(Internal::RenderTask& task);
/**
* @copydoc Dali::RenderTaskList::GetTaskCount()
/**
* @copydoc Dali::RenderTaskList::GetTask()
*/
- RenderTaskPtr GetTask( uint32_t index ) const;
+ RenderTaskPtr GetTask(uint32_t index) const;
+
+ /**
+ * @copydoc Dali::RenderTaskList::GetOverlayTask()
+ */
+ RenderTaskPtr GetOverlayTask() const;
/**
* Retrieve the container of render-tasks.
* @param[in] task Pointer to the rendertask.
* @param[in] exclusive If a rendertask is to have exclusive acesss to its source actor.
*/
- void SetExclusive( RenderTask* task, bool exclusive );
+ void SetExclusive(RenderTask* task, bool exclusive);
/**
* @brief Return the list of rendertasks that exclusively own their source actor.
*
* @return [description]
*/
- const Vector< Exclusive >& GetExclusivesList() const
+ const ExclusivesContainer& GetExclusivesList() const
{
return mExclusives;
}
* Queue NotifyFinishedMessage() from update-thread
* @param object pointer to this class instance
*/
- static void NotifyFinished( void* object );
+ static void NotifyFinished(void* object);
/**
* This method refreshes all render tasks that have a frame buffer
const SceneGraph::RenderTaskList& GetSceneObject() const;
protected:
-
/**
* Construct a new RenderTaskList.
*/
/**
* A reference counted object may only be deleted by calling Unreference()
*/
- virtual ~RenderTaskList();
+ ~RenderTaskList() override;
/**
* 2nd-phase construction
void Initialize();
private: // from CompleteNotificationInterface
-
/**
* @copydoc CompleteNotificationInterface::NotifyCompleted()
*/
- virtual void NotifyCompleted();
+ void NotifyCompleted() override;
private:
-
EventThreadServices& mEventThreadServices;
- RenderTaskDefaults& mDefaults;
+ RenderTaskDefaults& mDefaults;
SceneGraph::RenderTaskList* mSceneObject; ///< Raw-pointer to the scene-graph object; not owned.
- RenderTaskContainer mTasks; ///< Reference counted render-tasks
- Vector< Exclusive > mExclusives; ///< List of rendertasks with exclusively owned source actors.
+ RenderTaskContainer mTasks; ///< Reference counted render-tasks
+ ExclusivesContainer mExclusives; ///< List of rendertasks with exclusively owned source actors.
+ RenderTaskPtr mOverlayRenderTask{nullptr};
};
} // namespace Internal
} // namespace Dali
-#endif //__DALI_INTERNAL_RENDER_TASK_LIST_H__
+#endif // DALI_INTERNAL_RENDER_TASK_LIST_H