From 507d2a49b0e846cbcefd934fffa32ec4a52a0b74 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Mon, 26 Sep 2022 13:56:40 +0900 Subject: [PATCH] Revert "[Tizen] Do not call gl functions during shutdown" This reverts commit 2dd1b08f4a2c0e8acd2d083aa0318cf152a7c8ec. Change-Id: Id8654f718de8fe5cd4870712c2dc3fd9b2f8cb44 --- .../graphics/gles-impl/egl-graphics-controller.h | 63 ++++++---------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller.h b/dali/internal/graphics/gles-impl/egl-graphics-controller.h index 4999c9d..fd944d3 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller.h +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller.h @@ -136,16 +136,6 @@ public: // Final flush Flush(); - ClearTextureUpdateQueue(); - - // Remove all create queue and command queue. - // Note that all memory are already deallocated at Final flush. - mCreateTextureQueue = {}; - mCreateBufferQueue = {}; - mCreateFramebufferQueue = {}; - mTextureMipmapGenerationRequests = {}; - mCommandQueue = {}; - if(mContext) { mContext->GlContextDestroyed(); @@ -474,26 +464,6 @@ public: } /** - * @brief Clears the texture update queue - */ - void ClearTextureUpdateQueue() - { - // Remove remained CPU-allocated texture memory - while(!mTextureUpdateRequests.empty()) - { - auto& request = mTextureUpdateRequests.front(); - auto& source = request.second; - - if(source.sourceType == Graphics::TextureUpdateSourceInfo::Type::MEMORY) - { - // free staging memory - free(source.memorySource.memory); - } - mTextureUpdateRequests.pop(); - } - } - - /** * @brief Flushes all pending updates * * Function flushes all pending resource constructions, @@ -501,29 +471,26 @@ public: */ void Flush() { - if(DALI_LIKELY(!mIsShuttingDown)) + if(!mCreateTextureQueue.empty() || + !mCreateBufferQueue.empty() || + !mCreateFramebufferQueue.empty() || + !mTextureUpdateRequests.empty() || + !mTextureMipmapGenerationRequests.empty()) { - if(!mCreateTextureQueue.empty() || - !mCreateBufferQueue.empty() || - !mCreateFramebufferQueue.empty() || - !mTextureUpdateRequests.empty() || - !mTextureMipmapGenerationRequests.empty()) - { - mGraphics->ActivateResourceContext(); - } + mGraphics->ActivateResourceContext(); + } - // Process creations - ProcessCreateQueues(); + // Process creations + ProcessCreateQueues(); - // Process updates - ProcessTextureUpdateQueue(); + // Process updates + ProcessTextureUpdateQueue(); - // Process texture mipmap generation requests - ProcessTextureMipmapGenerationQueue(); + // Process texture mipmap generation requests + ProcessTextureMipmapGenerationQueue(); - // Process main command queue - ProcessCommandQueues(); - } + // Process main command queue + ProcessCommandQueues(); // Reset texture cache in the contexts while destroying textures ResetTextureCache(); -- 2.7.4