Removing Configuration::ContextLoss APIs and enum 45/243045/3
authorDavid Steele <david.steele@samsung.com>
Wed, 2 Sep 2020 14:51:23 +0000 (15:51 +0100)
committerDavid Steele <david.steele@samsung.com>
Wed, 2 Sep 2020 15:23:43 +0000 (16:23 +0100)
Change-Id: I41e08e1e4b4055f91cc381a9da69e07df7b3aeca

automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
dali/integration-api/adaptor-framework/adaptor.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/public-api/adaptor-framework/application-configuration.h [deleted file]
dali/public-api/adaptor-framework/application.cpp
dali/public-api/adaptor-framework/application.h
dali/public-api/file.list

index 8b97ae5..b3654d1 100644 (file)
@@ -191,22 +191,6 @@ int UtcDaliApplicationMainLoop01N(void)
   END_TEST;
 }
 
-int UtcDaliApplicationMainLoop02N(void)
-{
-  Application application;
-
-  try
-  {
-    application.MainLoop( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-    DALI_TEST_CHECK( false ); // Should not get here
-  }
-  catch( ... )
-  {
-    DALI_TEST_CHECK( true );
-  }
-
-  END_TEST;
-}
 
 int UtcDaliApplicationLowerN(void)
 {
index 6985275..85d018a 100644 (file)
@@ -29,7 +29,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/window.h>
-#include <dali/public-api/adaptor-framework/application-configuration.h>
 #include <dali/public-api/dali-adaptor-common.h>
 #include <dali/integration-api/adaptor-framework/log-factory-interface.h>
 
@@ -135,15 +134,6 @@ public:
   static Adaptor& New( Window window );
 
   /**
-   * @brief Create a new adaptor using the window.
-   *
-   * @param[in] window The window to draw onto
-   * @param[in] configuration The context loss configuration.
-   * @return a reference to the adaptor handle
-   */
-  static Adaptor& New( Window window, Configuration::ContextLoss configuration );
-
-  /**
    * @brief Create a new adaptor using render surface.
    *
    * @param[in] window The window to draw onto
@@ -153,16 +143,6 @@ public:
   static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface );
 
   /**
-   * @brief Create a new adaptor using render surface.
-   *
-   * @param[in] window The window to draw onto
-   * @param[in] surface The surface to draw onto
-   * @param[in] configuration The context loss configuration.
-   * @return a reference to the adaptor handle
-   */
-  static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
-
-  /**
    * @brief Create a new adaptor using the SceneHolder.
    *
    * @param[in] sceneHolder The SceneHolder to draw onto
@@ -171,15 +151,6 @@ public:
   static Adaptor& New( Dali::Integration::SceneHolder sceneHolder );
 
   /**
-   * @brief Create a new adaptor using the SceneHolder.
-   *
-   * @param[in] sceneHolder The SceneHolder to draw onto
-   * @param[in] configuration The context loss configuration.
-   * @return a reference to the adaptor handle
-   */
-  static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, Configuration::ContextLoss configuration );
-
-  /**
    * @brief Create a new adaptor using render surface.
    *
    * @param[in] sceneHolder The SceneHolder to draw onto
@@ -189,16 +160,6 @@ public:
   static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface );
 
   /**
-   * @brief Create a new adaptor using render surface.
-   *
-   * @param[in] sceneHolder The SceneHolder to draw onto
-   * @param[in] surface The surface to draw onto
-   * @param[in] configuration The context loss configuration.
-   * @return a reference to the adaptor handle
-   */
-  static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
-
-  /**
    * @brief Virtual Destructor.
    */
   virtual ~Adaptor();
index 5a65a8e..e6ae520 100755 (executable)
@@ -96,7 +96,7 @@ thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer
 
 } // unnamed namespace
 
-Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, EnvironmentOptions* environmentOptions )
 {
   Dali::Adaptor* adaptor = new Dali::Adaptor;
   Adaptor* impl = new Adaptor( window, *adaptor, surface, environmentOptions );
@@ -105,40 +105,40 @@ Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::Render
   Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder = new AdaptorBuilder();
   auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
 
-  impl->Initialize( graphicsFactory, configuration );
+  impl->Initialize( graphicsFactory );
   delete mAdaptorBuilder; // Not needed anymore as the graphics interface has now been created
 
   return adaptor;
 }
 
-Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, EnvironmentOptions* environmentOptions )
 {
   Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( window );
-  Dali::Adaptor* adaptor = New( window, windowImpl.GetSurface(), configuration, environmentOptions );
+  Dali::Adaptor* adaptor = New( window, windowImpl.GetSurface(), environmentOptions );
   windowImpl.SetAdaptor( *adaptor );
   return adaptor;
 }
 
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, EnvironmentOptions* environmentOptions )
 {
   Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
   Adaptor* impl = new Adaptor( window, *adaptor, surface, environmentOptions ); // Impl adaptor
   adaptor->mImpl = impl;
 
-  impl->Initialize( graphicsFactory, configuration );
+  impl->Initialize( graphicsFactory );
 
   return adaptor;
 } // Called second
 
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, EnvironmentOptions* environmentOptions )
 {
   Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( window );
-  Dali::Adaptor* adaptor = New( graphicsFactory, window, windowImpl.GetSurface(), configuration, environmentOptions );
+  Dali::Adaptor* adaptor = New( graphicsFactory, window, windowImpl.GetSurface(), environmentOptions );
   windowImpl.SetAdaptor( *adaptor );
   return adaptor;
 } // Called first
 
-void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration )
+void Adaptor::Initialize( GraphicsFactory& graphicsFactory )
 {
   // all threads here (event, update, and render) will send their logs to TIZEN Platform's LogMessage handler.
   Dali::Integration::Log::LogFunction logFunction( Dali::TizenPlatform::LogMessage );
index ec5c645..cf81f7c 100755 (executable)
@@ -100,22 +100,18 @@ public:
    * @param[in]  surface             A render surface can be one of the following
    *                                  - Pixmap, adaptor will use existing Pixmap to draw on to
    *                                  - Window, adaptor will use existing Window to draw on to
-   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
   static Dali::Adaptor* New( Dali::Integration::SceneHolder window,
                              Dali::RenderSurfaceInterface* surface,
-                             Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
   /**
    * Creates a New Adaptor
    * @param[in]  window              The window handle
-   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
   static Dali::Adaptor* New( Dali::Integration::SceneHolder window,
-                             Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
   /**
@@ -125,33 +121,28 @@ public:
    * @param[in]  surface             A render surface can be one of the following
    *                                  - Pixmap, adaptor will use existing Pixmap to draw on to
    *                                  - Window, adaptor will use existing Window to draw on to
-   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
   static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
                              Dali::Integration::SceneHolder window,
                              Dali::RenderSurfaceInterface* surface,
-                             Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
   /**
    * Creates a New Adaptor
    * @param[in]  graphicsFactory     A factory that creates the graphics interface
    * @param[in]  window              The window handle
-   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
   static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
                              Dali::Integration::SceneHolder window,
-                             Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
   /**
    * 2-step initialisation, this should be called after creating an adaptor instance.
    * @param[in]  graphicsFactory     A factory that creates the graphics interface
-   * @param[in]  configuration       The context loss configuration ( to choose resource discard policy )
    */
-  void Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration );
+  void Initialize( GraphicsFactory& graphicsFactory );
 
   /**
    * Virtual destructor.
index add3245..e6c3735 100644 (file)
@@ -35,49 +35,29 @@ namespace Dali
 
 Adaptor& Adaptor::New( Window window )
 {
-  return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
-{
   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL );
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), NULL );
   return *adaptor;
 }
 
 Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
 {
-  return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
-{
   Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
   Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL );
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, NULL );
   return *adaptor;
 }
 
 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
 {
-  return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
-{
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, NULL );
   return *adaptor;
 }
 
 Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
 {
-  return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
-{
   Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
-  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL );
+  Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, NULL );
   return *adaptor;
 }
 
index d626def..f54c4cf 100644 (file)
@@ -94,7 +94,6 @@ Application::Application( int* argc, char** argv[], const std::string& styleshee
   mRegionChangedSignal(),
   mEventLoop( nullptr ),
   mFramework( nullptr ),
-  mContextLossConfiguration( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ),
   mCommandLineOptions( nullptr ),
   mAdaptorBuilder( nullptr ),
   mAdaptor( nullptr ),
@@ -171,7 +170,7 @@ void Application::CreateAdaptor()
 
   Integration::SceneHolder sceneHolder = Integration::SceneHolder( &Dali::GetImplementation( mMainWindow ) );
 
-  mAdaptor = Adaptor::New( graphicsFactory, sceneHolder, mContextLossConfiguration, &mEnvironmentOptions );
+  mAdaptor = Adaptor::New( graphicsFactory, sceneHolder, &mEnvironmentOptions );
 
   Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
 }
@@ -181,10 +180,8 @@ void Application::CreateAdaptorBuilder()
   mAdaptorBuilder = new AdaptorBuilder();
 }
 
-void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
+void Application::MainLoop()
 {
-  mContextLossConfiguration = configuration;
-
   // Run the application
   mFramework->Run();
 }
index d8d7363..2c868ba 100644 (file)
@@ -99,7 +99,7 @@ public:
   /**
    * @copydoc Dali::Application::MainLoop()
    */
-  void MainLoop(Dali::Configuration::ContextLoss configuration);
+  void MainLoop();
 
   /**
    * @copydoc Dali::Application::Lower()
@@ -349,7 +349,6 @@ private:
   EventLoop*                            mEventLoop;
   Framework*                            mFramework;
 
-  Dali::Configuration::ContextLoss      mContextLossConfiguration;
   CommandLineOptions*                   mCommandLineOptions;
 
   Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder;   ///< The adaptor builder
diff --git a/dali/public-api/adaptor-framework/application-configuration.h b/dali/public-api/adaptor-framework/application-configuration.h
deleted file mode 100644 (file)
index 0e23ff1..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef DALI_APPLICATION_CONFIGURATION_H
-#define DALI_APPLICATION_CONFIGURATION_H
-
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Dali
-{
-/**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-
-/**
- * @brief Enumeration for Application configuration.
- * @SINCE_1_0.0
- */
-namespace Configuration
-{
-
-/**
- * @brief Enumeration for application context loss policy.
- * @SINCE_1_0.0
- */
-enum ContextLoss
-{
-  APPLICATION_HANDLES_CONTEXT_LOSS,  ///< Application will tear down and recreate UI on context loss and context regained signals. Dali doesn't need to retain data. @SINCE_1_0.0
-  APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS, ///< Application expects Dali to retain data ( increased memory footprint ) @SINCE_1_0.0
-};
-
-} // Configuration
-
-/**
- * @}
- */
-
-} // namespace Dali
-
-#endif // DALI_APPLICATION_CONFIGURATION_H
index b7ed5f9..4103efc 100644 (file)
@@ -147,12 +147,7 @@ Application& Application::operator=( Application&& rhs ) = default;
 
 void Application::MainLoop()
 {
-  Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
-}
-
-void Application::MainLoop(Configuration::ContextLoss configuration)
-{
-  Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
+  Internal::Adaptor::GetImplementation(*this).MainLoop();
 }
 
 void Application::Lower()
index d7fb50c..87ebf92 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali/public-api/signals/callback.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/application-configuration.h>
 #include <dali/public-api/adaptor-framework/device-status.h>
 #include <dali/public-api/adaptor-framework/window.h>
 
@@ -241,22 +240,13 @@ public:
   /**
    * @brief This starts the application.
    *
-   * Choosing this form of main loop indicates that the default
-   * application configuration of APPLICATION_HANDLES_CONTEXT_LOSS is used. On platforms where
-   * context loss can occur, the application is responsible for tearing down and re-loading UI.
-   * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
-   * @SINCE_1_0.0
-   */
-  void MainLoop();
-
-  /**
-   * @brief This starts the application, and allows the app to choose a different configuration.
+   * On platforms where context loss can occur, the application is responsible for tearing down and
+   * re-loading UI.  The application should listen to Stage::ContextLostSignal and
+   * Stage::ContextRegainedSignal.
    *
-   * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
    * @SINCE_1_0.0
-   * @param[in] configuration The context loss configuration
    */
-  void MainLoop(Configuration::ContextLoss configuration);
+  void MainLoop();
 
   /**
    * @brief This lowers the application to bottom without actually quitting it.
index e4d3ac3..1cfdafd 100644 (file)
@@ -23,7 +23,6 @@ SET( public_api_header_files
 
 SET( public_api_adaptor_framework_header_files
   ${adaptor_public_api_dir}/adaptor-framework/application.h
-  ${adaptor_public_api_dir}/adaptor-framework/application-configuration.h
   ${adaptor_public_api_dir}/adaptor-framework/device-status.h
   ${adaptor_public_api_dir}/adaptor-framework/input-method.h
   ${adaptor_public_api_dir}/adaptor-framework/key.h