From 2885f1eb8650eba117dac772c7424dcfc93776bf Mon Sep 17 00:00:00 2001 From: Eunki Hong Date: Wed, 7 Feb 2024 00:59:05 +0900 Subject: [PATCH] Optimize render task completed notify signal Let we follow up RenderTask also optimized like Animation. The relationship between RenderTask <-> RenderTaskList is euqal with Animation <-> AnimationPlayList. So we can use same logic. Change-Id: I61072374252394e01fe542d8b02941c5b4e58476 Signed-off-by: Eunki Hong --- .../event/render-tasks/render-task-list-impl.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dali/internal/event/render-tasks/render-task-list-impl.cpp b/dali/internal/event/render-tasks/render-task-list-impl.cpp index 34912a0..fed77c6 100644 --- a/dali/internal/event/render-tasks/render-task-list-impl.cpp +++ b/dali/internal/event/render-tasks/render-task-list-impl.cpp @@ -216,22 +216,24 @@ void RenderTaskList::Initialize() mSceneObject->SetCompleteNotificationInterface(this); } -void RenderTaskList::NotifyCompleted(CompleteNotificationInterface::ParameterList notifierList) +void RenderTaskList::NotifyCompleted(CompleteNotificationInterface::ParameterList notifierIdList) { DALI_LOG_TRACE_METHOD(gLogRenderList); RenderTaskContainer finishedRenderTasks; - // TODO : Optimize here if required. - // Note : Actually, Total number of RenderTask should be small enough so full search might not overhead for now. - - // Since render tasks can be unreferenced during the signal emissions, iterators into render tasks pointers may be invalidated. - // First copy the finished render tasks, then emit signals - for(RenderTaskContainer::iterator iter = mTasks.begin(), endIt = mTasks.end(); iter != endIt; ++iter) + for(const auto& notifierId : notifierIdList) { - if((*iter)->HasFinished()) + auto* renderTask = GetEventObject(notifierId); + if(DALI_LIKELY(renderTask)) { - finishedRenderTasks.push_back(*iter); + // Check if this render task hold inputed scenegraph render task. + DALI_ASSERT_DEBUG(renderTask->GetRenderTaskSceneObject()->GetNotifyId() == notifierId); + + if(renderTask->HasFinished()) + { + finishedRenderTasks.push_back(renderTask); + } } } -- 2.7.4