Moved (DEFAULT|DEBUG)_BACKGROUND_COLOR out of Stage and over to constants.h 80/242880/4
authorGyörgy Straub <g.straub@partner.samsung.com>
Tue, 1 Sep 2020 12:41:11 +0000 (13:41 +0100)
committerGyörgy Straub <g.straub@partner.samsung.com>
Tue, 1 Sep 2020 16:34:58 +0000 (17:34 +0100)
Change-Id: I48371fcc2684ba3c2205440fa51fc06515d9bd5f
Signed-off-by: György Straub <g.straub@partner.samsung.com>
automated-tests/src/dali/utc-Dali-Stage.cpp
dali/devel-api/common/stage.cpp
dali/devel-api/common/stage.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/stage-impl.cpp
dali/internal/update/manager/update-manager.cpp
dali/public-api/common/constants.h

index 1ba3ab4..ca9ea5a 100644 (file)
@@ -746,7 +746,7 @@ int UtcDaliStageGetBackgroundColorP(void)
 
   Stage stage = Stage::GetCurrent();
 
-  DALI_TEST_EQUALS( Stage::DEFAULT_BACKGROUND_COLOR, stage.GetBackgroundColor(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DEFAULT_BACKGROUND_COLOR, stage.GetBackgroundColor(), TEST_LOCATION );
   END_TEST;
 }
 
index b07b63f..d343210 100644 (file)
@@ -31,9 +31,6 @@ namespace Dali
 
 using Internal::Core;
 
-const Vector4 Stage::DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f);
-const Vector4 Stage::DEBUG_BACKGROUND_COLOR(0.2f, 0.5f, 0.2f, 1.0f);
-
 Stage::Stage()
 {
 }
index 81e5b2f..0d4a169 100644 (file)
@@ -94,9 +94,6 @@ public:
   typedef Signal< void () > ContextStatusSignal;                     ///< Context status signal type @SINCE_1_0.0
   typedef Signal< void () > SceneCreatedSignalType;                  ///< Scene created signal type @SINCE_1_0.0
 
-  static const Vector4 DEFAULT_BACKGROUND_COLOR; ///< Default black background.
-  static const Vector4 DEBUG_BACKGROUND_COLOR;   ///< Green background, useful when debugging.
-
   /**
    * @brief Allows the creation of an empty stage handle.
    *
index 4b44566..4c9c995 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/update/common/scene-graph-scene.h>
+#include <dali/public-api/common/constants.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/internal/event/rendering/frame-buffer-impl.h>
@@ -42,13 +43,6 @@ namespace Dali
 namespace Internal
 {
 
-namespace
-{
-
-const Vector4 DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f); // Default background color
-
-} //Unnamed namespace
-
 ScenePtr Scene::New( Size size )
 {
   ScenePtr scene = new Scene;
index 106c58f..7464e64 100644 (file)
@@ -40,6 +40,7 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/common/constants.h>
 
 using Dali::Internal::SceneGraph::Node;
 
@@ -91,7 +92,7 @@ StagePtr Stage::New( SceneGraph::UpdateManager& updateManager )
 void Stage::Initialize( Scene& scene )
 {
   mScene = &scene;
-  mScene->SetBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR );
+  mScene->SetBackgroundColor( Dali::DEFAULT_BACKGROUND_COLOR );
   mScene->EventProcessingFinishedSignal().Connect( this, &Stage::OnEventProcessingFinished );
   mScene->KeyEventSignal().Connect( this, &Stage::OnKeyEvent );
   mScene->TouchSignal().Connect( this, &Stage::OnTouchEvent );
index b0a3787..2a7ce73 100644 (file)
@@ -174,7 +174,7 @@ struct UpdateManager::Impl
     renderManager( renderManager ),
     renderQueue( renderQueue ),
     renderTaskProcessor( renderTaskProcessor ),
-    backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
+    backgroundColor( Dali::DEFAULT_BACKGROUND_COLOR ),
     renderers(),
     textureSets(),
     shaders(),
index f2a7007..d8e7515 100644 (file)
@@ -126,6 +126,10 @@ static constexpr float ONE80_OVER_PI = 180.0f/Dali::Math::PI; ///< Constant used
 
 } // namespace Math
 
+// background colors
+static constexpr Vector4 DEFAULT_BACKGROUND_COLOR = Color::BLACK;
+static constexpr Vector4 DEBUG_BACKGROUND_COLOR(0.2f, 0.5f, 0.2f, 1.0f); ///< Dark green, useful for debugging visuals (texture / shader issues / culling etc.).
+
 /**
  * @}
  */