Graphics and Vulkan integration within Adaptor
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / common / render-helper.cpp
index 87cdb3b..8abff8d 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/graphics/graphics.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
@@ -38,6 +39,7 @@ RenderHelper::RenderHelper( AdaptorInternalServices& adaptorInterfaces )
 : mGLES( adaptorInterfaces.GetGlesInterface() ),
   mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
   mEGL( NULL ),
+  mGraphics( adaptorInterfaces.GetGraphics() ),
   mSurfaceReplaced( false ),
   mSurfaceResized( false )
 {
@@ -61,25 +63,30 @@ RenderHelper::~RenderHelper()
     delete mDisplayConnection;
     mDisplayConnection = NULL;
   }
-
+#if 0
   mEglFactory->Destroy();
+#endif
 }
 
 void RenderHelper::Start()
 {
+#if 0
   if( mSurface )
   {
     mSurface->StartRender();
   }
+#endif
 }
 
 void RenderHelper::Stop()
 {
+#if 0
   if( mSurface )
   {
     // Tell surface we have stopped rendering
     mSurface->StopRender();
   }
+#endif
 }
 
 void RenderHelper::ConsumeEvents()
@@ -89,6 +96,7 @@ void RenderHelper::ConsumeEvents()
 
 void RenderHelper::InitializeEgl()
 {
+#if 0
   mEGL = mEglFactory->Create();
 
   DALI_ASSERT_ALWAYS( mSurface && "NULL surface" );
@@ -105,10 +113,12 @@ void RenderHelper::InitializeEgl()
 
   // Make it current
   mEGL->MakeContextCurrent();
+#endif
 }
 
 void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
 {
+#if 0
   mSurface->DestroyEglSurface(*mEGL);
 
   // This is designed for replacing pixmap surfaces, but should work for window as well
@@ -124,6 +134,7 @@ void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
   // use the new surface from now on
   mSurface = newSurface;
   mSurfaceReplaced = true;
+#endif
 }
 
 void RenderHelper::ResizeSurface()
@@ -133,6 +144,7 @@ void RenderHelper::ResizeSurface()
 
 void RenderHelper::ShutdownEgl()
 {
+#if 0
   if( mSurface )
   {
     // give a chance to destroy the OpenGL surface that created externally
@@ -143,20 +155,26 @@ void RenderHelper::ShutdownEgl()
 
   // delete the GL context / egl surface
   mEGL->TerminateGles();
+#endif
 }
 
 bool RenderHelper::PreRender()
 {
+  mGraphics.PreRender( 1 );
+#if 0
   if( mSurface )
   {
     mSurface->PreRender( *mEGL, mGLES, mSurfaceResized );
   }
   mGLES.PreRender();
+#endif
   return true;
 }
 
 void RenderHelper::PostRender( bool renderToFbo )
 {
+  mGraphics.PostRender( 1 );
+#if 0
   // Inform the gl implementation that rendering has finished before informing the surface
   mGLES.PostRender();
 
@@ -175,6 +193,7 @@ void RenderHelper::PostRender( bool renderToFbo )
   }
   mSurfaceReplaced = false;
   mSurfaceResized = false;
+#endif
 }
 
 } // namespace Adaptor