2 * Copyright (c) 2024 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/common/core-impl.h>
22 #include <dali/graphics-api/graphics-controller.h>
23 #include <dali/integration-api/core.h>
24 #include <dali/integration-api/debug.h>
25 #include <dali/integration-api/events/event.h>
26 #include <dali/integration-api/platform-abstraction.h>
27 #include <dali/integration-api/processor-interface.h>
28 #include <dali/integration-api/render-controller.h>
29 #include <dali/integration-api/trace.h>
31 #include <dali/internal/event/actors/actor-impl.h>
32 #include <dali/internal/event/animation/animation-playlist.h>
33 #include <dali/internal/event/common/event-thread-services.h>
34 #include <dali/internal/event/common/notification-manager.h>
35 #include <dali/internal/event/common/property-notification-manager.h>
36 #include <dali/internal/event/common/stage-impl.h>
37 #include <dali/internal/event/common/thread-local-storage.h>
38 #include <dali/internal/event/common/type-registry-impl.h>
39 #include <dali/internal/event/effects/shader-factory.h>
40 #include <dali/internal/event/events/event-processor.h>
41 #include <dali/internal/event/events/gesture-event-processor.h>
42 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
43 #include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
45 #include <dali/internal/update/common/discard-queue.h>
46 #include <dali/internal/update/manager/render-task-processor.h>
47 #include <dali/internal/update/manager/update-manager.h>
49 #include <dali/internal/render/common/performance-monitor.h>
50 #include <dali/internal/render/common/render-manager.h>
52 using Dali::Internal::SceneGraph::RenderManager;
53 using Dali::Internal::SceneGraph::RenderQueue;
54 using Dali::Internal::SceneGraph::UpdateManager;
58 // The Update for frame N+1 may be processed whilst frame N is being rendered.
59 const uint32_t MAXIMUM_UPDATE_COUNT = 2u;
61 DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
63 #if defined(DEBUG_ENABLED)
64 Debug::Filter* gCoreFilter = Debug::Filter::New(Debug::Concise, false, "LOG_CORE");
72 using Integration::Event;
73 using Integration::PlatformAbstraction;
74 using Integration::RenderController;
75 using Integration::RenderStatus;
76 using Integration::UpdateStatus;
78 Core::Core(RenderController& renderController,
79 PlatformAbstraction& platform,
80 Graphics::Controller& graphicsController,
81 Integration::CorePolicyFlags corePolicy)
82 : mRenderController(renderController),
84 mGraphicsController(graphicsController),
85 mProcessorOnceIndex(0u),
86 mPostProcessorOnceIndex(0u),
87 mProcessingEvent(false),
88 mProcessorUnregistered(false),
89 mPostProcessorUnregistered(false),
92 // Create the thread local storage
93 CreateThreadLocalStorage();
95 // This does nothing until Core is built with --enable-performance-monitor
96 PERFORMANCE_MONITOR_INIT(platform);
98 mNotificationManager = new NotificationManager();
100 mAnimationPlaylist = AnimationPlaylist::New();
102 mPropertyNotificationManager = PropertyNotificationManager::New();
104 mRenderTaskProcessor = new SceneGraph::RenderTaskProcessor();
106 mRenderManager = RenderManager::New(graphicsController,
107 (corePolicy & Integration::CorePolicyFlags::DEPTH_BUFFER_AVAILABLE) ? Integration::DepthBufferAvailable::TRUE : Integration::DepthBufferAvailable::FALSE,
108 (corePolicy & Integration::CorePolicyFlags::STENCIL_BUFFER_AVAILABLE) ? Integration::StencilBufferAvailable::TRUE : Integration::StencilBufferAvailable::FALSE,
109 (corePolicy & Integration::CorePolicyFlags::PARTIAL_UPDATE_AVAILABLE) ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE);
111 RenderQueue& renderQueue = mRenderManager->GetRenderQueue();
113 mUpdateManager = new UpdateManager(*mNotificationManager,
115 *mPropertyNotificationManager,
119 *mRenderTaskProcessor);
121 mRenderManager->SetShaderSaver(*mUpdateManager);
123 mObjectRegistry = ObjectRegistry::New();
125 mStage = IntrusivePtr<Stage>(Stage::New(*mUpdateManager));
127 // This must be called after stage is created but before stage initialization
128 mRelayoutController = IntrusivePtr<RelayoutController>(new RelayoutController(mRenderController));
130 mGestureEventProcessor = new GestureEventProcessor(*mUpdateManager, mRenderController);
132 mShaderFactory = new ShaderFactory();
133 mUpdateManager->SetShaderSaver(*mShaderFactory);
135 GetImplementation(Dali::TypeRegistry::Get()).CallInitFunctions();
137 DALI_LOG_RELEASE_INFO("Core policy enum : 0x%x\n", static_cast<uint32_t>(corePolicy));
143 * The order of destructing these singletons is important!!!
146 // clear the thread local storage first
147 // allows core to be created / deleted many times in the same thread (how TET cases work).
148 // Do this before mStage.Reset() so Stage::IsInstalled() returns false
149 ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
156 mObjectRegistry.Reset();
158 // Stop relayout requests being raised on stage destruction
159 mRelayoutController.Reset();
161 // remove (last?) reference to stage
165 void Core::Initialize()
167 mStage->Initialize(*mScenes[0]);
170 Integration::ContextNotifierInterface* Core::GetContextNotifier()
175 void Core::RecoverFromContextLoss()
177 DALI_LOG_INFO(gCoreFilter, Debug::Verbose, "Core::RecoverFromContextLoss()\n");
179 mStage->GetRenderTaskList().RecoverFromContextLoss(); // Re-trigger render-tasks
182 void Core::ContextCreated()
186 void Core::ContextDestroyed()
188 mRenderManager->ContextDestroyed();
191 void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
193 // set the time delta so adaptor can easily print FPS with a release build with 0 as
194 // it is cached by frametime
195 status.secondsFromLastFrame = elapsedSeconds;
197 // Render returns true when there are updates on the stage or one or more animations are completed.
198 // Use the estimated time diff till we render as the elapsed time.
199 status.keepUpdating = mUpdateManager->Update(elapsedSeconds,
200 lastVSyncTimeMilliseconds,
201 nextVSyncTimeMilliseconds,
206 // Check the Notification Manager message queue to set needsNotification
207 status.needsNotification = mNotificationManager->MessagesToProcess();
209 // No need to keep update running if there are notifications to process.
210 // Any message to update will wake it up anyways
213 void Core::PreRender(RenderStatus& status, bool forceClear)
215 mRenderManager->PreRender(status, forceClear);
218 void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
220 mRenderManager->PreRender(scene, damagedRects);
223 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
225 mRenderManager->RenderScene(status, scene, renderToFbo);
228 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
230 mRenderManager->RenderScene(status, scene, renderToFbo, clippingRect);
233 void Core::PostRender()
235 mUpdateManager->PostRender();
236 mRenderManager->PostRender();
239 void Core::SceneCreated()
241 mStage->EmitSceneCreatedSignal();
243 mRelayoutController->OnApplicationSceneCreated();
245 for(const auto& scene : mScenes)
247 Dali::Actor sceneRootLayer = scene->GetRootLayer();
248 mRelayoutController->RequestRelayoutTree(sceneRootLayer);
252 void Core::QueueEvent(const Integration::Event& event)
254 if(mScenes.size() != 0)
256 mScenes.front()->QueueEvent(event);
260 void Core::ForceRelayout()
264 DALI_LOG_ERROR("ForceRelayout should not be called from within RelayoutAndFlush!\n");
268 // Scene could be added or removed while processing the events
269 // Copy the Scene container locally to avoid possibly invalid iterator
270 SceneContainer scenes = mScenes;
272 RelayoutAndFlush(scenes);
275 void Core::ProcessEvents()
277 // Guard against calls to ProcessEvents() during ProcessEvents()
280 DALI_LOG_ERROR("ProcessEvents should not be called from within ProcessEvents!\n");
281 mRenderController.RequestProcessEventsOnIdle();
285 mProcessingEvent = true;
286 mRelayoutController->SetProcessingCoreEvents(true);
288 // Signal that any messages received will be flushed soon
289 mUpdateManager->EventProcessingStarted();
291 // Scene could be added or removed while processing the events
292 // Copy the Scene container locally to avoid possibly invalid iterator
293 SceneContainer scenes = mScenes;
295 // process events in all scenes
296 for(auto scene : scenes)
298 scene->ProcessEvents();
301 mNotificationManager->ProcessMessages();
303 // Emit signal here to inform listeners that event processing has finished.
304 for(auto scene : scenes)
306 scene->EmitEventProcessingFinishedSignal();
309 RelayoutAndFlush(scenes);
311 mUpdateManager->EventProcessingFinished();
313 // Check if the touch or gestures require updates.
314 const bool gestureNeedsUpdate = mGestureEventProcessor->NeedsUpdate();
316 if(gestureNeedsUpdate)
318 // tell the render controller to keep update thread running
319 mRenderController.RequestUpdate();
322 mRelayoutController->SetProcessingCoreEvents(false);
324 // ProcessEvents() may now be called again
325 mProcessingEvent = false;
328 void Core::RelayoutAndFlush(SceneContainer& scenes)
332 DALI_LOG_ERROR("RelayoutAndFlush should not be called from within RelayoutAndFlush!\n");
336 const bool isProcessEvents = mProcessingEvent;
340 // Fake that we are in ProcessEvents()
341 mProcessingEvent = true;
342 mRelayoutController->SetProcessingCoreEvents(true);
344 // Signal that any messages received will be flushed soon
345 mUpdateManager->EventProcessingStarted();
348 mRelayoutFlush = true;
350 // Run any registered processors
353 // Run the size negotiation after event processing finished signal
354 mRelayoutController->Relayout();
356 // Run any registered post processors
359 // Rebuild depth tree after event processing has finished
360 for(auto& scene : scenes)
362 scene->RebuildDepthTree();
365 // Flush any queued messages for the update-thread
366 const bool messagesToProcess = mUpdateManager->FlushQueue();
368 if(messagesToProcess)
370 // tell the render controller to keep update thread running
371 mRenderController.RequestUpdate();
374 mRelayoutFlush = false;
378 // Revert fake informations
379 mProcessingEvent = false;
380 mRelayoutController->SetProcessingCoreEvents(false);
382 mUpdateManager->EventProcessingFinished();
386 uint32_t Core::GetMaximumUpdateCount() const
388 return MAXIMUM_UPDATE_COUNT;
391 void Core::RegisterProcessor(Integration::Processor& processor, bool postProcessor)
395 mPostProcessors.PushBack(&processor);
399 mProcessors.PushBack(&processor);
403 void Core::UnregisterProcessor(Integration::Processor& processor, bool postProcessor)
407 auto iter = std::find(mPostProcessors.Begin(), mPostProcessors.End(), &processor);
408 if(iter != mPostProcessors.End())
410 mPostProcessors.Erase(iter);
411 mPostProcessorUnregistered = true;
416 auto iter = std::find(mProcessors.Begin(), mProcessors.End(), &processor);
417 if(iter != mProcessors.End())
419 mProcessors.Erase(iter);
420 mProcessorUnregistered = true;
425 void Core::RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
429 mPostProcessorsOnce[mPostProcessorOnceIndex].PushBack(&processor);
433 mProcessorsOnce[mProcessorOnceIndex].PushBack(&processor);
437 void Core::UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
441 for(uint32_t index = 0; index < 2; ++index)
443 auto iter = std::find(mPostProcessorsOnce[index].Begin(), mPostProcessorsOnce[index].End(), &processor);
444 if(iter != mPostProcessorsOnce[index].End())
446 mPostProcessorsOnce[index].Erase(iter);
447 if(index != mPostProcessorOnceIndex)
449 // Check processor unregistered during processing.
450 mPostProcessorUnregistered = true;
457 for(uint32_t index = 0; index < 2; ++index)
459 auto iter = std::find(mProcessorsOnce[index].Begin(), mProcessorsOnce[index].End(), &processor);
460 if(iter != mProcessorsOnce[index].End())
462 mProcessorsOnce[index].Erase(iter);
463 if(index != mProcessorOnceIndex)
465 // Check processor unregistered during processing.
466 mProcessorUnregistered = true;
473 void Core::UnregisterProcessors()
475 mPostProcessors.Clear();
476 mPostProcessorUnregistered = true;
478 mProcessorUnregistered = true;
480 for(uint32_t index = 0; index < 2; ++index)
482 mPostProcessorsOnce[index].Clear();
483 mProcessorsOnce[index].Clear();
487 void Core::RunProcessors()
489 if(mProcessorsOnce[mProcessorOnceIndex].Count() != 0)
491 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSORS_ONCE", [&](std::ostringstream& oss) {
492 oss << "[" << mProcessorOnceIndex << ":" << mProcessorsOnce[mProcessorOnceIndex].Count() << "]";
495 // Swap processor index.
496 uint32_t currentIndex = mProcessorOnceIndex;
497 mProcessorOnceIndex ^= 1;
499 // Copy processor pointers to prevent changes to vector affecting loop iterator.
500 Dali::Vector<Integration::Processor*> processors(mProcessorsOnce[currentIndex]);
502 // To prevent accessing processor unregistered during the loop
503 mProcessorUnregistered = false;
505 for(auto processor : processors)
509 if(!mProcessorUnregistered)
511 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
512 oss << "[" << processor->GetProcessorName() << "]";
514 processor->Process(false);
515 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
516 oss << "[" << processor->GetProcessorName() << "]";
521 // Run processor if the processor is still in the list.
522 // It may be removed during the loop.
523 auto iter = std::find(mProcessorsOnce[currentIndex].Begin(), mProcessorsOnce[currentIndex].End(), processor);
524 if(iter != mProcessorsOnce[currentIndex].End())
526 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
527 oss << "[" << processor->GetProcessorName() << "]";
529 processor->Process(false);
530 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
531 oss << "[" << processor->GetProcessorName() << "]";
538 // Clear once processor.
539 mProcessorsOnce[currentIndex].Clear();
541 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSORS_ONCE", [&](std::ostringstream& oss) {
542 oss << "[" << currentIndex;
543 if(mProcessorUnregistered)
545 oss << ", processor changed";
551 if(mProcessors.Count() != 0)
553 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSORS", [&](std::ostringstream& oss) {
554 oss << "[" << mProcessors.Count() << "]";
557 // Copy processor pointers to prevent changes to vector affecting loop iterator.
558 Dali::Vector<Integration::Processor*> processors(mProcessors);
560 // To prevent accessing processor unregistered during the loop
561 mProcessorUnregistered = false;
563 for(auto processor : processors)
567 if(!mProcessorUnregistered)
569 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", [&](std::ostringstream& oss) {
570 oss << "[" << processor->GetProcessorName() << "]";
572 processor->Process(false);
573 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", [&](std::ostringstream& oss) {
574 oss << "[" << processor->GetProcessorName() << "]";
579 // Run processor if the processor is still in the list.
580 // It may be removed during the loop.
581 auto iter = std::find(mProcessors.Begin(), mProcessors.End(), processor);
582 if(iter != mProcessors.End())
584 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", [&](std::ostringstream& oss) {
585 oss << "[" << processor->GetProcessorName() << "]";
587 processor->Process(false);
588 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSOR", [&](std::ostringstream& oss) {
589 oss << "[" << processor->GetProcessorName() << "]";
595 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_PROCESSORS", [&](std::ostringstream& oss) {
596 oss << "[" << mProcessors.Count();
597 if(mProcessorUnregistered)
599 oss << ", processor changed";
606 void Core::RunPostProcessors()
608 if(mPostProcessorsOnce[mPostProcessorOnceIndex].Count() != 0)
610 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS_ONCE", [&](std::ostringstream& oss) {
611 oss << "[" << mPostProcessorOnceIndex << ":" << mPostProcessorsOnce[mPostProcessorOnceIndex].Count() << "]";
614 // Swap processor index.
615 uint32_t currentIndex = mPostProcessorOnceIndex;
616 mPostProcessorOnceIndex ^= 1;
618 // Copy processor pointers to prevent changes to vector affecting loop iterator.
619 Dali::Vector<Integration::Processor*> processors(mPostProcessorsOnce[currentIndex]);
621 // To prevent accessing processor unregistered during the loop
622 mPostProcessorUnregistered = false;
624 for(auto processor : processors)
628 if(!mPostProcessorUnregistered)
630 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
631 oss << "[" << processor->GetProcessorName() << "]";
633 processor->Process(true);
634 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
635 oss << "[" << processor->GetProcessorName() << "]";
640 // Run processor if the processor is still in the list.
641 // It may be removed during the loop.
642 auto iter = std::find(mPostProcessorsOnce[currentIndex].Begin(), mPostProcessorsOnce[currentIndex].End(), processor);
643 if(iter != mPostProcessorsOnce[currentIndex].End())
645 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
646 oss << "[" << processor->GetProcessorName() << "]";
648 processor->Process(true);
649 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR_ONCE", [&](std::ostringstream& oss) {
650 oss << "[" << processor->GetProcessorName() << "]";
657 // Clear once processor.
658 mPostProcessorsOnce[currentIndex].Clear();
660 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS_ONCE", [&](std::ostringstream& oss) {
661 oss << "[" << currentIndex;
662 if(mPostProcessorUnregistered)
664 oss << ", processor changed";
670 if(mPostProcessors.Count() != 0)
672 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS", [&](std::ostringstream& oss) {
673 oss << "[" << mPostProcessors.Count() << "]";
676 // Copy processor pointers to prevent changes to vector affecting loop iterator.
677 Dali::Vector<Integration::Processor*> processors(mPostProcessors);
679 // To prevent accessing processor unregistered during the loop
680 mPostProcessorUnregistered = false;
682 for(auto processor : processors)
686 if(!mPostProcessorUnregistered)
688 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", [&](std::ostringstream& oss) {
689 oss << "[" << processor->GetProcessorName() << "]";
691 processor->Process(true);
692 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", [&](std::ostringstream& oss) {
693 oss << "[" << processor->GetProcessorName() << "]";
698 // Run processor if the processor is still in the list.
699 // It may be removed during the loop.
700 auto iter = std::find(mPostProcessors.Begin(), mPostProcessors.End(), processor);
701 if(iter != mPostProcessors.End())
703 DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", [&](std::ostringstream& oss) {
704 oss << "[" << processor->GetProcessorName() << "]";
706 processor->Process(true);
707 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSOR", [&](std::ostringstream& oss) {
708 oss << "[" << processor->GetProcessorName() << "]";
715 DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS", [&](std::ostringstream& oss) {
716 oss << "[" << mPostProcessors.Count();
717 if(mPostProcessorUnregistered)
719 oss << ", processor changed";
726 StagePtr Core::GetCurrentStage()
731 PlatformAbstraction& Core::GetPlatform()
736 UpdateManager& Core::GetUpdateManager()
738 return *(mUpdateManager);
741 RenderManager& Core::GetRenderManager()
743 return *(mRenderManager);
746 NotificationManager& Core::GetNotificationManager()
748 return *(mNotificationManager);
751 ShaderFactory& Core::GetShaderFactory()
753 return *(mShaderFactory);
756 GestureEventProcessor& Core::GetGestureEventProcessor()
758 return *(mGestureEventProcessor);
761 RelayoutController& Core::GetRelayoutController()
763 return *(mRelayoutController.Get());
766 ObjectRegistry& Core::GetObjectRegistry() const
768 return *(mObjectRegistry.Get());
771 void Core::LogMemoryPools() const
773 uint32_t animationPoolCapacity = SceneGraph::Animation::GetMemoryPoolCapacity();
774 uint32_t renderItemPoolCapacity = SceneGraph::RenderItem::GetMemoryPoolCapacity();
775 uint32_t relayoutItemPoolCapacity = mRelayoutController->GetMemoryPoolCapacity();
776 uint32_t rendererPoolCapacity = SceneGraph::Renderer::GetMemoryPoolCapacity();
777 uint32_t textureSetPoolCapacity = SceneGraph::TextureSet::GetMemoryPoolCapacity();
778 uint32_t renderTaskPoolCapacity = SceneGraph::RenderTaskList::GetMemoryPoolCapacity();
779 uint32_t nodePoolCapacity = SceneGraph::Node::GetMemoryPoolCapacity();
781 DALI_LOG_RELEASE_INFO(
782 "\nMemory Pool capacities:\n"
784 " RenderItems: %lu\n"
785 " RelayoutItems: %lu\n"
787 " TextureSets: %lu\n"
788 " RenderTasks: %lu\n"
790 animationPoolCapacity,
791 renderItemPoolCapacity,
792 relayoutItemPoolCapacity,
793 rendererPoolCapacity,
794 textureSetPoolCapacity,
795 renderTaskPoolCapacity,
798 uint32_t updateQCapacity = mUpdateManager->GetUpdateMessageQueueCapacity();
799 uint32_t renderQCapacity = mUpdateManager->GetRenderMessageQueueCapacity();
801 DALI_LOG_RELEASE_INFO(
802 "\nMessage Queue capacities:\n"
803 " UpdateQueue: %lu\n"
804 " RenderQueue: %lu\n",
808 size_t renderInstructionCapacity = mUpdateManager->GetRenderInstructionCapacity();
809 DALI_LOG_RELEASE_INFO("\nRenderInstruction capacity: %lu\n", renderInstructionCapacity);
812 EventThreadServices& Core::GetEventThreadServices()
817 PropertyNotificationManager& Core::GetPropertyNotificationManager() const
819 return *(mPropertyNotificationManager);
822 AnimationPlaylist& Core::GetAnimationPlaylist() const
824 return *(mAnimationPlaylist);
827 Integration::GraphicsConfig& Core::GetGraphicsConfig() const
829 return mGraphicsController.GetGraphicsConfig();
832 void Core::AddScene(Scene* scene)
834 mScenes.push_back(scene);
837 void Core::RemoveScene(Scene* scene)
839 auto iter = std::find(mScenes.begin(), mScenes.end(), scene);
840 if(iter != mScenes.end())
846 void Core::CreateThreadLocalStorage()
848 // a pointer to the ThreadLocalStorage object will be stored in TLS
849 // The ThreadLocalStorage object should be deleted by the Core destructor
850 ThreadLocalStorage* tls = new ThreadLocalStorage(this);
854 void Core::RegisterObject(Dali::BaseObject* object)
856 mObjectRegistry = &ThreadLocalStorage::Get().GetObjectRegistry();
857 mObjectRegistry->RegisterObject(object);
860 void Core::UnregisterObject(Dali::BaseObject* object)
862 mObjectRegistry = &ThreadLocalStorage::Get().GetObjectRegistry();
863 mObjectRegistry->UnregisterObject(object);
866 Integration::RenderController& Core::GetRenderController()
868 return mRenderController;
871 uint32_t* Core::ReserveMessageSlot(uint32_t size, bool updateScene)
873 return mUpdateManager->ReserveMessageSlot(size, updateScene);
876 BufferIndex Core::GetEventBufferIndex() const
878 return mUpdateManager->GetEventBufferIndex();
881 } // namespace Internal