Syncing test harness 50/257250/1
authorDavid Steele <david.steele@samsung.com>
Wed, 21 Apr 2021 17:03:00 +0000 (18:03 +0100)
committerDavid Steele <david.steele@samsung.com>
Wed, 21 Apr 2021 17:03:00 +0000 (18:03 +0100)
Change-Id: Ib1277c48ae7fc8e72a2f78cf780d9bbeb3fed4f1

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-command-buffer.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-command-buffer.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.h

index 78c6fbb..e34b852 100644 (file)
@@ -60,9 +60,9 @@ void TestGraphicsCommandBuffer::GetStateForDrawCall(int drawCallIndex)
   }
 }
 
-std::vector<Command*> TestGraphicsCommandBuffer::GetCommandsByType(CommandTypeMask mask)
+std::vector<const Command*> TestGraphicsCommandBuffer::GetCommandsByType(CommandTypeMask mask) const
 {
-  std::vector<Command*> mCommandStack{};
+  std::vector<const Command*> mCommandStack{};
   for(auto& cmd : mCommands)
   {
     if(uint32_t(cmd.type) == (mask & uint32_t(cmd.type)))
@@ -73,9 +73,9 @@ std::vector<Command*> TestGraphicsCommandBuffer::GetCommandsByType(CommandTypeMa
   return mCommandStack;
 }
 
-std::vector<Command*> TestGraphicsCommandBuffer::GetChildCommandsByType(CommandTypeMask mask)
+std::vector<const Command*> TestGraphicsCommandBuffer::GetChildCommandsByType(CommandTypeMask mask) const
 {
-  std::vector<Command*> mCommandStack{};
+  std::vector<const Command*> mCommandStack{};
   for(auto& cmd : mCommands)
   {
     if(uint32_t(cmd.type) == (mask & uint32_t(cmd.type)))
index bc1ea7b..a68cb7f 100644 (file)
@@ -477,7 +477,7 @@ struct Command
 
     struct
     {
-      std::vector<TestGraphicsCommandBuffer*> buffers;
+      std::vector<const TestGraphicsCommandBuffer*> buffers;
     } executeCommandBuffers;
 
   } data;
@@ -624,7 +624,7 @@ public:
     mCallStack.PushCall("EndRenderPass", "");
   }
 
-  void ExecuteCommandBuffers(std::vector<CommandBuffer*>&& commandBuffers) override
+  void ExecuteCommandBuffers(std::vector<const CommandBuffer*>&& commandBuffers) override
   {
     mCommands.emplace_back();
     auto& cmd = mCommands.back();
@@ -632,7 +632,7 @@ public:
     cmd.data.executeCommandBuffers.buffers.reserve(commandBuffers.size());
     for(auto&& item : commandBuffers)
     {
-      cmd.data.executeCommandBuffers.buffers.emplace_back(static_cast<TestGraphicsCommandBuffer*>(item));
+      cmd.data.executeCommandBuffers.buffers.emplace_back(static_cast<const TestGraphicsCommandBuffer*>(item));
     }
     mCallStack.PushCall("ExecuteCommandBuffers", "");
   }
@@ -768,9 +768,9 @@ public:
   /**
    * Retrieves commands of specified type
    */
-  std::vector<Command*> GetCommandsByType(CommandTypeMask mask);
+  std::vector<const Command*> GetCommandsByType(CommandTypeMask mask) const;
 
-  std::vector<Command*> GetChildCommandsByType(CommandTypeMask mask);
+  std::vector<const Command*> GetChildCommandsByType(CommandTypeMask mask) const;
 
 private:
   TraceCallStack&    mCallStack;
index e398236..ddcf0f5 100644 (file)
@@ -543,21 +543,6 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com
       case CommandType::BIND_PIPELINE:
       {
         currentPipeline = Uncast<TestGraphicsPipeline>(cmd.data.bindPipeline.pipeline);
-
-        // Bind framebuffer if different. @todo Move to RenderPass
-        auto framebuffer = currentPipeline->framebufferState.framebuffer;
-        if(framebuffer && framebuffer != currentFramebuffer)
-        {
-          auto graphicsFramebuffer = Uncast<TestGraphicsFramebuffer>(framebuffer);
-          graphicsFramebuffer->Bind();
-        }
-        else
-        {
-          if(currentFramebuffer)
-            currentFramebuffer->Bind();
-          else
-            mGl.BindFramebuffer(GL_FRAMEBUFFER, 0);
-        }
         BindPipeline(currentPipeline);
         break;
       }
@@ -622,7 +607,7 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com
         // Process secondary command buffers
         for(auto& buf : cmd.data.executeCommandBuffers.buffers)
         {
-          ProcessCommandBuffer(*static_cast<TestGraphicsCommandBuffer*>(buf));
+          ProcessCommandBuffer(*Uncast<TestGraphicsCommandBuffer>(buf));
         }
         break;
       }