From: Heeyong Song Date: Wed, 13 May 2020 08:05:56 +0000 (+0900) Subject: Delete EglGraphics and shutdown EGL X-Git-Tag: dali_1.5.12^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F233744%2F2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor-legacy.git Delete EglGraphics and shutdown EGL Change-Id: Iaaa267481aad15172f8e9e26fd9cc85384dfbb83 --- diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 132e82e..1b56e54 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -159,10 +159,11 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: 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( 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( graphics ); // This will only be created once eglGraphics->Create(); @@ -710,7 +711,7 @@ Dali::DisplayConnection& Adaptor::GetDisplayConnectionInterface() GraphicsInterface& Adaptor::GetGraphicsInterface() { DALI_ASSERT_DEBUG( mGraphics && "Graphics interface not created" ); - return *mGraphics; + return *( mGraphics.get() ); } Dali::Integration::PlatformAbstraction& Adaptor::GetPlatformAbstractionInterface() @@ -801,7 +802,8 @@ Any Adaptor::GetGraphicsDisplay() if (mGraphics) { - auto eglGraphics = static_cast( 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( graphics ); EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); display = eglImpl.GetDisplay(); diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index d0d2379..9e4c079 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -664,7 +664,7 @@ private: // Data 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 diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 7343b43..5c5840a 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -794,7 +794,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } - // Inform core of context destruction & shutdown EGL + // Inform core of context destruction mCore.ContextDestroyed(); currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface(); if( currentSurface ) @@ -803,6 +803,9 @@ void CombinedUpdateRenderController::UpdateRenderThread() currentSurface = nullptr; } + // Shutdown EGL + eglInterface->TerminateGles(); + LOG_UPDATE_RENDER( "THREAD DESTROYED" ); // Uninstall the logging function diff --git a/dali/internal/graphics/common/graphics-interface.h b/dali/internal/graphics/common/graphics-interface.h index 5e80ef7..93c1b2f 100644 --- a/dali/internal/graphics/common/graphics-interface.h +++ b/dali/internal/graphics/common/graphics-interface.h @@ -48,6 +48,11 @@ public: }; /** + * Destructor + */ + virtual ~GraphicsInterface() {} + + /** * Initialize the graphics interface * @param[in] environmentOptions The environment options. */ @@ -76,12 +81,6 @@ public: return mStencilBufferRequired; }; -protected: - /** - * Virtual protected destructor - no deletion through this interface - */ - virtual ~GraphicsInterface() {}; - protected: