X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles-impl%2Fegl-graphics-controller.h;h=6c316b02f6eee7bfba288f38e7fb355f19e8ef62;hb=806a9fe4f62159bf09fb1c1b78bbec211af879de;hp=a792eeaa70fdbfdde6d2c324efb9327c2920cbc2;hpb=17bf836806d3ae9365002d8d1d4bc281a3e0bc9d;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/graphics/gles-impl/egl-graphics-controller.h b/dali/internal/graphics/gles-impl/egl-graphics-controller.h index a792eea..6c316b0 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller.h +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller.h @@ -136,6 +136,16 @@ 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(); @@ -440,6 +450,26 @@ 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, @@ -447,26 +477,29 @@ public: */ void Flush() { - if(!mCreateTextureQueue.empty() || - !mCreateBufferQueue.empty() || - !mCreateFramebufferQueue.empty() || - !mTextureUpdateRequests.empty() || - !mTextureMipmapGenerationRequests.empty()) + if(DALI_LIKELY(!mIsShuttingDown)) { - mGraphics->ActivateResourceContext(); - } + if(!mCreateTextureQueue.empty() || + !mCreateBufferQueue.empty() || + !mCreateFramebufferQueue.empty() || + !mTextureUpdateRequests.empty() || + !mTextureMipmapGenerationRequests.empty()) + { + 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();