Add Post Constraint that works after transform
[platform/core/uifw/dali-core.git] / dali / graphics-api / graphics-controller.h
index 3f758f0..bba245a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_CONTROLLER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
 #include "graphics-framebuffer-create-info.h"
 #include "graphics-memory.h"
 #include "graphics-pipeline-create-info.h"
+#include "graphics-program-create-info.h"
+#include "graphics-reflection.h"
 #include "graphics-render-pass-create-info.h"
 #include "graphics-render-target-create-info.h"
 #include "graphics-sampler-create-info.h"
 #include "graphics-shader-create-info.h"
+#include "graphics-sync-object-create-info.h"
 #include "graphics-texture-create-info.h"
 
 namespace Dali
@@ -39,23 +42,23 @@ namespace Dali
 namespace Integration
 {
 class GlAbstraction;
-class GlSyncAbstraction;
 class GlContextHelperAbstraction;
 } // namespace Integration
 
 namespace Graphics
 {
-class CommandBuffer;
 class Command;
-class RenderTarget;
-class RenderPass;
+class CommandBuffer;
 class Buffer;
-class Texture;
-class Shader;
 class Framebuffer;
+class Memory;
 class Pipeline;
+class RenderPass;
+class RenderTarget;
 class Sampler;
-class Memory;
+class Shader;
+class SyncObject;
+class Texture;
 
 /**
  * @brief Controller class controls render loop
@@ -68,7 +71,6 @@ class Controller
 public:
   // Temporary until graphics api is complete
   virtual Integration::GlAbstraction&              GetGlAbstraction()              = 0;
-  virtual Integration::GlSyncAbstraction&          GetGlSyncAbstraction()          = 0;
   virtual Integration::GlContextHelperAbstraction& GetGlContextHelperAbstraction() = 0;
 
   /**
@@ -108,6 +110,16 @@ public:
   virtual void Resume() = 0;
 
   /**
+   * @brief Lifecycle shutdown event
+   */
+  virtual void Shutdown() = 0;
+
+  /**
+   * @brief Lifecycle destroy event
+   */
+  virtual void Destroy() = 0;
+
+  /**
    * @brief Executes batch update of textures
    *
    * This function may perform full or partial update of many textures.
@@ -124,6 +136,12 @@ public:
                               const std::vector<TextureUpdateSourceInfo>& sourceList) = 0;
 
   /**
+   * Auto generates mipmaps for the texture
+   * @param[in] texture The texture
+   */
+  virtual void GenerateTextureMipmaps(const Texture& texture) = 0;
+
+  /**
    * @brief Enables depth/stencil buffer
    *
    * @param[in] enableDepth True to enable depth
@@ -219,6 +237,16 @@ public:
    * @return pointer to the Pipeline object
    */
   virtual UniquePtr<Pipeline> CreatePipeline(const PipelineCreateInfo& pipelineCreateInfo, UniquePtr<Pipeline>&& oldPipeline) = 0;
+
+  /**
+   * @brief Creates new Program object
+   *
+   * @param[in] ProgramCreateInfo The valid ProgramCreateInfo structure
+   * @param[in] oldProgram The valid pointer to the old object or nullptr. The object will be reused or destroyed.
+   * @return pointer to the Program object
+   */
+  virtual UniquePtr<Program> CreateProgram(const ProgramCreateInfo& programCreateInfo, UniquePtr<Program>&& oldProgram) = 0;
+
   /**
    * @brief Creates new Shader object
    *
@@ -247,6 +275,16 @@ public:
   virtual UniquePtr<RenderTarget> CreateRenderTarget(const RenderTargetCreateInfo& renderTargetCreateInfo, UniquePtr<RenderTarget>&& oldRenderTarget) = 0;
 
   /**
+   * Create a synchronisation object.
+   *
+   * @return A pointer to an opaque sync object
+   * @param[in] syncObjectCreateInfo The valid SyncObjectCreateInfo structure
+   * @param[in] oldSyncObject The valid pointer to the old object or nullptr. The object will be reused or destroyed.
+   */
+  virtual UniquePtr<SyncObject> CreateSyncObject(const SyncObjectCreateInfo& syncObjectCreateInfo,
+                                                 UniquePtr<SyncObject>&&     oldSyncObject) = 0;
+
+  /**
    * @brief Maps memory associated with Buffer object
    *
    * @param[in] mapInfo Filled details of mapped resource
@@ -311,7 +349,15 @@ public:
    *
    * @return Returns the TextureProperties object
    */
-  virtual const TextureProperties& GetTextureProperties(const Texture& texture) = 0;
+  virtual TextureProperties GetTextureProperties(const Texture& texture) = 0;
+
+  /**
+   * @brief Returns the reflection of the given program
+   *
+   * @param[in] program The program
+   * @return The reflection of the program
+   */
+  virtual const Reflection& GetProgramReflection(const Program& program) = 0;
 
   /**
    * @brief Tests whether two Pipelines are the same.
@@ -322,6 +368,18 @@ public:
    */
   virtual bool PipelineEquals(const Pipeline& pipeline0, const Pipeline& pipeline1) const = 0;
 
+  /**
+   * @brief Retrieves program parameters
+   *
+   * This function can be used to retrieve data from internal implementation
+   *
+   * @param[in] program Valid program object
+   * @param[in] parameterId Integer parameter id
+   * @param[out] outData Pointer to output memory
+   * @return True on success
+   */
+  virtual bool GetProgramParameter(Graphics::Program& program, uint32_t parameterId, void* outData) = 0;
+
 protected:
   /**
    * Creates controller