// Process Framebuffers
ProcessDiscardQueue<GLES::Framebuffer>(mDiscardFramebufferQueue);
- // Process RenderPass
- ProcessDiscardQueue<GLES::RenderPass>(mDiscardRenderPassQueue);
-
- // Process RenderTarget
- ProcessDiscardQueue<GLES::RenderTarget>(mDiscardRenderTargetQueue);
-
// Process pipelines
ProcessDiscardQueue(mDiscardPipelineQueue);
}
/**
- * @brief Pushes RenderPass to the discard queue
- *
- * Function is called from the UniquePtr custom deleter.
- *
- * @param[in] program Pointer to the RenderPass
- */
- void DiscardResource(GLES::RenderPass* renderPass)
- {
- mDiscardRenderPassQueue.push(renderPass);
- }
-
- /**
- * @brief Pushes RenderTarget to the discard queue
- *
- * Function is called from the UniquePtr custom deleter.
- *
- * @param[in] program Pointer to the RenderTarget
- */
- void DiscardResource(GLES::RenderTarget* renderTarget)
- {
- mDiscardRenderTargetQueue.push(renderTarget);
- }
-
- /**
* @brief Pushes Shader to the discard queue
*
* Function is called from the UniquePtr custom deleter.
std::queue<GLES::Program*> mDiscardProgramQueue; ///< Discard queue for program resource
std::queue<GLES::Pipeline*> mDiscardPipelineQueue; ///< Discard queue of pipelines
- std::queue<GLES::RenderPass*> mDiscardRenderPassQueue; ///< Discard queue for renderpass resource
- std::queue<GLES::RenderTarget*> mDiscardRenderTargetQueue; ///< Discard queue for rendertarget resource
std::queue<GLES::Shader*> mDiscardShaderQueue; ///< Discard queue of shaders
std::queue<GLES::Sampler*> mDiscardSamplerQueue; ///< Discard queue of samplers
std::queue<const GLES::CommandBuffer*> mDiscardCommandBufferQueue; ///< Discard queue of command buffers
// CLASS HEADER
#include "gles-graphics-render-pass.h"
-// INTERNAL INCLUDES
-#include "egl-graphics-controller.h"
-
namespace Dali::Graphics::GLES
{
struct RenderPass::Impl
Impl() = default;
~Impl() = default;
- std::vector<AttachmentDescription> attachments{};
+ std::vector<AttachmentDescription> attachments;
};
RenderPass::RenderPass(const Graphics::RenderPassCreateInfo& createInfo, Graphics::EglGraphicsController& controller)
}
}
-RenderPass::~RenderPass() = default;
-
-void RenderPass::DiscardResource()
-{
- mController.DiscardResource(this);
-}
-
} // namespace Dali::Graphics::GLES
/**
* @brief Destructor
*/
- ~RenderPass() override;
+ ~RenderPass() override = default;
/**
* @brief Called when GL resources are destroyed
*/
void DestroyResource() override
{
- // There is no graphic resource here. do nothing.
+ // TODO: Implement destroying the resource
}
/**
*/
bool InitializeResource() override
{
- // There is no graphic resource here. return true.
- return true;
+ // TODO: Implement initializing resource
+ return {};
}
/**
* @brief Called when UniquePtr<> on client-side dies
*/
- void DiscardResource() override;
+ void DiscardResource() override
+ {
+ // TODO: Implement moving to the discard queue
+ }
private:
struct Impl;
namespace Dali::Graphics::GLES
{
+struct RenderTarget::Impl
+{
+ Impl(EglGraphicsController& controller)
+ : controller(controller){};
+
+ ~Impl() = default;
+
+ EglGraphicsController& controller;
+};
RenderTarget::RenderTarget(const Graphics::RenderTargetCreateInfo& createInfo, Graphics::EglGraphicsController& controller)
: RenderTargetResource(createInfo, controller)
{
+ mImpl = std::make_unique<Impl>(controller);
+
if(createInfo.surface)
{
controller.CreateSurfaceContext(static_cast<Dali::RenderSurfaceInterface*>(createInfo.surface));
}
}
-RenderTarget::~RenderTarget() = default;
-
-void RenderTarget::DestroyResource()
+RenderTarget::~RenderTarget()
{
- // This is a proper destructor
if(mCreateInfo.surface)
{
- mController.DeleteSurfaceContext(static_cast<Dali::RenderSurfaceInterface*>(mCreateInfo.surface));
+ mImpl->controller.DeleteSurfaceContext(static_cast<Dali::RenderSurfaceInterface*>(mCreateInfo.surface));
}
}
-void RenderTarget::DiscardResource()
-{
- mController.DiscardResource(this);
-}
-
GLES::Framebuffer* RenderTarget::GetFramebuffer() const
{
return static_cast<GLES::Framebuffer*>(mCreateInfo.framebuffer);
/**
* @brief Called when GL resources are destroyed
*/
- void DestroyResource() override;
+ void DestroyResource() override
+ {
+ // TODO: Implement destroying the resource
+ }
/**
* @brief Called when initializing the resource
*/
bool InitializeResource() override
{
- // There is no graphic resource here. return true.
- return true;
+ // TODO: Implement initializing resource
+ return {};
}
/**
* @brief Called when UniquePtr<> on client-side dies
*/
- void DiscardResource() override;
+ void DiscardResource() override
+ {
+ // TODO: Implement moving to the discard queue
+ }
/**
* @brief Returns framebuffer associated with the render target
* @brief Returns surface associated with the render target
*/
Surface* GetSurface() const;
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> mImpl{nullptr};
};
} // namespace Dali::Graphics::GLES
private:
struct Impl;
- std::unique_ptr<Impl> mImpl{nullptr};
+ std::unique_ptr<Impl> mImpl;
};
} // namespace Dali::Graphics::GLES
uint32_t maxLevel{0};
} mDefaultSamplerState;
- std::vector<char> mStagingBuffer{};
+ std::vector<char> mStagingBuffer;
uint32_t mTextureId{0u};
GLenum mGlTarget{0u};
uint32_t mMaxMipMapLevel{0u};