Merge "[3.0] Add SurfaceSizeChanged before ReplaceSurface" into tizen_3.0
authortaeyoon <taeyoon0.lee@samsung.com>
Wed, 7 Dec 2016 03:57:13 +0000 (19:57 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 7 Dec 2016 03:57:13 +0000 (19:57 -0800)
1  2 
adaptors/common/application-impl.cpp

  #include <singleton-service-impl.h>
  #include <lifecycle-controller-impl.h>
  
 +// CONDITIONAL INCLUDES
 +#ifdef DALI_ELDBUS_AVAILABLE
 +#include <Eldbus.h>
 +#endif // DALI_ELDBUS_AVAILABLE
 +
  namespace Dali
  {
  
@@@ -52,13 -47,6 +52,13 @@@ namespace Interna
  namespace Adaptor
  {
  
 +#if defined(DEBUG_ENABLED)
 +namespace
 +{
 +Integration::Log::Filter* gDBusLogging = Integration::Log::Filter::New( Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DBUS" );
 +} // anonymous namespace
 +#endif
 +
  ApplicationPtr Application::New(
    int* argc,
    char **argv[],
@@@ -106,7 -94,6 +106,7 @@@ Application::Application( int* argc, ch
  
    mCommandLineOptions = new CommandLineOptions(argc, argv);
    mFramework = new Framework( *this, argc, argv, applicationType );
 +  mUseRemoteSurface = (applicationType == Framework::WATCH);
  }
  
  Application::~Application()
    delete mFramework;
    delete mCommandLineOptions;
    delete mAdaptor;
 +
 +#ifdef DALI_ELDBUS_AVAILABLE
 +  // Shutdown ELDBus.
 +  DALI_LOG_INFO( gDBusLogging, Debug::General, "Shutting down DBus\n" );
 +  eldbus_shutdown();
 +#endif
 +
    mWindow.Reset();
  }
  
@@@ -155,8 -135,6 +155,8 @@@ void Application::CreateAdaptor(
    mAdaptor = Dali::Internal::Adaptor::Adaptor::New( mWindow, mContextLossConfiguration, &mEnvironmentOptions );
  
    mAdaptor->ResizedSignal().Connect( mSlotDelegate, &Application::OnResize );
 +
 +  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
  }
  
  void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
@@@ -192,15 -170,9 +192,15 @@@ void Application::OnInit(
    mFramework->AddAbortCallback( MakeCallback( this, &Application::QuitFromMainLoop ) );
  
    CreateWindow();
 -  CreateAdaptor();
  
 -  // Run the adaptor
 +#ifdef DALI_ELDBUS_AVAILABLE
 +  // Initialize ElDBus.
 +  DALI_LOG_INFO( gDBusLogging, Debug::General, "Starting DBus Initialization\n" );
 +  eldbus_init();
 +#endif
 +
 +  // Start the adaptor
 +  CreateAdaptor();
    mAdaptor->Start();
  
    // Check if user requires no vsyncing and set on X11 Adaptor
@@@ -369,6 -341,7 +369,7 @@@ void Application::ReplaceWindow(Positio
    Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
  
    Any nativeWindow = newWindow.GetNativeHandle();
+   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SurfaceSizeChanged( windowPosition );
    Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
    mWindow = newWindow;
  }