mCallbackManager = CallbackManager::New();
- SceneHolderPtr defaultWindow = mWindows.front();
+ Dali::Internal::Adaptor::SceneHolder* defaultWindow = mWindows.front();
DALI_ASSERT_DEBUG( defaultWindow->GetSurface() && "Surface not initialized" );
GlImplementation& mGLES = eglGraphics->GetGlesInterface();
EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
+ EglContextHelperImplementation& eglContextHelperImpl = eglGraphics->GetContextHelperImplementation();
mCore = Integration::Core::New( *this,
*mPlatformAbstraction,
mGLES,
eglSyncImpl,
+ eglContextHelperImpl,
dataRetentionPolicy ,
( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
mGraphics->GetDepthBufferRequired(),
defaultWindow->SetAdaptor( Get() );
- Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( ( &defaultWindow )->Get() ) );
+ Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( defaultWindow ) );
if ( window )
{
mWindowCreatedSignal.Emit( window );
// Start the callback manager
mCallbackManager->Start();
- SceneHolderPtr defaultWindow = mWindows.front();
+ Dali::Internal::Adaptor::SceneHolder* defaultWindow = mWindows.front();
unsigned int dpiHor, dpiVer;
dpiHor = dpiVer = 0;
FontClient fontClient = FontClient::Get();
fontClient.SetDpi( dpiHor, dpiVer );
- // Tell the core the size of the surface just before we start the render-thread
- mCore->SurfaceResized( defaultWindow->GetSurface() );
-
// Initialize the thread controller
mThreadController->Initialize();
}
// Pause all windows event handlers when adaptor paused
- for( SceneHolderPtr window : mWindows )
+ for( auto window : mWindows )
{
window->Pause();
}
mState = RUNNING;
// Reset the event handlers when adaptor resumed
- for( SceneHolderPtr window : mWindows )
+ for( auto window : mWindows )
{
window->Resume();
}
void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& newSurface )
{
Internal::Adaptor::SceneHolder* windowImpl = &Dali::GetImplementation( window );
- for( SceneHolderPtr windowPtr : mWindows )
+ for( auto windowPtr : mWindows )
{
- if( windowPtr.Get() == windowImpl ) // the window is not deleted
+ if( windowPtr == windowImpl ) // the window is not deleted
{
- // Let the core know the surface size has changed
- mCore->SurfaceResized( &newSurface );
-
mResizedSignal.Emit( mAdaptor );
windowImpl->SetSurface( &newSurface );
}
}
+void Adaptor::DeleteSurface( Dali::RenderSurfaceInterface& surface )
+{
+ // Flush the event queue to give the update-render thread chance
+ // to start processing messages for new camera setup etc as soon as possible
+ ProcessCoreEvents();
+
+ // This method blocks until the render thread has finished rendering the current surface.
+ mThreadController->DeleteSurface( &surface );
+}
+
Dali::RenderSurfaceInterface& Adaptor::GetSurface() const
{
return *mWindows.front()->GetSurface();
windowImpl.SetAdaptor( Get() );
// Add the new Window to the container - the order is not important
- mWindows.push_back( SceneHolderPtr( &windowImpl ) );
+ mWindows.push_back( &windowImpl );
Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( &windowImpl ) );
if ( window )
{
bool allWindowsHidden = true;
- for( SceneHolderPtr window : mWindows )
+ for( auto window : mWindows )
{
if ( window->IsVisible() )
{
void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
{
- // Let the core know the surface size has changed
- mCore->SurfaceResized( surface );
-
mResizedSignal.Emit( mAdaptor );
}
{
if ( scene == window->GetScene() )
{
- return window.Get();
+ return window;
}
}
for ( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter )
{
// Downcast to Dali::Window
- Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( iter->Get() ) );
+ Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( *iter ) );
if ( window )
{
windows.push_back( window );
mUseRemoteSurface( false )
{
DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" );
- mWindows.insert( mWindows.begin(), SceneHolderPtr( &Dali::GetImplementation( window ) ) );
+ mWindows.insert( mWindows.begin(), &Dali::GetImplementation( window ) );
gThreadLocalAdaptor = this;
}