+ // Initialize EGL & OpenGL
+ Dali::DisplayConnection& displayConnection = mAdaptorInterfaces.GetDisplayConnectionInterface();
+ displayConnection.Initialize();
+
+ // EGL has been initialised at this point
+ NotifyGraphicsInitialised();
+
+ RenderSurfaceInterface* currentSurface = nullptr;
+
+ GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface();
+ EglGraphics* eglGraphics = static_cast<EglGraphics *>(&graphics);
+
+ // This will only be created once
+ EglInterface* eglInterface = &eglGraphics->GetEglInterface();
+
+ Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( *eglInterface );
+
+ // Try to use OpenGL es 3.0
+ // ChooseConfig returns false here when the device only support gles 2.0.
+ // Because eglChooseConfig with gles 3.0 setting fails when the device only support gles 2.0 and Our default setting is gles 3.0.
+ if( !eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ) )
+ {
+ // Retry to use OpenGL es 2.0
+ eglGraphics->SetGlesVersion( 20 );
+ eglImpl.ChooseConfig( true, COLOR_DEPTH_32 );
+ }
+
+ // Check whether surfaceless context is supported
+ bool isSurfacelessContextSupported = eglImpl.IsSurfacelessContextSupported();
+ eglGraphics->SetIsSurfacelessContextSupported( isSurfacelessContextSupported );
+
+ if ( isSurfacelessContextSupported )