From: Eunki Hong Date: Tue, 6 Feb 2024 15:59:05 +0000 (+0900) Subject: Optimize render task completed notify signal X-Git-Tag: dali_2.3.10~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F305708%2F1;p=platform%2Fcore%2Fuifw%2Fdali-core.git 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 --- 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); + } } }