/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali::Graphics::GLES
{
-
RenderTarget::RenderTarget(const Graphics::RenderTargetCreateInfo& createInfo, Graphics::EglGraphicsController& controller)
: RenderTargetResource(createInfo, controller)
{
void RenderTarget::DestroyResource()
{
- // This is a proper destructor
- if(mCreateInfo.surface)
- {
- mController.DeleteSurfaceContext(static_cast<Dali::RenderSurfaceInterface*>(mCreateInfo.surface));
- }
}
void RenderTarget::DiscardResource()
{
mController.DiscardResource(this);
+
+ // The surface context should be deleted now
+ if(mCreateInfo.surface)
+ {
+ mController.DeleteSurfaceContext(static_cast<Dali::RenderSurfaceInterface*>(mCreateInfo.surface));
+ mCreateInfo.surface = nullptr;
+ }
}
GLES::Framebuffer* RenderTarget::GetFramebuffer() const
return mCreateInfo.surface;
}
-} // namespace Dali::Graphics::GLES
\ No newline at end of file
+} // namespace Dali::Graphics::GLES