Protecting test cases from memory scribbling
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-graphics-controller.h
index 9179a39..14429ef 100644 (file)
@@ -21,6 +21,7 @@
 #include "test-gl-abstraction.h"
 #include "test-gl-context-helper-abstraction.h"
 #include "test-gl-sync-abstraction.h"
+#include "test-graphics-program.h"
 #include "test-graphics-reflection.h"
 
 namespace Dali
@@ -298,6 +299,11 @@ public: // Test Functions
     mVertexFormats = vfs;
   }
 
+  void AddCustomUniforms(std::vector<UniformData>& customUniforms)
+  {
+    mCustomUniforms = customUniforms;
+  }
+
   void ClearSubmitStack()
   {
     mSubmitStack.clear();
@@ -313,7 +319,7 @@ public: // Test Functions
    * @param[out] outData Pointer to output memory
    * @return True on success
    */
-  bool GetProgramParameter(Graphics::Program& program, uint32_t parameterId, void* outData ) override;
+  bool GetProgramParameter(Graphics::Program& program, uint32_t parameterId, void* outData) override;
 
 public:
   mutable TraceCallStack                    mCallStack;
@@ -328,6 +334,15 @@ public:
   bool isDrawOnResumeRequiredResult{true};
 
   Property::Array mVertexFormats;
+
+  struct ProgramCache
+  {
+    std::map<Graphics::PipelineStage, std::vector<uint8_t>> shaders;
+    TestGraphicsProgramImpl* programImpl;
+  };
+  std::vector<ProgramCache> mProgramCache;
+
+  std::vector<UniformData> mCustomUniforms;
 };
 
 } // namespace Dali