2 * Copyright (c) 2021 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 RenderToFrameBuffer renderToFboEnabled,
37 DepthBufferAvailable depthBufferAvailable,
38 StencilBufferAvailable stencilBufferAvailable,
39 PartialUpdateAvailable partialUpdateAvailable)
41 Core* instance = new Core;
42 instance->mImpl = new Internal::Core(renderController,
47 stencilBufferAvailable,
48 partialUpdateAvailable);
58 void Core::Initialize()
63 ContextNotifierInterface* Core::GetContextNotifier()
65 return mImpl->GetContextNotifier();
68 void Core::ContextCreated()
70 mImpl->ContextCreated();
73 void Core::ContextDestroyed()
75 mImpl->ContextDestroyed();
78 void Core::RecoverFromContextLoss()
80 mImpl->RecoverFromContextLoss();
83 void Core::SceneCreated()
85 mImpl->SceneCreated();
88 void Core::QueueEvent(const Event& event)
90 mImpl->QueueEvent(event);
93 void Core::ProcessEvents()
95 mImpl->ProcessEvents();
98 uint32_t Core::GetMaximumUpdateCount() const
100 return mImpl->GetMaximumUpdateCount();
103 void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
105 mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo);
108 void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly)
110 mImpl->PreRender(status, forceClear, uploadOnly);
113 void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
115 mImpl->PreRender(scene, damagedRects);
118 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
120 mImpl->RenderScene(status, scene, renderToFbo);
123 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
125 mImpl->RenderScene(status, scene, renderToFbo, clippingRect);
128 void Core::PostRender(bool uploadOnly)
130 mImpl->PostRender(uploadOnly);
133 void Core::RegisterProcessor(Processor& processor, bool postProcessor)
135 mImpl->RegisterProcessor(processor, postProcessor);
138 void Core::UnregisterProcessor(Processor& processor, bool postProcessor)
140 mImpl->UnregisterProcessor(processor, postProcessor);
143 ObjectRegistry Core::GetObjectRegistry() const
145 return ObjectRegistry(&mImpl->GetObjectRegistry());
153 } // namespace Integration