[Tizen] Do not call gl functions during shutdown
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles-impl / gles-graphics-shader.h
index ece9c89..180a14b 100644 (file)
@@ -37,23 +37,17 @@ public:
    * @param[in] createInfo Valid createInfo structure
    * @param[in] controller Reference to the controller
    */
-  Shader(const Graphics::ShaderCreateInfo& createInfo, Graphics::EglGraphicsController& controller)
-  : ShaderResource(createInfo, controller)
-  {
-  }
+  Shader(const Graphics::ShaderCreateInfo& createInfo, Graphics::EglGraphicsController& controller);
 
   /**
    * @brief Destructor
    */
-  ~Shader() override = default;
+  ~Shader() override;
 
   /**
    * @brief Called when GL resources are destroyed
    */
-  void DestroyResource() override
-  {
-    // TODO: Implement destroying the resource
-  }
+  void DestroyResource() override;
 
   /**
    * @brief Called when initializing the resource
@@ -62,35 +56,28 @@ public:
    */
   bool InitializeResource() override
   {
-    // TODO: Implement initializing resource
-    return {};
+    // The Shader has instant initialization, hence no need to initialize GL resource
+    // here
+    return true;
   }
 
   /**
    * @brief Compiles shader
-   * @return
+   *
+   * @return True on success
    */
-  bool Compile() const
-  {
-    mGlShader = 0;
-    return true;
-  }
+  [[nodiscard]] bool Compile() const;
 
   /**
    * @brief Called when UniquePtr<> on client-side dies
    */
-  void DiscardResource() override
-  {
-    // TODO: Implement moving to the discard queue
-  }
+  void DiscardResource() override;
 
-  uint32_t GetGLShader() const
-  {
-    return mGlShader;
-  }
+  uint32_t GetGLShader() const;
 
 private:
-  mutable uint32_t mGlShader;
+  struct Impl;
+  std::unique_ptr<Impl> mImpl{nullptr};
 };
 
 } // namespace Dali::Graphics::GLES