projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "(Partial Update) Mark as not rendered if the node is transparent or culled...
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
update
/
render-tasks
/
scene-graph-render-task-list.cpp
diff --git
a/dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
b/dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
index
6704082
..
8139c2b
100644
(file)
--- a/
dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
+++ b/
dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
15
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
21
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-19,51
+19,74
@@
#include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
// INTERNAL INCLUDES
#include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
// INTERNAL INCLUDES
-#include <dali/internal/
update/render-tasks/scene-graph-render-task
.h>
+#include <dali/internal/
common/memory-pool-object-allocator
.h>
-namespace
Dali
+namespace
//Unnamed namespace
{
{
+//Memory pool used to allocate new RenderTaskLists. Memory used by this pool will be released when shutting down DALi
+Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::RenderTaskList> gRenderTaskListMemoryPool;
+
+} // unnamed namespace
+namespace Dali
+{
namespace Internal
{
namespace Internal
{
-
namespace SceneGraph
{
namespace SceneGraph
{
+RenderTaskList* RenderTaskList::New()
+{
+ return new(gRenderTaskListMemoryPool.AllocateRawThreadSafe()) RenderTaskList();
+}
+
+RenderTaskList::RenderTaskList()
+: mNotificationObject(nullptr),
+ mRenderMessageDispatcher(nullptr)
+{
+}
-RenderTaskList::
RenderTaskList( RenderMessageDispatcher& renderMessageDispatcher )
-: mNotificationObject( NULL ),
-
mRenderMessageDispatcher( renderMessageDispatcher
)
+RenderTaskList::
~RenderTaskList() = default;
+
+
void RenderTaskList::operator delete(void* ptr
)
{
{
+ gRenderTaskListMemoryPool.FreeThreadSafe(static_cast<RenderTaskList*>(ptr));
}
}
-
RenderTaskList::~RenderTaskList(
)
+
void RenderTaskList::SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher
)
{
{
+ mRenderMessageDispatcher = renderMessageDispatcher;
}
}
-void RenderTaskList::AddTask(
RenderTask* newTask
)
+void RenderTaskList::AddTask(
OwnerPointer<RenderTask>& newTask
)
{
{
- DALI_ASSERT_DEBUG( newTask != NULL && "SceneGraph RenderTask is null");
+ DALI_ASSERT_DEBUG(newTask && "SceneGraph RenderTask is null");
+ DALI_ASSERT_DEBUG(mRenderMessageDispatcher != NULL && "RenderMessageDispatcher is null");
+ newTask->Initialize(*mRenderMessageDispatcher);
// mRenderTasks container takes ownership
// mRenderTasks container takes ownership
- mRenderTasks.PushBack( newTask );
- newTask->Initialize( mRenderMessageDispatcher );
+ mRenderTasks.PushBack(newTask.Release());
}
}
-void RenderTaskList::RemoveTask(
RenderTask* task
)
+void RenderTaskList::RemoveTask(
RenderTask* task
)
{
RenderTaskContainer::ConstIterator end = mRenderTasks.End();
{
RenderTaskContainer::ConstIterator end = mRenderTasks.End();
- for
( RenderTaskContainer::Iterator iter = mRenderTasks.Begin(); iter != end; ++iter
)
+ for
(RenderTaskContainer::Iterator iter = mRenderTasks.Begin(); iter != end; ++iter
)
{
{
- if
( *iter == task
)
+ if
(*iter == task
)
{
// Destroy the task
{
// Destroy the task
- mRenderTasks.Erase(
iter
);
+ mRenderTasks.Erase(
iter
);
break; // we're finished
}
}
}
break; // we're finished
}
}
}
+uint32_t RenderTaskList::GetTaskCount()
+{
+ return static_cast<uint32_t>(mRenderTasks.Count());
+}
+
RenderTaskList::RenderTaskContainer& RenderTaskList::GetTasks()
{
return mRenderTasks;
RenderTaskList::RenderTaskContainer& RenderTaskList::GetTasks()
{
return mRenderTasks;
@@
-74,15
+97,13
@@
const RenderTaskList::RenderTaskContainer& RenderTaskList::GetTasks() const
return mRenderTasks;
}
return mRenderTasks;
}
-void RenderTaskList::SetCompleteNotificationInterface(
CompleteNotificationInterface* object
)
+void RenderTaskList::SetCompleteNotificationInterface(
CompleteNotificationInterface* object
)
{
{
-
mNotificationObject = object;
}
CompleteNotificationInterface* RenderTaskList::GetCompleteNotificationInterface()
{
mNotificationObject = object;
}
CompleteNotificationInterface* RenderTaskList::GetCompleteNotificationInterface()
{
-
return mNotificationObject;
}
return mNotificationObject;
}