X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Frender-tasks%2Frender-task-list-impl.h;h=068a42fcc2d5064741c63ddb1a233831cefc44f1;hb=c1df908470fc3dd242fef202248e56009727bca4;hp=321679331c46ebf1bb6143c33b5eb8fd0086e2e6;hpb=7882128f66bc91dbca9573caddd312115be440c4;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 3216793..068a42f 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) 2019 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,9 +21,10 @@ // INTERNAL INCLUDES #include #include -#include #include #include +#include +#include namespace Dali { @@ -34,6 +35,11 @@ namespace Internal class EventThreadServices; class RenderTaskDefaults; class Actor; +class CameraActor; + +using RenderTaskPtr = IntrusivePtr; +class RenderTaskList; +using RenderTaskListPtr = IntrusivePtr; namespace SceneGraph { @@ -49,42 +55,52 @@ class RenderTaskList : public BaseObject, public CompleteNotificationInterface { public: - typedef std::vector< Dali::RenderTask > RenderTaskContainer; + using RenderTaskContainer = std::vector< RenderTaskPtr >; struct Exclusive { RenderTask* renderTaskPtr; ///< Pointer for comparison with current rendertask. - Actor* actorPtr; ///< Pointer for comparison with current actor. + ActorObserver actor; ///< For comparison with current actor. }; + using ExclusivesContainer = std::vector< Exclusive >; + /** * Create a RenderTaskList. - * @param[in] eventServices Used for sending message to the scene graph. - * @param[in] defaults Provides the default source & camera actors. - * @param[in] systemLevel True if this is the LayerList for actors added via the SystemLevel::Add(). * @return A newly allocated RenderTaskList; the caller takes ownership. */ - static RenderTaskList* New( EventThreadServices& eventServices, RenderTaskDefaults& defaults, bool systemLevel ); + static RenderTaskListPtr New(); /** * @copydoc Dali::RenderTaskList::CreateTask() */ - Dali::RenderTask CreateTask(); + RenderTaskPtr CreateTask(); + + /** + * @brief Creates a new RenderTask. + * + * This will be appended to the list of render-tasks. + * + * @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 RenderTask + */ + RenderTaskPtr CreateTask( Actor* sourceActor, CameraActor* cameraActor); /** * @copydoc Dali::RenderTaskList::RemoveTask() */ - void RemoveTask( Dali::RenderTask task ); + void RemoveTask( Internal::RenderTask& task ); /** * @copydoc Dali::RenderTaskList::GetTaskCount() */ - unsigned int GetTaskCount() const; + uint32_t GetTaskCount() const; /** * @copydoc Dali::RenderTaskList::GetTask() */ - Dali::RenderTask GetTask( unsigned int index ) const; + RenderTaskPtr GetTask( uint32_t index ) const; /** * Retrieve the container of render-tasks. @@ -108,7 +124,7 @@ public: * * @return [description] */ - const Vector< Exclusive >& GetExclusivesList() const + const ExclusivesContainer& GetExclusivesList() const { return mExclusives; } @@ -127,15 +143,18 @@ public: */ void RecoverFromContextLoss(); + /** + * Retrieve the SceneGraph::RenderTaskList object. + * @return The RenderTaskList. + */ + const SceneGraph::RenderTaskList& GetSceneObject() const; + protected: /** * Construct a new RenderTaskList. - * @param[in] eventThreadServices Used for creating render-tasks in the scene graph. - * @param[in] defaults Provides the default source & camera actors. - * @param[in] systemLevel True if this is the system-level list. */ - RenderTaskList( EventThreadServices& eventThreadServices, RenderTaskDefaults& defaults, bool systemLevel ); + RenderTaskList(); /** * A reference counted object may only be deleted by calling Unreference() @@ -145,7 +164,7 @@ protected: /** * 2nd-phase construction */ - void Initialize( SceneGraph::UpdateManager& updateManager ); + void Initialize(); private: // from CompleteNotificationInterface @@ -159,12 +178,10 @@ private: EventThreadServices& mEventThreadServices; RenderTaskDefaults& mDefaults; - bool mIsSystemLevel; ///< True if the layers are added via the SystemLevel API - 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. + ExclusivesContainer mExclusives; ///< List of rendertasks with exclusively owned source actors. }; } // namespace Internal @@ -191,4 +208,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