Merge "Makes the LTR/RTL alignment of text follow the system language by default...
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-graphics-reflection.h
index 1c9f62b..2147cae 100644 (file)
@@ -17,6 +17,7 @@
  * limitations under the License.
  */
 
+#include <dali/graphics-api/graphics-program-create-info.h>
 #include <dali/graphics-api/graphics-reflection.h>
 #include "test-gl-abstraction.h"
 
@@ -25,26 +26,44 @@ namespace Dali
 class TestGraphicsReflection : public Graphics::Reflection
 {
 public:
-  TestGraphicsReflection(TestGlAbstraction& gl);
-
-  uint32_t                                   GetVertexAttributeLocation(const std::string& name) const override;
-  Dali::Graphics::VertexInputAttributeFormat GetVertexAttributeFormat(uint32_t location) const override;
-  std::string                                GetVertexAttributeName(uint32_t location) const override;
-  std::vector<uint32_t>                      GetVertexAttributeLocations() const override;
-  uint32_t                                   GetUniformBlockCount() const override;
-  uint32_t                                   GetUniformBlockBinding(uint32_t index) const override;
-  uint32_t                                   GetUniformBlockSize(uint32_t index) const override;
-  bool                                       GetUniformBlock(uint32_t index, Dali::Graphics::UniformBlockInfo& out) const override;
-  std::vector<uint32_t>                      GetUniformBlockLocations() const override;
-  std::string                                GetUniformBlockName(uint32_t blockIndex) const override;
-  uint32_t                                   GetUniformBlockMemberCount(uint32_t blockIndex) const override;
-  std::string                                GetUniformBlockMemberName(uint32_t blockIndex, uint32_t memberLocation) const override;
-  uint32_t                                   GetUniformBlockMemberOffset(uint32_t blockIndex, uint32_t memberLocation) const override;
-  bool                                       GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
-  std::vector<Dali::Graphics::UniformInfo>   GetSamplers() const override;
-  Graphics::ShaderLanguage                   GetLanguage() const override;
-
-  TestGlAbstraction& mGl;
+  TestGraphicsReflection(TestGlAbstraction& gl, Property::Array& vertexFormats, const Graphics::ProgramCreateInfo& createInfo, std::vector<UniformData>& customUniforms);
+
+  uint32_t                                        GetVertexAttributeLocation(const std::string& name) const override;
+  Dali::Graphics::VertexInputAttributeFormat      GetVertexAttributeFormat(uint32_t location) const override;
+  std::string                                     GetVertexAttributeName(uint32_t location) const override;
+  std::vector<uint32_t>                           GetVertexAttributeLocations() const override;
+  uint32_t                                        GetUniformBlockCount() const override;
+  uint32_t                                        GetUniformBlockBinding(uint32_t index) const override;
+  uint32_t                                        GetUniformBlockSize(uint32_t index) const override;
+  bool                                            GetUniformBlock(uint32_t index, Dali::Graphics::UniformBlockInfo& out) const override;
+  std::vector<uint32_t>                           GetUniformBlockLocations() const override;
+  std::string                                     GetUniformBlockName(uint32_t blockIndex) const override;
+  uint32_t                                        GetUniformBlockMemberCount(uint32_t blockIndex) const override;
+  std::string                                     GetUniformBlockMemberName(uint32_t blockIndex, uint32_t memberLocation) const override;
+  uint32_t                                        GetUniformBlockMemberOffset(uint32_t blockIndex, uint32_t memberLocation) const override;
+  bool                                            GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
+  const std::vector<Dali::Graphics::UniformInfo>& GetSamplers() const override;
+  Graphics::ShaderLanguage                        GetLanguage() const override;
+
+public: // Test methods
+  void SetAttributes(std::vector<std::string> locations)
+  {
+    mAttributes.clear();
+    mAttributes.resize(locations.size());
+    for(auto& location : locations)
+    {
+      mAttributes.push_back(location);
+    }
+  }
+
+  Dali::Property::Type GetMemberType(int blockIndex, int location) const;
+
+  TestGlAbstraction&               mGl;
+  mutable std::vector<std::string> mAttributes;
+  std::vector<UniformData>         mCustomUniforms;
+
+  Graphics::UniformBlockInfo              mDefaultUniformBlock{}; ///< The emulated UBO containing all the standalone uniforms
+  std::vector<Graphics::UniformBlockInfo> mUniformBlocks{};       ///< List of uniform blocks
 };
 
 } // namespace Dali