Add a flag to force the Clear on the framebuffer 41/168841/6
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 31 Jan 2018 09:34:52 +0000 (18:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 19 Feb 2018 04:14:16 +0000 (04:14 +0000)
Change-Id: I2e14cfa110dea9265e02b3432fac55d637ff3842

automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
dali/integration-api/core.cpp
dali/integration-api/core.h
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/render/common/render-manager.cpp
dali/internal/render/common/render-manager.h

index a247f7d..0e640e7 100644 (file)
@@ -183,7 +183,7 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l
 bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location )
 {
   DoUpdate( intervalMilliseconds, location );
-  mCore->Render( mRenderStatus );
+  mCore->Render( mRenderStatus, false );
 
   mFrame++;
 
@@ -209,7 +209,7 @@ bool TestApplication::GetRenderNeedsUpdate()
 bool TestApplication::RenderOnly( )
 {
   // Update Time values
-  mCore->Render( mRenderStatus );
+  mCore->Render( mRenderStatus, false );
 
   mFrame++;
 
index 41dfa0d..be0e213 100644 (file)
@@ -114,14 +114,14 @@ unsigned int Core::GetMaximumUpdateCount() const
   return mImpl->GetMaximumUpdateCount();
 }
 
-  void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
+void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
 {
   mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
 }
 
-void Core::Render( RenderStatus& status )
+void Core::Render( RenderStatus& status, bool forceClear )
 {
-  mImpl->Render( status );
+  mImpl->Render( status, forceClear );
 }
 
 SystemOverlay& Core::GetSystemOverlay()
index 7db841a..002621c 100644 (file)
@@ -361,8 +361,9 @@ public:
    * Multi-threading note: this method should be called from a dedicated rendering thread.
    * @pre The GL context must have been created, and made current.
    * @param[out] status showing whether update is required to run.
+   * @param[in] forceClear force the Clear on the framebuffer even if nothing is rendered.
    */
-  void Render( RenderStatus& status );
+  void Render( RenderStatus& status, bool forceClear );
 
   // System-level overlay
 
index 7637a27..79e3e42 100644 (file)
@@ -231,9 +231,9 @@ void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds,
   // Any message to update will wake it up anyways
 }
 
-void Core::Render( RenderStatus& status )
+void Core::Render( RenderStatus& status, bool forceClear )
 {
-  mRenderManager->Render( status );
+  mRenderManager->Render( status, forceClear );
 }
 
 void Core::SceneCreated()
index 0e745d7..2e063e8 100644 (file)
@@ -138,7 +138,7 @@ public:
   /**
    * @copydoc Dali::Integration::Core::Render()
    */
-  void Render( Integration::RenderStatus& status );
+  void Render( Integration::RenderStatus& status, bool forceClear );
 
   /**
    * @copydoc Dali::Integration::Core::SceneCreated()
index 712d268..baa2560 100644 (file)
@@ -397,7 +397,7 @@ ProgramCache* RenderManager::GetProgramCache()
   return &(mImpl->programController);
 }
 
-void RenderManager::Render( Integration::RenderStatus& status )
+void RenderManager::Render( Integration::RenderStatus& status, bool forceClear )
 {
   DALI_PRINT_RENDER_START( mImpl->renderBufferIndex );
 
@@ -414,7 +414,7 @@ void RenderManager::Render( Integration::RenderStatus& status )
   const bool haveInstructions = count > 0u;
 
   // Only render if we have instructions to render, or the last frame was rendered (and therefore a clear is required).
-  if( haveInstructions || mImpl->lastFrameWasRendered )
+  if( haveInstructions || mImpl->lastFrameWasRendered || forceClear )
   {
     // Mark that we will require a post-render step to be performed (includes swap-buffers).
     status.SetNeedsPostRender( true );
index 5e48692..9191a27 100644 (file)
@@ -324,8 +324,9 @@ public:
   /**
    * Renders the results of the previous "update" traversal.
    * @param[out] status contains the rendering flags.
+   * @param[in] forceClear force the Clear on the framebuffer even if nothing is rendered.
    */
-  void Render( Integration::RenderStatus& status );
+  void Render( Integration::RenderStatus& status, bool forceClear );
 
 private: