X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Frender-tasks%2Fscene-graph-render-task-list.h;h=84058fcc730b60fb588aedf70694f8f0b0393e4e;hb=5de727a5d6b9ef995c93eff4d4e47a086784a332;hp=bf96442c33a558166b1ae41580dae9ae0d97219d;hpb=d8944bba8449a3c5bce03041eccccf2eba4a7ae3;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/render-tasks/scene-graph-render-task-list.h b/dali/internal/update/render-tasks/scene-graph-render-task-list.h index bf96442..84058fc 100644 --- a/dali/internal/update/render-tasks/scene-graph-render-task-list.h +++ b/dali/internal/update/render-tasks/scene-graph-render-task-list.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H__ -#define __DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H__ +#ifndef DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H +#define DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -26,10 +26,8 @@ namespace Dali { - namespace Internal { - class CompleteNotificationInterface; namespace SceneGraph @@ -43,8 +41,7 @@ class RenderTask; class RenderTaskList { public: - - typedef OwnerContainer< RenderTask* > RenderTaskContainer; + using RenderTaskContainer = OwnerContainer; /** * Construct a new RenderTaskList. @@ -61,25 +58,25 @@ public: * Overriden delete operator * Deletes the RenderTaskList from its global memory pool */ - void operator delete( void* ptr ); + void operator delete(void* ptr); /** * Set the renderMessageDispatcher to send message. * @param[in] renderMessageDispatcher The renderMessageDispatcher to send messages. */ - void SetRenderMessageDispatcher( RenderMessageDispatcher* renderMessageDispatcher ); + void SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher); /** * Add a new RenderTask to the list. * @param[in] newTask The RenderTaskList takes ownership of this task. */ - void AddTask( OwnerPointer< RenderTask >& newTask ); + void AddTask(OwnerPointer& newTask); /** * Remove a RenderTask from the list. * @param[in] task The RenderTaskList will destroy this task. */ - void RemoveTask( RenderTask* task ); + void RemoveTask(RenderTask* task); /** * Retrieve the count of RenderTasks. @@ -103,22 +100,25 @@ public: * Set the notification method to package in the NotifyFinishedMessage * @param object to store in notification managers queue */ - void SetCompleteNotificationInterface( CompleteNotificationInterface* object ); + void SetCompleteNotificationInterface(CompleteNotificationInterface* object); /** * Get the Notification interface for when 1+ render tasks have finished */ CompleteNotificationInterface* GetCompleteNotificationInterface(); -protected: + /** + * Get the capacity of the memory pools + */ + static uint32_t GetMemoryPoolCapacity(); +protected: /** * Protected constructor. See New() */ RenderTaskList(); private: - // Undefined RenderTaskList(const RenderTaskList&); @@ -126,39 +126,37 @@ private: RenderTaskList& operator=(const RenderTaskList&); private: - - CompleteNotificationInterface* mNotificationObject; ///< object to pass in to the complete notification - RenderMessageDispatcher* mRenderMessageDispatcher; ///< for sending messages to render thread - RenderTaskContainer mRenderTasks; ///< A container of owned RenderTasks - + CompleteNotificationInterface* mNotificationObject; ///< object to pass in to the complete notification + RenderMessageDispatcher* mRenderMessageDispatcher; ///< for sending messages to render thread + RenderTaskContainer mRenderTasks; ///< A container of owned RenderTasks }; // Messages for RenderTaskList -inline void AddTaskMessage( EventThreadServices& eventThreadServices, const RenderTaskList& list, OwnerPointer< RenderTask >& task ) +inline void AddTaskMessage(EventThreadServices& eventThreadServices, const RenderTaskList& list, OwnerPointer& task) { // Message has ownership of the RenderTask while in transit from event -> update - typedef MessageValue1< RenderTaskList, OwnerPointer< RenderTask > > LocalType; + using LocalType = MessageValue1 >; // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* 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( &list, &RenderTaskList::AddTask, task ); + new(slot) LocalType(&list, &RenderTaskList::AddTask, task); } -inline void RemoveTaskMessage( EventThreadServices& eventThreadServices, const RenderTaskList& list, const RenderTask& constTask ) +inline void RemoveTaskMessage(EventThreadServices& eventThreadServices, const RenderTaskList& list, const RenderTask& constTask) { // Scene graph thread can destroy this object. - RenderTask& task = const_cast< RenderTask& >( constTask ); + RenderTask& task = const_cast(constTask); - typedef MessageValue1< RenderTaskList, RenderTask* > LocalType; + using LocalType = MessageValue1; // Reserve some memory inside the message queue - uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* 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( &list, &RenderTaskList::RemoveTask, &task ); + new(slot) LocalType(&list, &RenderTaskList::RemoveTask, &task); } } // namespace SceneGraph @@ -167,4 +165,4 @@ inline void RemoveTaskMessage( EventThreadServices& eventThreadServices, const R } // namespace Dali -#endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H__ +#endif // DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_LIST_H