Added memory pool logging
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
index 8d34ae3..870861b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/integration-api/core.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
 #include <dali/integration-api/events/event.h>
-#include <dali/integration-api/gl-sync-abstraction.h>
+#include <dali/integration-api/processor-interface.h>
 #include <dali/internal/common/core-impl.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
 
 namespace Dali
 {
-
 namespace Integration
 {
-
-Core* Core::New( RenderController& renderController,
-                 PlatformAbstraction& platformAbstraction,
-                 GlAbstraction& glAbstraction,
-                 GlSyncAbstraction& glSyncAbstraction,
-                 GestureManager& gestureManager,
-                 ResourcePolicy::DataRetention policy,
-                 RenderToFrameBuffer renderToFboEnabled,
-                 DepthBufferAvailable depthBufferAvailable,
-                 StencilBufferAvailable stencilBufferAvailable )
-{
-  Core* instance = new Core;
-  instance->mImpl = new Internal::Core( renderController,
-                                        platformAbstraction,
-                                        glAbstraction,
-                                        glSyncAbstraction,
-                                        gestureManager,
-                                        policy,
-                                        renderToFboEnabled,
-                                        depthBufferAvailable,
-                                        stencilBufferAvailable );
+Core* Core::New(RenderController&      renderController,
+                PlatformAbstraction&   platformAbstraction,
+                Graphics::Controller&  graphicsController,
+                RenderToFrameBuffer    renderToFboEnabled,
+                DepthBufferAvailable   depthBufferAvailable,
+                StencilBufferAvailable stencilBufferAvailable,
+                PartialUpdateAvailable partialUpdateAvailable)
+{
+  Core* instance  = new Core;
+  instance->mImpl = new Internal::Core(renderController,
+                                       platformAbstraction,
+                                       graphicsController,
+                                       renderToFboEnabled,
+                                       depthBufferAvailable,
+                                       stencilBufferAvailable,
+                                       partialUpdateAvailable);
 
   return instance;
 }
@@ -59,6 +55,11 @@ Core::~Core()
   delete mImpl;
 }
 
+void Core::Initialize()
+{
+  mImpl->Initialize();
+}
+
 ContextNotifierInterface* Core::GetContextNotifier()
 {
   return mImpl->GetContextNotifier();
@@ -79,21 +80,6 @@ void Core::RecoverFromContextLoss()
   mImpl->RecoverFromContextLoss();
 }
 
-void Core::SurfaceResized(unsigned int width, unsigned int height)
-{
-  mImpl->SurfaceResized(width, height);
-}
-
-void Core::SetTopMargin( unsigned int margin )
-{
-  mImpl->SetTopMargin(margin);
-}
-
-void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
-{
-  mImpl->SetDpi(dpiHorizontal, dpiVertical);
-}
-
 void Core::SceneCreated()
 {
   mImpl->SceneCreated();
@@ -109,58 +95,63 @@ void Core::ProcessEvents()
   mImpl->ProcessEvents();
 }
 
-unsigned int Core::GetMaximumUpdateCount() const
+uint32_t Core::GetMaximumUpdateCount() const
 {
   return mImpl->GetMaximumUpdateCount();
 }
 
-void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
+void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
+{
+  mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo, uploadOnly);
+}
+
+void Core::PreRender(RenderStatus& status, bool forceClear)
 {
-  mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
+  mImpl->PreRender(status, forceClear);
 }
 
-void Core::Render( RenderStatus& status, bool forceClear )
+void Core::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
 {
-  mImpl->Render( status, forceClear );
+  mImpl->PreRender(scene, damagedRects);
 }
 
-SystemOverlay& Core::GetSystemOverlay()
+void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo)
 {
-  return mImpl->GetSystemOverlay();
+  mImpl->RenderScene(status, scene, renderToFbo);
 }
 
-void Core::SetViewMode( ViewMode viewMode )
+void Core::RenderScene(RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect)
 {
-  mImpl->SetViewMode( viewMode );
+  mImpl->RenderScene(status, scene, renderToFbo, clippingRect);
 }
 
-ViewMode Core::GetViewMode() const
+void Core::PostRender()
 {
-  return mImpl->GetViewMode();
+  mImpl->PostRender();
 }
 
-void Core::SetStereoBase( float stereoBase )
+void Core::RegisterProcessor(Processor& processor, bool postProcessor)
 {
-  mImpl->SetStereoBase( stereoBase );
+  mImpl->RegisterProcessor(processor, postProcessor);
 }
 
-float Core::GetStereoBase() const
+void Core::UnregisterProcessor(Processor& processor, bool postProcessor)
 {
-  return mImpl->GetStereoBase();
+  mImpl->UnregisterProcessor(processor, postProcessor);
 }
 
-void Core::RegisterProcessor( Processor& processor )
+ObjectRegistry Core::GetObjectRegistry() const
 {
-  mImpl->RegisterProcessor( processor );
+  return ObjectRegistry(&mImpl->GetObjectRegistry());
 }
 
-void Core::UnregisterProcessor( Processor& processor )
+void Core::LogMemoryPools() const
 {
-  mImpl->UnregisterProcessor( processor );
+  mImpl->LogMemoryPools();
 }
 
 Core::Core()
-: mImpl( NULL )
+: mImpl(nullptr)
 {
 }