// 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"
*
* 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:
/**
/**
* @brief Destructor
*/
- ~EglGraphicsController() override = default;
+ ~EglGraphicsController() override;
/**
* Initialize the GLES abstraction. This can be called from the main thread.
}
/**
+ * @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<TextureUpdateInfo>& updateInfoList,
[[nodiscard]] Integration::GlAbstraction* GetGL() const
{
+ if(mIsShuttingDown)
+ {
+ return nullptr;
+ }
return mGlAbstraction;
}
*
* @param[in] texture Pointer to the texture
*/
- void DiscardResource(GLES::Buffer* texture)
+ void DiscardResource(GLES::Buffer* buffer)
{
- mDiscardBufferQueue.push(texture);
+ mDiscardBufferQueue.push(buffer);
}
/**
}
/**
+ * @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.
return GLES::GLESVersion::GLES_20;
}
+ bool IsShuttingDown() const
+ {
+ return mIsShuttingDown;
+ }
+
private:
Integration::GlAbstraction* mGlAbstraction{nullptr};
Integration::GlSyncAbstraction* mGlSyncAbstraction{nullptr};
std::queue<GLES::Buffer*> mCreateBufferQueue; ///< Create queue for buffer resource
std::queue<GLES::Buffer*> mDiscardBufferQueue; ///< Discard queue for buffer resource
- std::queue<GLES::Program*> mDiscardProgramQueue; ///< Discard queue for program resource
-
- std::queue<GLES::Pipeline*> mDiscardPipelineQueue; ///< Discard queue of pipelines
+ std::queue<GLES::Program*> mDiscardProgramQueue; ///< Discard queue for program resource
+ std::queue<GLES::Pipeline*> mDiscardPipelineQueue; ///< Discard queue of pipelines
+ std::queue<GLES::Shader*> mDiscardShaderQueue; ///< Discard queue of shaders
+ std::queue<GLES::Sampler*> mDiscardSamplerQueue; ///< Discard queue of samplers
+ std::queue<GLES::CommandBuffer*> mDiscardCommandBufferQueue; ///< Discard queue of command buffers
std::queue<GLES::CommandBuffer*> mCommandQueue; ///< we may have more in the future
std::unique_ptr<GLES::Context> mContext{nullptr}; ///< Context object handling command buffers execution
std::unique_ptr<GLES::PipelineCache> mPipelineCache{nullptr}; ///< Internal pipeline cache
+
+ bool mIsShuttingDown{false}; ///< Indicates whether the controller is shutting down
};
} // namespace Graphics