{
DoUpdate( intervalMilliseconds, location );
+ // Reset the status
+ mRenderStatus.SetNeedsUpdate( false );
+ mRenderStatus.SetNeedsPostRender( false );
+
mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene( mScene, false /*render the surface*/);
+ 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*/ );
mFrame++;
return mRenderStatus.NeedsUpdate();
}
+bool TestApplication::GetRenderNeedsPostRender()
+{
+ return mRenderStatus.NeedsPostRender();
+}
+
bool TestApplication::RenderOnly( )
{
// Update Time values
mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene( mScene, false /*render the surface*/);
+ 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*/ );
mFrame++;
bool RenderOnly( );
void ResetContext();
bool GetRenderNeedsUpdate();
+ bool GetRenderNeedsPostRender();
uint32_t Wait( uint32_t durationToWait );
static void EnableLogging( bool enabled )
{
END_TEST;
}
+
+int UtcDaliSceneEmptySceneRendering(void)
+{
+ tet_infoline( "Ensure not rendering before a Renderer is added" );
+
+ TestApplication application;
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+
+ // Render without any renderer
+ application.SendNotification();
+ application.Render();
+
+ // Check the clear count and the render status
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetRenderNeedsPostRender(), false, TEST_LOCATION );
+
+ // Add a Renderer
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ Renderer renderer = Renderer::New( geometry, shader );
+
+ Actor actor = Actor::New();
+ actor.AddRenderer( renderer );
+ actor.SetSize( 400, 400 );
+ Stage::GetCurrent().Add( actor );
+
+ // Render
+ application.SendNotification();
+ application.Render();
+
+ // Check the clear count and the render status
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetRenderNeedsPostRender(), true, TEST_LOCATION );
+
+ // Remove the Renderer
+ Stage::GetCurrent().Remove( actor );
+ actor.Reset();
+ renderer.Reset();
+
+ // Render
+ application.SendNotification();
+ application.Render();
+
+ // Check the clear count and the render status
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), 2, TEST_LOCATION ); // Should be cleared
+ DALI_TEST_EQUALS( application.GetRenderNeedsPostRender(), true, TEST_LOCATION );
+
+ END_TEST;
+}
mImpl->PreRender( status, forceClear, uploadOnly );
}
-void Core::RenderScene( Integration::Scene& scene, bool renderToFbo )
+void Core::RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo )
{
- mImpl->RenderScene( scene, renderToFbo );
+ mImpl->RenderScene( status, scene, renderToFbo );
}
void Core::PostRender( bool uploadOnly )
* and the second pass to render the surface.
* 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 Contains the rendering flags.
* @param[in] scene The scene to be rendered.
* @param[in] renderToFbo True to render off-screen frame buffers only if any, and False to render the surface only.
*/
- void RenderScene( Integration::Scene& scene, bool renderToFbo );
+ void RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo );
/**
mRenderManager->PreRender( status, forceClear, uploadOnly );
}
-void Core::RenderScene( Integration::Scene& scene, bool renderToFbo )
+void Core::RenderScene( RenderStatus& status, Integration::Scene& scene, bool renderToFbo )
{
- mRenderManager->RenderScene( scene, renderToFbo );
+ mRenderManager->RenderScene( status, scene, renderToFbo );
}
void Core::PostRender( bool uploadOnly )
/**
* @copydoc Dali::Integration::Core::RenderScene()
*/
- void RenderScene( Integration::Scene& scene, bool renderToFbo );
+ void RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo );
/**
* @copydoc Dali::Integration::Core::Render()
{
DALI_LOG_INFO( gLogFilter, Debug::General, "Render: Processing\n" );
- if ( !uploadOnly )
- {
- // Mark that we will require a post-render step to be performed (includes swap-buffers).
- status.SetNeedsPostRender( true );
- }
-
// Switch to the shared context
if ( mImpl->currentContext != &mImpl->context )
{
}
-void RenderManager::RenderScene( Integration::Scene& scene, bool renderToFbo )
+void RenderManager::RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo )
{
Internal::Scene& sceneInternal = GetImplementation( scene );
SceneGraph::Scene* sceneObject = sceneInternal.GetSceneObject();
continue; // skip
}
+ // Mark that we will require a post-render step to be performed (includes swap-buffers).
+ status.SetNeedsPostRender( true );
+
Rect<int32_t> viewportRect;
Vector4 clearColor;
* and the second pass to render the surface.
* 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 contains the rendering flags.
* @param[in] scene The scene to be rendered.
* @param[in] renderToFbo True to render off-screen frame buffers only if any, and False to render the surface only.
*/
- void RenderScene( Integration::Scene& scene, bool renderToFbo );
+ void RenderScene( Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo );
// This method should be called from Core::PostRender()