use modern construct 'nullptr' instead of 'NULL' or '0'
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
index de8714f..ecac451 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/events/event.h>
 #include <dali/integration-api/gl-sync-abstraction.h>
+#include <dali/integration-api/gl-context-helper-abstraction.h>
 #include <dali/integration-api/processor-interface.h>
 #include <dali/internal/common/core-impl.h>
 
@@ -35,22 +38,22 @@ Core* Core::New( RenderController& renderController,
                  PlatformAbstraction& platformAbstraction,
                  GlAbstraction& glAbstraction,
                  GlSyncAbstraction& glSyncAbstraction,
-                 GestureManager& gestureManager,
-                 ResourcePolicy::DataRetention policy,
+                 GlContextHelperAbstraction& glContextHelperAbstraction,
                  RenderToFrameBuffer renderToFboEnabled,
                  DepthBufferAvailable depthBufferAvailable,
-                 StencilBufferAvailable stencilBufferAvailable )
+                 StencilBufferAvailable stencilBufferAvailable,
+                 PartialUpdateAvailable partialUpdateAvailable )
 {
   Core* instance = new Core;
   instance->mImpl = new Internal::Core( renderController,
                                         platformAbstraction,
                                         glAbstraction,
                                         glSyncAbstraction,
-                                        gestureManager,
-                                        policy,
+                                        glContextHelperAbstraction,
                                         renderToFboEnabled,
                                         depthBufferAvailable,
-                                        stencilBufferAvailable );
+                                        stencilBufferAvailable,
+                                        partialUpdateAvailable );
 
   return instance;
 }
@@ -60,6 +63,11 @@ Core::~Core()
   delete mImpl;
 }
 
+void Core::Initialize()
+{
+  mImpl->Initialize();
+}
+
 ContextNotifierInterface* Core::GetContextNotifier()
 {
   return mImpl->GetContextNotifier();
@@ -80,21 +88,6 @@ void Core::RecoverFromContextLoss()
   mImpl->RecoverFromContextLoss();
 }
 
-void Core::SurfaceResized(uint32_t width, uint32_t height)
-{
-  mImpl->SurfaceResized(width, height);
-}
-
-void Core::SetTopMargin( uint32_t margin )
-{
-  mImpl->SetTopMargin(margin);
-}
-
-void Core::SetDpi( uint32_t dpiHorizontal, uint32_t dpiVertical)
-{
-  mImpl->SetDpi(dpiHorizontal, dpiVertical);
-}
-
 void Core::SceneCreated()
 {
   mImpl->SceneCreated();
@@ -120,9 +113,29 @@ void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uin
   mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
 }
 
-void Core::Render( RenderStatus& status, bool forceClear )
+void Core::PreRender( RenderStatus& status, bool forceClear, bool uploadOnly )
 {
-  mImpl->Render( status, forceClear );
+  mImpl->PreRender( status, forceClear, uploadOnly );
+}
+
+void Core::PreRender( Integration::Scene& scene, std::vector<Rect<int>>& damagedRects )
+{
+  mImpl->PreRender( scene, damagedRects );
+}
+
+void Core::RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo )
+{
+  mImpl->RenderScene( status, scene, renderToFbo );
+}
+
+void Core::RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect )
+{
+  mImpl->RenderScene( status, scene, renderToFbo, clippingRect );
+}
+
+void Core::PostRender( bool uploadOnly )
+{
+  mImpl->PostRender( uploadOnly );
 }
 
 void Core::RegisterProcessor( Processor& processor )
@@ -135,8 +148,13 @@ void Core::UnregisterProcessor( Processor& processor )
   mImpl->UnregisterProcessor( processor );
 }
 
+ObjectRegistry Core::GetObjectRegistry() const
+{
+  return ObjectRegistry( &mImpl->GetObjectRegistry() );
+}
+
 Core::Core()
-: mImpl( NULL )
+: mImpl( nullptr )
 {
 }