[Tizen] Fix to do not update state of render task in case of uploadOnly
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / dali-test-suite-utils / test-application.cpp
index e71166b..e04807b 100644 (file)
@@ -178,7 +178,7 @@ void TestApplication::SendNotification()
   mCore->ProcessEvents();
 }
 
-void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location)
+void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location, bool uploadOnly)
 {
   if(GetUpdateStatus() == 0 &&
      mRenderStatus.NeedsUpdate() == false &&
@@ -190,25 +190,28 @@ void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* locati
   uint32_t nextVSyncTime  = mLastVSyncTime + intervalMilliseconds;
   float    elapsedSeconds = static_cast<float>(intervalMilliseconds) * 0.001f;
 
-  mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false);
+  mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false, uploadOnly);
 
   GetRenderController().Initialize();
 
   mLastVSyncTime = nextVSyncTime;
 }
 
-bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location)
+bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location, bool uploadOnly)
 {
-  DoUpdate(intervalMilliseconds, location);
+  DoUpdate(intervalMilliseconds, location, uploadOnly);
 
   // Reset the status
   mRenderStatus.SetNeedsUpdate(false);
   mRenderStatus.SetNeedsPostRender(false);
 
-  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
-  mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
-  mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
-  mCore->PostRender(false /*do not skip rendering*/);
+  mCore->PreRender(mRenderStatus, false /*do not force clear*/);
+  if(!uploadOnly)
+  {
+    mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
+    mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
+  }
+  mCore->PostRender();
 
   mFrame++;
 
@@ -219,7 +222,7 @@ bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds,
 {
   DoUpdate(intervalMilliseconds, location);
 
-  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+  mCore->PreRender(mRenderStatus, false /*do not force clear*/);
   mCore->PreRender(mRenderStatus, mScene, damagedRects);
 
   return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
@@ -229,7 +232,7 @@ bool TestApplication::RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRec
 {
   mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
   mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect);
-  mCore->PostRender(false /*do not skip rendering*/);
+  mCore->PostRender();
 
   mFrame++;
 
@@ -260,10 +263,10 @@ bool TestApplication::GetRenderNeedsPostRender()
 bool TestApplication::RenderOnly()
 {
   // Update Time values
-  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+  mCore->PreRender(mRenderStatus, false /*do not force clear*/);
   mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
   mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
-  mCore->PostRender(false /*do not skip rendering*/);
+  mCore->PostRender();
 
   mFrame++;