Updated test harness 19/256919/2
authorAdam Bialogonski <adam.b@samsung.com>
Wed, 14 Apr 2021 14:20:36 +0000 (15:20 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Wed, 14 Apr 2021 15:22:45 +0000 (16:22 +0100)
Change-Id: I7df233ddf68241cd7d8a8da6a71ce262dd85262f

automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-controller.cpp
dali/internal/graphics/gles-impl/egl-graphics-controller.cpp
dali/internal/graphics/gles-impl/gles-graphics-types.h

index a2a1848..6075c8f 100644 (file)
@@ -76,6 +76,12 @@ void TestApplication::CreateScene()
 {
   mScene = Dali::Integration::Scene::New(Size(static_cast<float>(mSurfaceWidth), static_cast<float>(mSurfaceHeight)));
   mScene.SetDpi(Vector2(static_cast<float>(mDpi.x), static_cast<float>(mDpi.y)));
+
+  // Create render target for the scene
+  Graphics::RenderTargetCreateInfo rtInfo{};
+  rtInfo.SetExtent({mSurfaceWidth, mSurfaceHeight});
+  mRenderTarget = mGraphicsController.CreateRenderTarget(rtInfo, nullptr);
+  mScene.SetSurfaceRenderTarget(mRenderTarget.get());
 }
 
 void TestApplication::InitializeCore()
index e7d8c76..ad5d198 100644 (file)
@@ -108,6 +108,8 @@ protected:
   uint32_t mSurfaceHeight;
   uint32_t mFrame;
 
+  Graphics::UniquePtr<Graphics::RenderTarget> mRenderTarget;
+
   struct
   {
     uint32_t x;
index c42d372..083cd96 100644 (file)
@@ -176,7 +176,6 @@ std::ostream& operator<<(std::ostream& o, const Graphics::FramebufferCreateInfo&
   return o;
 }
 
-
 int GetNumComponents(Graphics::VertexInputFormat vertexFormat)
 {
   switch(vertexFormat)
@@ -385,7 +384,6 @@ GLenum GetBlendOp(Graphics::BlendOp blendOp)
   return op;
 }
 
-
 class TestGraphicsMemory : public Graphics::Memory
 {
 public:
@@ -453,7 +451,6 @@ TestGraphicsController::TestGraphicsController()
   trace.EnableLogging(true);
 }
 
-
 void TestGraphicsController::SubmitCommandBuffers(const Graphics::SubmitInfo& submitInfo)
 {
   TraceCallStack::NamedParams namedParams;
@@ -691,7 +688,23 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com
 
             if(mask != 0)
             {
-              mGl.Clear(mask);
+              // Test scissor area and RT size
+              const auto& area = cmd.data.beginRenderPass.renderArea;
+              if(area.x == 0 &&
+                 area.y == 0 &&
+                 area.width == renderTarget->mCreateInfo.extent.width &&
+                 area.height == renderTarget->mCreateInfo.extent.height)
+              {
+                mGl.Disable(GL_SCISSOR_TEST);
+                mGl.Clear(mask);
+              }
+              else
+              {
+                mGl.Enable(GL_SCISSOR_TEST);
+                mGl.Scissor(cmd.data.beginRenderPass.renderArea.x, cmd.data.beginRenderPass.renderArea.y, cmd.data.beginRenderPass.renderArea.width, cmd.data.beginRenderPass.renderArea.height);
+                mGl.Clear(mask);
+                mGl.Disable(GL_SCISSOR_TEST);
+              }
             }
           }
           else
index d2a65fe..b17e6f8 100644 (file)
@@ -395,6 +395,9 @@ void EglGraphicsController::ProcessCommandBuffer(GLES::CommandBuffer& commandBuf
       case GLES::CommandType::PRESENT_RENDER_TARGET:
       {
         ResolvePresentRenderTarget(cmd.presentRenderTarget.targetToPresent);
+
+        // push this command buffer to the discard queue
+        mDiscardCommandBufferQueue.push(&commandBuffer);
         break;
       }
       case GLES::CommandType::EXECUTE_COMMAND_BUFFERS:
index 5ff2e2a..3547ffe 100644 (file)
@@ -13,8 +13,6 @@ class RenderPass;
 class RenderTarget;
 class Framebuffer;
 
-using Surface = void*;
-
 // Conversion functions
 /**
  * Stucture delivers format and type that can be used