From fbcd6c43739ef1ddf55739b720ba903f6c414af3 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 31 Jan 2018 18:34:52 +0900 Subject: [PATCH] Add a flag to force the Clear on the framebuffer Change-Id: I2e14cfa110dea9265e02b3432fac55d637ff3842 --- automated-tests/src/dali/dali-test-suite-utils/test-application.cpp | 4 ++-- dali/integration-api/core.cpp | 6 +++--- dali/integration-api/core.h | 3 ++- dali/internal/common/core-impl.cpp | 4 ++-- dali/internal/common/core-impl.h | 2 +- dali/internal/render/common/render-manager.cpp | 4 ++-- dali/internal/render/common/render-manager.h | 3 ++- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp index a247f7d..0e640e7 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp @@ -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++; diff --git a/dali/integration-api/core.cpp b/dali/integration-api/core.cpp index 41dfa0d..be0e213 100644 --- a/dali/integration-api/core.cpp +++ b/dali/integration-api/core.cpp @@ -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() diff --git a/dali/integration-api/core.h b/dali/integration-api/core.h index 7db841a..002621c 100644 --- a/dali/integration-api/core.h +++ b/dali/integration-api/core.h @@ -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 diff --git a/dali/internal/common/core-impl.cpp b/dali/internal/common/core-impl.cpp index 7637a27..79e3e42 100644 --- a/dali/internal/common/core-impl.cpp +++ b/dali/internal/common/core-impl.cpp @@ -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() diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h index 0e745d7..2e063e8 100644 --- a/dali/internal/common/core-impl.h +++ b/dali/internal/common/core-impl.h @@ -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() diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index 712d268..baa2560 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -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 ); diff --git a/dali/internal/render/common/render-manager.h b/dali/internal/render/common/render-manager.h index 5e48692..9191a27 100644 --- a/dali/internal/render/common/render-manager.h +++ b/dali/internal/render/common/render-manager.h @@ -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: -- 2.7.4