Adding dummy render target to test-graphics scene 16/256816/2
authorDavid Steele <david.steele@samsung.com>
Tue, 13 Apr 2021 10:52:46 +0000 (11:52 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Tue, 13 Apr 2021 11:36:41 +0000 (12:36 +0100)
Change-Id: I3b9387bdf0d537fb15b9eccde8df39d7911032d7

automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.h

index 4b2c5cb..55f591f 100644 (file)
@@ -21,7 +21,6 @@ namespace Dali
 {
 bool TestGraphicsApplication::mLoggingEnabled = true;
 
-
 TestGraphicsApplication::TestGraphicsApplication(uint32_t surfaceWidth,
                                                  uint32_t surfaceHeight,
                                                  uint32_t horizontalDpi,
@@ -81,6 +80,13 @@ void TestGraphicsApplication::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)));
+
+  Graphics::RenderTargetCreateInfo createInfo{};
+  createInfo.SetSurface({nullptr})
+    .SetExtent({mSurfaceWidth, mSurfaceHeight})
+    .SetPreTransform(0 | Graphics::RenderTargetTransformFlagBits::TRANSFORM_IDENTITY_BIT);
+  mRenderTarget = mGraphicsController.CreateRenderTarget(createInfo, nullptr);
+  mScene.SetSurfaceRenderTarget(mRenderTarget.get());
 }
 
 void TestGraphicsApplication::InitializeCore()
index 229d5c8..35f7269 100644 (file)
 #include <test-platform-abstraction.h>
 #include <test-render-controller.h>
 
-
 namespace Dali
 {
-
-
 namespace Internal::Adaptor
 {
 class ConfigurationManager;
@@ -188,9 +185,6 @@ public:
   TraceCallStack mCallstack{true, "GraphicsImpl"};
 };
 
-
-
-
 class DALI_CORE_API TestGraphicsApplication : public ConnectionTracker
 {
 public:
@@ -254,13 +248,14 @@ private:
   void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
 
 protected:
-  TestPlatformAbstraction         mPlatformAbstraction;
-  TestRenderController            mRenderController;
-  Graphics::EglGraphicsController mGraphicsController; // Use real controller in Adaptor
-  TestGlAbstraction               mGlAbstraction;
-  TestGlSyncAbstraction           mGlSyncAbstraction;
-  TestGlContextHelperAbstraction  mGlContextHelperAbstraction;
-  TestGraphicsImpl                mGraphics;
+  TestPlatformAbstraction                     mPlatformAbstraction;
+  TestRenderController                        mRenderController;
+  Graphics::EglGraphicsController             mGraphicsController; // Use real controller in Adaptor
+  TestGlAbstraction                           mGlAbstraction;
+  TestGlSyncAbstraction                       mGlSyncAbstraction;
+  TestGlContextHelperAbstraction              mGlContextHelperAbstraction;
+  TestGraphicsImpl                            mGraphics;
+  Graphics::UniquePtr<Graphics::RenderTarget> mRenderTarget{nullptr};
 
   Integration::UpdateStatus mStatus;
   Integration::RenderStatus mRenderStatus;