#include <dali/internal/adaptor/common/adaptor-builder-impl.h>
// EXTERNAL INCLUDES
+#include <errno.h>
+#include <sys/stat.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/object/any.h>
GetDataStoragePath( path );
mPlatformAbstraction->SetDataStoragePath( path );
- ResourcePolicy::DataRetention dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
- if( configuration == Dali::Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS )
- {
- dataRetentionPolicy = ResourcePolicy::DALI_DISCARDS_ALL_DATA;
- }
-
- // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from files automatically.
-
if( mEnvironmentOptions->PerformanceServerRequired() )
{
mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, *mEnvironmentOptions );
mGLES,
eglSyncImpl,
eglContextHelperImpl,
- dataRetentionPolicy ,
( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
mGraphics->GetDepthBufferRequired(),
mGraphics->GetStencilBufferRequired() );
mObjectProfiler = new ObjectProfiler( timeInterval );
}
- mNotificationTrigger = mTriggerEventFactory.CreateTriggerEvent( MakeCallback( this, &Adaptor::ProcessCoreEvents ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
+ mNotificationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &Adaptor::ProcessCoreEvents ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER);
mDisplayConnection = Dali::DisplayConnection::New( *mGraphics, defaultWindow->GetSurface()->GetSurfaceType() );
std::string systemCachePath = GetSystemCachePath();
if( ! systemCachePath.empty() )
{
- const int dir_err = system( std::string( "mkdir " + systemCachePath ).c_str() );
- if (-1 == dir_err)
+ const int dir_err = mkdir( systemCachePath.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH );
+ if ( 0 != dir_err && errno != EEXIST )
{
- printf( "Error creating system cache directory: %s!\n", systemCachePath.c_str() );
- exit(1);
+ DALI_LOG_ERROR( "Error creating system cache directory: %s!\n", systemCachePath.c_str() );
+ exit( 1 );
}
}
}
}
-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();
mCallbackManager->RemoveIdleCallback( callback );
}
+void Adaptor::ProcessIdle()
+{
+ bool idleProcessed = mCallbackManager->ProcessIdle();
+ mNotificationOnIdleInstalled = mNotificationOnIdleInstalled && !idleProcessed;
+}
+
void Adaptor::SetPreRenderCallback( CallbackBase* callback )
{
mThreadController->SetPreRenderCallback( callback );
// Add the new Window to the container - the order is not important
mWindows.push_back( &windowImpl );
+ Dali::RenderSurfaceInterface* surface = windowImpl.GetSurface();
+
+ mThreadController->AddSurface( surface );
+
mWindowCreatedSignal.Emit( childWindow );
return true;
return *mNotificationTrigger;
}
-TriggerEventFactoryInterface& Adaptor::GetTriggerEventFactoryInterface()
-{
- return mTriggerEventFactory;
-}
-
SocketFactoryInterface& Adaptor::GetSocketFactoryInterface()
{
return mSocketFactory;
return *mPlatformAbstraction;
}
+void Adaptor::GetWindowContainerInterface( WindowContainer& windows )
+{
+ windows = mWindows;
+}
+
void Adaptor::DestroyTtsPlayer(Dali::TtsPlayer::Mode mode)
{
if( mTtsPlayers[mode] )
void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
{
+ // Nofify surface resizing before flushing event queue
+ mThreadController->ResizeSurface();
+
// 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();
-
- mThreadController->ResizeSurface();
}
void Adaptor::NotifySceneCreated()
return mConfigurationManager->IsMultipleWindowSupported();
}
+bool Adaptor::IsRenderingWindows() const
+{
+ return ( mThreadController && mThreadController->IsRenderingWindows() );
+}
+
void Adaptor::RequestUpdateOnce()
{
if( mThreadController )
mPerformanceInterface( nullptr ),
mKernelTracer(),
mSystemTracer(),
- mTriggerEventFactory(),
mObjectProfiler( nullptr ),
mSocketFactory(),
mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ),