[Tizen] Change GetTextureProperties
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles-impl / egl-graphics-controller.h
index fd944d3..b89fa31 100644 (file)
@@ -35,6 +35,8 @@
 #include <dali/internal/graphics/gles-impl/gles-graphics-shader.h>
 #include <dali/internal/graphics/gles-impl/gles-graphics-texture.h>
 #include <dali/internal/graphics/gles-impl/gles-graphics-types.h>
+#include <dali/internal/graphics/gles-impl/gles-sync-pool.h>
+#include <dali/internal/graphics/gles-impl/gles-texture-dependency-checker.h>
 #include <dali/internal/graphics/gles-impl/gles2-graphics-memory.h>
 
 namespace Dali
@@ -51,6 +53,8 @@ namespace GLES
 {
 class CommandBuffer;
 class PipelineCache;
+class SyncPool;
+class TextureDependencyChecker;
 } // namespace GLES
 
 /**
@@ -62,9 +66,9 @@ class EglGraphicsController : public Graphics::Controller
 {
 public:
   /**
-   * @brief Deault constructor
+   * @brief Constructor
    */
-  EglGraphicsController() = default;
+  EglGraphicsController();
 
   /**
    * @brief Destructor
@@ -126,13 +130,7 @@ public:
   void Shutdown() override
   {
     mIsShuttingDown = true;
-  }
 
-  /**
-   * @copydoc Dali::Graphics::Destroy()
-   */
-  void Destroy() override
-  {
     // Final flush
     Flush();
 
@@ -151,6 +149,13 @@ public:
   }
 
   /**
+   * @copydoc Dali::Graphics::Destroy()
+   */
+  void Destroy() override
+  {
+  }
+
+  /**
    * @copydoc Dali::Graphics::UpdateTextures()
    */
   void UpdateTextures(const std::vector<TextureUpdateInfo>&       updateInfoList,
@@ -293,17 +298,11 @@ public:
   /**
    * @copydoc Dali::Graphics::GetTextureProperties()
    */
-  const TextureProperties& GetTextureProperties(const Texture& texture) override
-  {
-    // for compiler not to moan
-    static TextureProperties dummy{};
-    return dummy;
-  }
+  TextureProperties GetTextureProperties(const Texture& texture) override;
 
   /**
    * @copydoc Dali::Graphics::Controller::GetPipelineReflection()
    */
-
   [[nodiscard]] const Reflection& GetProgramReflection(const Graphics::Program& program) override;
 
   /**
@@ -721,6 +720,11 @@ public:
   void ResolvePresentRenderTarget(GLES::RenderTarget* renderTarget);
 
   /**
+   * Invoked after all rendering has finished. Used to clean up sync resources
+   */
+  void PostRender();
+
+  /**
    * Creates a GLES context for the given render surface
    *
    * @param[in] surface The surface whose GLES context to be created.
@@ -766,6 +770,11 @@ public:
     return mSharedContext;
   }
 
+  GLES::SyncPool& GetSyncPool()
+  {
+    return mSyncPool;
+  }
+
 private:
   Integration::GlAbstraction*              mGlAbstraction{nullptr};
   Integration::GlContextHelperAbstraction* mGlContextHelperAbstraction{nullptr};
@@ -811,6 +820,9 @@ private:
   std::queue<const GLES::CommandBuffer*> mPresentationCommandBuffers{}; ///< Queue of reusable command buffers used by presentation engine
 
   void* mSharedContext{nullptr}; ///< Shared EGL context
+
+  GLES::TextureDependencyChecker mTextureDependencyChecker; // Checks if FBO textures need syncing
+  GLES::SyncPool                 mSyncPool;
 };
 
 } // namespace Graphics