/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
: mFpsTracker( environmentOptions ),
mUpdateStatusLogger( environmentOptions ),
mEventThreadSemaphore(),
+ mGraphicsInitializeSemaphore(),
mUpdateRenderThreadWaitCondition(),
mAdaptorInterfaces( adaptorInterfaces ),
mPerformanceInterface( adaptorInterfaces.GetPerformanceInterface() ),
TriggerEventFactoryInterface& triggerFactory = mAdaptorInterfaces.GetTriggerEventFactoryInterface();
mSleepTrigger = triggerFactory.CreateTriggerEvent( MakeCallback( this, &CombinedUpdateRenderController::ProcessSleepRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
- sem_init( &mEventThreadSemaphore, 0, 0 ); // Initialize to 0 so that it just waits if sem_post has not been called
+ // Initialize to 0 so that it just waits if sem_post has not been called
+ sem_init( &mEventThreadSemaphore, 0, 0 );
+ sem_init( &mGraphicsInitializeSemaphore, 0, 0 );
}
CombinedUpdateRenderController::~CombinedUpdateRenderController()
}
}
+void CombinedUpdateRenderController::WaitForGraphicsInitialization()
+{
+ LOG_EVENT_TRACE;
+
+ if( mUpdateRenderThread )
+ {
+ LOG_EVENT( "Waiting for graphics initialisation, event-thread blocked" );
+
+ // Wait until the graphics has been initialised
+ sem_wait( &mGraphicsInitializeSemaphore );
+
+ LOG_EVENT( "graphics initialised, event-thread continuing" );
+ }
+}
+
void CombinedUpdateRenderController::ResizeSurface()
{
LOG_EVENT_TRACE;
Dali::DisplayConnection& displayConnection = mAdaptorInterfaces.GetDisplayConnectionInterface();
displayConnection.Initialize();
+ // EGL has been initialised at this point
+ NotifyGraphicsInitialised();
+
RenderSurfaceInterface* currentSurface = nullptr;
GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface();
sem_post( &mEventThreadSemaphore );
}
+void CombinedUpdateRenderController::NotifyGraphicsInitialised()
+{
+ sem_post( &mGraphicsInitializeSemaphore );
+}
+
void CombinedUpdateRenderController::AddPerformanceMarker( PerformanceInterface::MarkerType type )
{
if( mPerformanceInterface )