2 * Copyright (c) 2020 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/gl-context-helper-abstraction.h>
24 #include <dali/integration-api/gl-sync-abstraction.h>
25 #include <dali/integration-api/processor-interface.h>
26 #include <dali/internal/common/core-impl.h>
27 #include <dali/public-api/actors/layer.h>
28 #include <dali/public-api/common/dali-common.h>
29 #include <dali/public-api/render-tasks/render-task-list.h>
35 Core* Core::New(RenderController& renderController,
36 PlatformAbstraction& platformAbstraction,
37 GlAbstraction& glAbstraction,
38 GlSyncAbstraction& glSyncAbstraction,
39 GlContextHelperAbstraction& glContextHelperAbstraction,
40 RenderToFrameBuffer renderToFboEnabled,
41 DepthBufferAvailable depthBufferAvailable,
42 StencilBufferAvailable stencilBufferAvailable,
43 PartialUpdateAvailable partialUpdateAvailable)
45 Core* instance = new Core;
46 instance->mImpl = new Internal::Core(renderController,
50 glContextHelperAbstraction,
53 stencilBufferAvailable,
54 partialUpdateAvailable);
64 void Core::Initialize()
69 ContextNotifierInterface* Core::GetContextNotifier()
71 return mImpl->GetContextNotifier();
74 void Core::ContextCreated()
76 mImpl->ContextCreated();
79 void Core::ContextDestroyed()
81 mImpl->ContextDestroyed();
84 void Core::RecoverFromContextLoss()
86 mImpl->RecoverFromContextLoss();
89 void Core::SceneCreated()
91 mImpl->SceneCreated();
94 void Core::QueueEvent(const Event& event)
96 mImpl->QueueEvent(event);
99 void Core::ProcessEvents()
101 mImpl->ProcessEvents();
104 uint32_t Core::GetMaximumUpdateCount() const
106 return mImpl->GetMaximumUpdateCount();
109 void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
111 mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo);
114 void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly)
116 mImpl->PreRender(status, forceClear, uploadOnly);
119 void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
121 mImpl->PreRender(scene, damagedRects);
124 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
126 mImpl->RenderScene(status, scene, renderToFbo);
129 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
131 mImpl->RenderScene(status, scene, renderToFbo, clippingRect);
134 void Core::PostRender(bool uploadOnly)
136 mImpl->PostRender(uploadOnly);
139 void Core::RegisterProcessor(Processor& processor)
141 mImpl->RegisterProcessor(processor);
144 void Core::UnregisterProcessor(Processor& processor)
146 mImpl->UnregisterProcessor(processor);
149 ObjectRegistry Core::GetObjectRegistry() const
151 return ObjectRegistry(&mImpl->GetObjectRegistry());
159 } // namespace Integration