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/integration-api/core.h>
22 #include <dali/integration-api/events/event.h>
23 #include <dali/integration-api/processor-interface.h>
24 #include <dali/internal/common/core-impl.h>
25 #include <dali/public-api/actors/layer.h>
26 #include <dali/public-api/common/dali-common.h>
27 #include <dali/public-api/render-tasks/render-task-list.h>
33 Core* Core::New(RenderController& renderController,
34 PlatformAbstraction& platformAbstraction,
35 Graphics::Controller& graphicsController,
36 CorePolicyFlags corePolicy)
38 Core* instance = new Core;
39 instance->mImpl = new Internal::Core(renderController,
52 void Core::Initialize()
57 ContextNotifierInterface* Core::GetContextNotifier()
59 return mImpl->GetContextNotifier();
62 void Core::ContextCreated()
64 mImpl->ContextCreated();
67 void Core::ContextDestroyed()
69 mImpl->ContextDestroyed();
72 void Core::RecoverFromContextLoss()
74 mImpl->RecoverFromContextLoss();
77 void Core::SceneCreated()
79 mImpl->SceneCreated();
82 void Core::QueueEvent(const Event& event)
84 mImpl->QueueEvent(event);
87 void Core::ForceRelayout()
89 mImpl->ForceRelayout();
92 void Core::ProcessEvents()
94 mImpl->ProcessEvents();
97 uint32_t Core::GetMaximumUpdateCount() const
99 return mImpl->GetMaximumUpdateCount();
102 void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
104 mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo, uploadOnly);
107 void Core::PreRender(RenderStatus& status, bool forceClear)
109 mImpl->PreRender(status, forceClear);
112 void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
114 mImpl->PreRender(scene, damagedRects);
117 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
119 mImpl->RenderScene(status, scene, renderToFbo);
122 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
124 mImpl->RenderScene(status, scene, renderToFbo, clippingRect);
127 void Core::PostRender()
132 void Core::RegisterProcessor(Processor& processor, bool postProcessor)
134 mImpl->RegisterProcessor(processor, postProcessor);
137 void Core::UnregisterProcessor(Processor& processor, bool postProcessor)
139 mImpl->UnregisterProcessor(processor, postProcessor);
142 void Core::RegisterProcessorOnce(Processor& processor, bool postProcessor)
144 mImpl->RegisterProcessorOnce(processor, postProcessor);
147 void Core::UnregisterProcessorOnce(Processor& processor, bool postProcessor)
149 mImpl->UnregisterProcessorOnce(processor, postProcessor);
152 void Core::UnregisterProcessors()
154 mImpl->UnregisterProcessors();
157 ObjectRegistry Core::GetObjectRegistry() const
159 return ObjectRegistry(&mImpl->GetObjectRegistry());
162 void Core::LogMemoryPools() const
164 mImpl->LogMemoryPools();
172 } // namespace Integration