X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Frender-tasks%2Frender-task-list-impl.h;h=55e37e83c955c698db671ea6aaaae890f1bbab33;hb=c114bfe4714e8f02c54b25e381a41d80bdcb2d93;hp=25e5b7904ebb972964b463a61102ad6f126e634c;hpb=a416e02739d885d7469ddba790c15974df6091e1;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 25e5b79..55e37e8 100644 --- a/dali/internal/event/render-tasks/render-task-list-impl.h +++ b/dali/internal/event/render-tasks/render-task-list-impl.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_RENDER_TASK_LIST_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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,9 @@ // INTERNAL INCLUDES #include #include -#include #include #include +#include namespace Dali { @@ -31,8 +31,13 @@ namespace Dali namespace Internal { -class EventToUpdate; +class EventThreadServices; class RenderTaskDefaults; +class Actor; +class CameraActor; + +class RenderTaskList; +using RenderTaskListPtr = IntrusivePtr; namespace SceneGraph { @@ -48,36 +53,50 @@ 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. + }; /** * Create a RenderTaskList. - * @param[in] updateManager 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 LayerList for actors added via the SystemLevel::Add(). * @return A newly allocated RenderTaskList; the caller takes ownership. */ - static RenderTaskList* New( SceneGraph::UpdateManager& updateManager, 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. @@ -89,6 +108,24 @@ public: } /** + * @brief Mark a rendertask as having exclusive access to its source actor. + * + * @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 ); + + /** + * @brief Return the list of rendertasks that exclusively own their source actor. + * + * @return [description] + */ + const Vector< Exclusive >& GetExclusivesList() const + { + return mExclusives; + } + + /** * Provide notification signals for a "Finished" render task. * This method should be called in the event-thread * Queue NotifyFinishedMessage() from update-thread @@ -106,11 +143,8 @@ protected: /** * Construct a new RenderTaskList. - * @param[in] eventToUpdate 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( EventToUpdate& eventToUpdate, RenderTaskDefaults& defaults, bool systemLevel ); + RenderTaskList(); /** * A reference counted object may only be deleted by calling Unreference() @@ -120,7 +154,7 @@ protected: /** * 2nd-phase construction */ - void Initialize( SceneGraph::UpdateManager& updateManager ); + void Initialize(); private: // from CompleteNotificationInterface @@ -131,14 +165,13 @@ private: // from CompleteNotificationInterface private: - EventToUpdate& mEventToUpdate; + 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 + RenderTaskContainer mTasks; ///< Reference counted render-tasks + Vector< Exclusive > mExclusives; ///< List of rendertasks with exclusively owned source actors. }; } // namespace Internal