X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fgraphics%2Fgles-impl%2Fegl-graphics-controller.h;h=8317fd84aabfa7072ffbe3b2a9f05d49d5caba59;hb=9d6d9f21547fbe420c839e361590eab7f079d04c;hp=5bf2e0d21276f8ed20a4b5584103aad280b8c5ed;hpb=1ff0d7f487ff1b9abd37f2c43b2a2e0a3c229f5a;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 5bf2e0d..8317fd8 100644 --- a/dali/internal/graphics/gles-impl/egl-graphics-controller.h +++ b/dali/internal/graphics/gles-impl/egl-graphics-controller.h @@ -24,10 +24,12 @@ // INTERNAL INCLUDES #include "gles-context.h" #include "gles-graphics-buffer.h" +#include "gles-graphics-command-buffer.h" #include "gles-graphics-pipeline-cache.h" #include "gles-graphics-pipeline.h" #include "gles-graphics-reflection.h" #include "gles-graphics-sampler.h" +#include "gles-graphics-shader.h" #include "gles-graphics-texture.h" #include "gles-graphics-types.h" #include "gles2-graphics-memory.h" @@ -54,7 +56,7 @@ class PipelineCache; * * Temporarily holds the old GL abstractions whilst dali-core is migrated to the new API. */ -DALI_IMPORT_API class EglGraphicsController : public Graphics::Controller +class EglGraphicsController : public Graphics::Controller { public: /** @@ -65,7 +67,7 @@ public: /** * @brief Destructor */ - ~EglGraphicsController() override = default; + ~EglGraphicsController() override; /** * Initialize the GLES abstraction. This can be called from the main thread. @@ -118,6 +120,23 @@ public: } /** + * @copydoc Dali::Graphics::Shutdown() + */ + void Shutdown() override + { + mIsShuttingDown = true; + } + + /** + * @copydoc Dali::Graphics::Destroy() + */ + void Destroy() override + { + // Final flush + Flush(); + } + + /** * @copydoc Dali::Graphics::UpdateTextures() */ void UpdateTextures(const std::vector& updateInfoList, @@ -281,6 +300,10 @@ public: [[nodiscard]] Integration::GlAbstraction* GetGL() const { + if(mIsShuttingDown) + { + return nullptr; + } return mGlAbstraction; } @@ -312,9 +335,9 @@ public: * * @param[in] texture Pointer to the texture */ - void DiscardResource(GLES::Buffer* texture) + void DiscardResource(GLES::Buffer* buffer) { - mDiscardBufferQueue.push(texture); + mDiscardBufferQueue.push(buffer); } /** @@ -330,6 +353,42 @@ public: } /** + * @brief Pushes Shader to the discard queue + * + * Function is called from the UniquePtr custom deleter. + * + * @param[in] program Pointer to the Shader + */ + void DiscardResource(GLES::Shader* shader) + { + mDiscardShaderQueue.push(shader); + } + + /** + * @brief Pushes CommandBuffer to the discard queue + * + * Function is called from the UniquePtr custom deleter. + * + * @param[in] program Pointer to the CommandBuffer + */ + void DiscardResource(GLES::CommandBuffer* commandBuffer) + { + mDiscardCommandBufferQueue.push(commandBuffer); + } + + /** + * @brief Pushes Sampler to the discard queue + * + * Function is called from the UniquePtr custom deleter. + * + * @param[in] program Pointer to the Sampler + */ + void DiscardResource(GLES::Sampler* sampler) + { + mDiscardSamplerQueue.push(sampler); + } + + /** * @brief Pushes Pipeline to the discard queue * * Function is called from the UniquePtr custom deleter. @@ -472,6 +531,11 @@ public: return GLES::GLESVersion::GLES_20; } + bool IsShuttingDown() const + { + return mIsShuttingDown; + } + private: Integration::GlAbstraction* mGlAbstraction{nullptr}; Integration::GlSyncAbstraction* mGlSyncAbstraction{nullptr}; @@ -483,9 +547,11 @@ private: std::queue mCreateBufferQueue; ///< Create queue for buffer resource std::queue mDiscardBufferQueue; ///< Discard queue for buffer resource - std::queue mDiscardProgramQueue; ///< Discard queue for program resource - - std::queue mDiscardPipelineQueue; ///< Discard queue of pipelines + std::queue mDiscardProgramQueue; ///< Discard queue for program resource + std::queue mDiscardPipelineQueue; ///< Discard queue of pipelines + std::queue mDiscardShaderQueue; ///< Discard queue of shaders + std::queue mDiscardSamplerQueue; ///< Discard queue of samplers + std::queue mDiscardCommandBufferQueue; ///< Discard queue of command buffers std::queue mCommandQueue; ///< we may have more in the future @@ -495,6 +561,8 @@ private: std::unique_ptr mContext{nullptr}; ///< Context object handling command buffers execution std::unique_ptr mPipelineCache{nullptr}; ///< Internal pipeline cache + + bool mIsShuttingDown{false}; ///< Indicates whether the controller is shutting down }; } // namespace Graphics