[dali_2.3.33] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
1 /*
2  * Copyright (c) 2024 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/integration-api/core.h>
20
21 // INTERNAL INCLUDES
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>
28
29 namespace Dali
30 {
31 namespace Integration
32 {
33 Core* Core::New(RenderController&     renderController,
34                 PlatformAbstraction&  platformAbstraction,
35                 Graphics::Controller& graphicsController,
36                 CorePolicyFlags       corePolicy)
37 {
38   Core* instance  = new Core;
39   instance->mImpl = new Internal::Core(renderController,
40                                        platformAbstraction,
41                                        graphicsController,
42                                        corePolicy);
43
44   return instance;
45 }
46
47 Core::~Core()
48 {
49   delete mImpl;
50 }
51
52 void Core::Initialize()
53 {
54   mImpl->Initialize();
55 }
56
57 ContextNotifierInterface* Core::GetContextNotifier()
58 {
59   return mImpl->GetContextNotifier();
60 }
61
62 void Core::ContextCreated()
63 {
64   mImpl->ContextCreated();
65 }
66
67 void Core::ContextDestroyed()
68 {
69   mImpl->ContextDestroyed();
70 }
71
72 void Core::RecoverFromContextLoss()
73 {
74   mImpl->RecoverFromContextLoss();
75 }
76
77 void Core::SceneCreated()
78 {
79   mImpl->SceneCreated();
80 }
81
82 void Core::QueueEvent(const Event& event)
83 {
84   mImpl->QueueEvent(event);
85 }
86
87 void Core::ForceRelayout()
88 {
89   mImpl->ForceRelayout();
90 }
91
92 void Core::ProcessEvents()
93 {
94   mImpl->ProcessEvents();
95 }
96
97 uint32_t Core::GetMaximumUpdateCount() const
98 {
99   return mImpl->GetMaximumUpdateCount();
100 }
101
102 void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
103 {
104   mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo, uploadOnly);
105 }
106
107 void Core::PreRender(RenderStatus& status, bool forceClear)
108 {
109   mImpl->PreRender(status, forceClear);
110 }
111
112 void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
113 {
114   mImpl->PreRender(scene, damagedRects);
115 }
116
117 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
118 {
119   mImpl->RenderScene(status, scene, renderToFbo);
120 }
121
122 void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
123 {
124   mImpl->RenderScene(status, scene, renderToFbo, clippingRect);
125 }
126
127 void Core::PostRender()
128 {
129   mImpl->PostRender();
130 }
131
132 void Core::RegisterProcessor(Processor& processor, bool postProcessor)
133 {
134   mImpl->RegisterProcessor(processor, postProcessor);
135 }
136
137 void Core::UnregisterProcessor(Processor& processor, bool postProcessor)
138 {
139   mImpl->UnregisterProcessor(processor, postProcessor);
140 }
141
142 void Core::RegisterProcessorOnce(Processor& processor, bool postProcessor)
143 {
144   mImpl->RegisterProcessorOnce(processor, postProcessor);
145 }
146
147 void Core::UnregisterProcessorOnce(Processor& processor, bool postProcessor)
148 {
149   mImpl->UnregisterProcessorOnce(processor, postProcessor);
150 }
151
152 void Core::UnregisterProcessors()
153 {
154   mImpl->UnregisterProcessors();
155 }
156
157 ObjectRegistry Core::GetObjectRegistry() const
158 {
159   return ObjectRegistry(&mImpl->GetObjectRegistry());
160 }
161
162 void Core::LogMemoryPools() const
163 {
164   mImpl->LogMemoryPools();
165 }
166
167 Core::Core()
168 : mImpl(nullptr)
169 {
170 }
171
172 } // namespace Integration
173
174 } // namespace Dali