[Tizen] Revert "[Tizen] Fix RenderTarget and RenderPass doesn't destroy issue" 94/268194/1 accepted/tizen/6.5/unified/20211217.121959 submit/tizen_6.5/20211217.020153
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 17 Dec 2021 01:59:57 +0000 (10:59 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 17 Dec 2021 02:00:32 +0000 (11:00 +0900)
This reverts commit e18e26d65df2c3db5c5d090682286970864a557d.

Change-Id: Id50662afffe2ff0964dcd1ec46c0f805ec662e6e

dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.h
dali/internal/graphics/gles-impl/gles-graphics-render-pass.cpp
dali/internal/graphics/gles-impl/gles-graphics-render-pass.h
dali/internal/graphics/gles-impl/gles-graphics-render-target.cpp
dali/internal/graphics/gles-impl/gles-graphics-render-target.h
dali/internal/graphics/gles-impl/gles-graphics-shader.h
dali/internal/graphics/gles-impl/gles-graphics-texture.h

index bee69ec..eec74af 100644 (file)
@@ -347,12 +347,6 @@ void EglGraphicsController::ProcessDiscardQueues()
   // Process Framebuffers
   ProcessDiscardQueue<GLES::Framebuffer>(mDiscardFramebufferQueue);
 
-  // Process RenderPass
-  ProcessDiscardQueue<GLES::RenderPass>(mDiscardRenderPassQueue);
-
-  // Process RenderTarget
-  ProcessDiscardQueue<GLES::RenderTarget>(mDiscardRenderTargetQueue);
-
   // Process pipelines
   ProcessDiscardQueue(mDiscardPipelineQueue);
 
index 6af7383..a792eea 100644 (file)
@@ -392,30 +392,6 @@ public:
   }
 
   /**
-   * @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.
@@ -771,8 +747,6 @@ private:
 
   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
index 554bfe4..bb5d680 100644 (file)
@@ -18,9 +18,6 @@
 // CLASS HEADER
 #include "gles-graphics-render-pass.h"
 
-// INTERNAL INCLUDES
-#include "egl-graphics-controller.h"
-
 namespace Dali::Graphics::GLES
 {
 struct RenderPass::Impl
@@ -28,7 +25,7 @@ struct RenderPass::Impl
   Impl()  = default;
   ~Impl() = default;
 
-  std::vector<AttachmentDescription> attachments{};
+  std::vector<AttachmentDescription> attachments;
 };
 
 RenderPass::RenderPass(const Graphics::RenderPassCreateInfo& createInfo, Graphics::EglGraphicsController& controller)
@@ -44,11 +41,4 @@ RenderPass::RenderPass(const Graphics::RenderPassCreateInfo& createInfo, Graphic
   }
 }
 
-RenderPass::~RenderPass() = default;
-
-void RenderPass::DiscardResource()
-{
-  mController.DiscardResource(this);
-}
-
 } // namespace Dali::Graphics::GLES
index 0281a66..1186f61 100644 (file)
@@ -42,14 +42,14 @@ public:
   /**
    * @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
   }
 
   /**
@@ -59,14 +59,17 @@ public:
    */
   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;
index 8cfd3f1..efdaeb2 100644 (file)
 
 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);
index 2169e62..6a9fcab 100644 (file)
@@ -48,7 +48,10 @@ public:
   /**
    * @brief Called when GL resources are destroyed
    */
-  void DestroyResource() override;
+  void DestroyResource() override
+  {
+    // TODO: Implement destroying the resource
+  }
 
   /**
    * @brief Called when initializing the resource
@@ -57,14 +60,17 @@ public:
    */
   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
@@ -75,6 +81,10 @@ public:
    * @brief Returns surface associated with the render target
    */
   Surface* GetSurface() const;
+
+private:
+  struct Impl;
+  std::unique_ptr<Impl> mImpl{nullptr};
 };
 
 } // namespace Dali::Graphics::GLES
index 180a14b..3b2abb8 100644 (file)
@@ -77,7 +77,7 @@ public:
 
 private:
   struct Impl;
-  std::unique_ptr<Impl> mImpl{nullptr};
+  std::unique_ptr<Impl> mImpl;
 };
 
 } // namespace Dali::Graphics::GLES
index ee7b1c2..2ae566f 100644 (file)
@@ -160,7 +160,7 @@ private:
     uint32_t maxLevel{0};
   } mDefaultSamplerState;
 
-  std::vector<char> mStagingBuffer{};
+  std::vector<char> mStagingBuffer;
   uint32_t          mTextureId{0u};
   GLenum            mGlTarget{0u};
   uint32_t          mMaxMipMapLevel{0u};