namespace
{
-__thread Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
+thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
} // unnamed namespace
Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
Dali::Adaptor* Adaptor::New( Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
{
Any winId = window.GetNativeHandle();
-
Window& windowImpl = Dali::GetImplementation(window);
Dali::Adaptor* adaptor = New( winId, windowImpl.GetSurface(), configuration, environmentOptions );
windowImpl.SetAdaptor(*adaptor);
void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
{
+ PositionSize positionSize = surface.GetPositionSize();
+
+ // let the core know the surface size has changed
+ mCore->SurfaceResized( positionSize.width, positionSize.height );
+
+ mResizedSignal.Emit( mAdaptor );
+
mNativeWindow = nativeWindow;
mSurface = &surface;
- // flush the event queue to give update and render threads chance
+ // 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();
RequestUpdate();
}
-void Adaptor::SurfaceSizeChanged( Dali::Adaptor::SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize )
{
// let the core know the surface size has changed
mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
mResizedSignal.Emit( mAdaptor );
}
+void Adaptor::SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize )
+{
+ // 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 completed the resizing.
+ mThreadController->ResizeSurface();
+}
+
void Adaptor::NotifySceneCreated()
{
GetCore().SceneCreated();