DALI_ASSERT_DEBUG( defaultWindow->GetSurface() && "Surface not initialized" );
- mGraphics = &( graphicsFactory.Create() );
+ mGraphics = std::unique_ptr< GraphicsInterface >( &graphicsFactory.Create() );
mGraphics->Initialize( mEnvironmentOptions );
- auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+ GraphicsInterface* graphics = mGraphics.get(); // This interface is temporary until Core has been updated to match
+ auto eglGraphics = static_cast<EglGraphics *>( graphics );
// This will only be created once
eglGraphics->Create();
GraphicsInterface& Adaptor::GetGraphicsInterface()
{
DALI_ASSERT_DEBUG( mGraphics && "Graphics interface not created" );
- return *mGraphics;
+ return *( mGraphics.get() );
}
Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface()
if (mGraphics)
{
- auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
+ GraphicsInterface* graphics = mGraphics.get(); // This interface is temporary until Core has been updated to match
+ auto eglGraphics = static_cast<EglGraphics *>( graphics );
EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
display = eglImpl.GetDisplay();
Dali::Integration::Core* mCore; ///< Dali Core
ThreadController* mThreadController; ///< Controls the threads
- GraphicsInterface* mGraphics; ///< Graphics interface
+ std::unique_ptr< GraphicsInterface > mGraphics; ///< Graphics interface
Dali::DisplayConnection* mDisplayConnection; ///< Display connection
WindowContainer mWindows; ///< A container of all the Windows that are currently created
}
}
- // Inform core of context destruction & shutdown EGL
+ // Inform core of context destruction
mCore.ContextDestroyed();
currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
if( currentSurface )
currentSurface = nullptr;
}
+ // Shutdown EGL
+ eglInterface->TerminateGles();
+
LOG_UPDATE_RENDER( "THREAD DESTROYED" );
// Uninstall the logging function
{
};
+ /**
+ * Destructor
+ */
+ virtual ~GraphicsInterface() {}
+
/**
* Initialize the graphics interface
* @param[in] environmentOptions The environment options.
return mStencilBufferRequired;
};
-protected:
- /**
- * Virtual protected destructor - no deletion through this interface
- */
- virtual ~GraphicsInterface() {};
-
protected: