X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Frender-tasks%2Frender-task-list-impl.h;h=c01b9816373be86dbf832f870bc719057727c0c4;hb=d67b366a74050ddec47340ff10a0188c0d381561;hp=6d351c2073379c76622d76789376d68df724eb05;hpb=70ac0bad6473d7a21dfcb5eae3506dc9400e7824;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/render-tasks/render-task-list-impl.h b/dali/internal/event/render-tasks/render-task-list-impl.h index 6d351c2..c01b981 100644 --- a/dali/internal/event/render-tasks/render-task-list-impl.h +++ b/dali/internal/event/render-tasks/render-task-list-impl.h @@ -1,8 +1,8 @@ -#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) 2014 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. @@ -21,29 +21,30 @@ // INTERNAL INCLUDES #include #include -#include #include + #include +#include +#include namespace Dali { - namespace Internal { - class EventThreadServices; class RenderTaskDefaults; class Actor; class CameraActor; +using RenderTaskPtr = IntrusivePtr; class RenderTaskList; -typedef IntrusivePtr RenderTaskListPtr; +using RenderTaskListPtr = IntrusivePtr; namespace SceneGraph { class RenderTaskList; class UpdateManager; -} +} // namespace SceneGraph /** * A proxy for the scene-graph RenderTaskList. @@ -52,15 +53,22 @@ class UpdateManager; class RenderTaskList : public BaseObject, public CompleteNotificationInterface { public: - - typedef std::vector< Dali::RenderTask > RenderTaskContainer; + using RenderTaskContainer = std::vector; 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; + using ExclusiveIter = ExclusivesContainer::iterator; + /** * Create a RenderTaskList. * @return A newly allocated RenderTaskList; the caller takes ownership. @@ -70,7 +78,7 @@ public: /** * @copydoc Dali::RenderTaskList::CreateTask() */ - Dali::RenderTask CreateTask(); + RenderTaskPtr CreateTask(); /** * @brief Creates a new RenderTask. @@ -81,12 +89,22 @@ public: * @param[in] cameraActor The actor from which the scene is viewed for this render task. * @return A valid handle to a new RenderTask */ - Dali::RenderTask 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( Dali::RenderTask task ); + void RemoveTask(Internal::RenderTask& task); /** * @copydoc Dali::RenderTaskList::GetTaskCount() @@ -96,7 +114,12 @@ public: /** * @copydoc Dali::RenderTaskList::GetTask() */ - Dali::RenderTask GetTask( uint32_t index ) const; + RenderTaskPtr GetTask(uint32_t index) const; + + /** + * @copydoc Dali::RenderTaskList::GetOverlayTask() + */ + RenderTaskPtr GetOverlayTask() const; /** * Retrieve the container of render-tasks. @@ -113,14 +136,14 @@ public: * @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; } @@ -131,7 +154,7 @@ public: * 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 @@ -139,8 +162,13 @@ public: */ void RecoverFromContextLoss(); -protected: + /** + * Retrieve the SceneGraph::RenderTaskList object. + * @return The RenderTaskList. + */ + const SceneGraph::RenderTaskList& GetSceneObject() const; +protected: /** * Construct a new RenderTaskList. */ @@ -149,39 +177,28 @@ protected: /** * A reference counted object may only be deleted by calling Unreference() */ - virtual ~RenderTaskList(); + ~RenderTaskList() override; /** * 2nd-phase construction */ void Initialize(); - /** - * Helper to create a scene-graph render task list - */ - void CreateSceneObject(); - - /** - * Helper to destroy a scene-graph render task list - */ - void DestroySceneObject(); - 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 @@ -208,4 +225,4 @@ inline const Internal::RenderTaskList& GetImplementation(const Dali::RenderTaskL } // namespace Dali -#endif //__DALI_INTERNAL_RENDER_TASK_LIST_H__ +#endif // DALI_INTERNAL_RENDER_TASK_LIST_H