TestApplication application;
auto stage = Stage::GetCurrent();
- tet_infoline( "Ensure we clear the screen when the last actor is removed" );
+ tet_infoline( "Ensure we clear the screen when the last actor is made invisible" );
Actor actor = CreateRenderableActor();
actor.SetSize( 100.0f, 100.0f );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
END_TEST;
}
+int UtcDaliSceneEnsureEmptySceneCleared(void)
+{
+ tet_infoline( "Ensure we clear the newly added window" );
+
+ TestApplication application;
+
+ // Create a new scene and set the background colors of both the new and the main scenes
+ auto defaultScene = application.GetScene();
+ defaultScene.SetBackgroundColor( Color::WHITE );
+
+ auto newScene = Integration::Scene::New( Vector2( 480.0f, 800.0f ) );
+ newScene.SetBackgroundColor( Color::RED );
+
+ // Need to create a renderable as we don't start rendering until we have at least one
+ // We don't need to add this to any scene
+ auto actor = CreateRenderableActor();
+
+ auto& glAbstraction = application.GetGlAbstraction();
+ auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 2, TEST_LOCATION );
+
+ // Add the actor to the main scene
+ defaultScene.Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ // Add another scene and set its background color, ensure we clear it to the appropriate color
+
+ auto thirdScene = Integration::Scene::New( Vector2( 200.0f, 200.0f ) );
+ thirdScene.SetBackgroundColor( Color::BLUE );
+
+ clearCountBefore = glAbstraction.GetClearCountCalled();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 3, TEST_LOCATION );
+
+ END_TEST;
+}
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
renderTask.PrepareRenderInstruction( instruction, updateBufferIndex );
bool viewMatrixHasNotChanged = !renderTask.ViewMatrixUpdated();
bool isRenderListAdded = false;
+ bool isRootLayerDirty = false;
const Matrix& viewMatrix = renderTask.GetViewMatrix( updateBufferIndex );
SceneGraph::Camera& camera = renderTask.GetCamera();
const bool isLayer3D = layer.GetBehavior() == Dali::Layer::LAYER_3D;
RenderList* renderList = NULL;
+ if( layer.IsRoot() && ( layer.GetDirtyFlags() != NodePropertyFlags::NOTHING ) )
+ {
+ // If root-layer & dirty, i.e. a property has changed or a child has been deleted, then we need to ensure we render once more
+ isRootLayerDirty = true;
+ }
+
if( !layer.colorRenderables.Empty() )
{
RenderableContainer& renderables = layer.colorRenderables;
// Inform the render instruction that all renderers have been added and this frame is complete.
instruction.UpdateCompleted();
- if( !isRenderListAdded && !instruction.mIsClearColorSet )
+ if( !isRenderListAdded && !instruction.mIsClearColorSet && !isRootLayerDirty )
{
instructions.DiscardCurrentInstruction( updateBufferIndex );
}
DALI_LOG_INFO( gLogFilter, Debug::General,
"Update: numberOfRenderTasks(%d), Render Instructions(%d)\n",
numberOfRenderTasks, mImpl->renderInstructions.Count( bufferIndex ) );
-
-
-
- // If any node is dirty, i.e. a property has changed or a child has been deleted, and we do not have any instructions to send, then generate a dummy instruction to force another render
- if( ( mImpl->nodeDirtyFlags != NodePropertyFlags::NOTHING ) && ( mImpl->renderInstructions.Count( bufferIndex ) == 0 ) )
- {
- DALI_LOG_INFO( gLogFilter, Debug::General, "Node flags dirty, creating dummy instruction\n" );
- mImpl->renderInstructions.GetNextInstruction( bufferIndex ); // This creates and adds an empty instruction. We do not need to modify it.
- }
}
}