newDefaultWindow.nativeWindow = nativeWindow;
newDefaultWindow.surface = &newSurface;
- // Must delete the old Window first before replacing it with the new one
WindowPane oldDefaultWindow = mWindowFrame.front();
- oldDefaultWindow.surface->DestroySurface();
// Update WindowFrame
std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
// This method blocks until the render thread has completed the replace.
mThreadController->ReplaceSurface( newDefaultWindow.surface );
+
+ // Must delete the old Window only after the render thread has completed the replace
+ oldDefaultWindow.surface->DestroySurface();
}
RenderSurface& Adaptor::GetSurface() const
}
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
- auto mGLES = eglGraphics->GetGlesInterface();
- mGLES.PreRender();
+ if ( eglGraphics )
+ {
+ GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+ mGLES.PreRender();
+ }
return true;
}
{
// Inform the gl implementation that rendering has finished before informing the surface
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
- auto mGLES = eglGraphics->GetGlesInterface();
- mGLES.PostRender();
-
- if( renderToFbo )
+ if ( eglGraphics )
{
- mGLES.Flush();
- mGLES.Finish();
- }
- else
- {
- if( resizingSurface )
+ GlImplementation& mGLES = eglGraphics->GetGlesInterface();
+ mGLES.PostRender();
+
+ if( renderToFbo )
{
- if( !mRotationFinished )
+ mGLES.Flush();
+ mGLES.Finish();
+ }
+ else
+ {
+ if( resizingSurface )
{
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+ if( !mRotationFinished )
+ {
+ DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
- mRotationTrigger->Trigger();
+ mRotationTrigger->Trigger();
- if( mThreadSynchronization )
- {
- // Wait until the event-thread complete the rotation event processing
- mThreadSynchronization->PostRenderWaitForCompletion();
+ if( mThreadSynchronization )
+ {
+ // Wait until the event-thread complete the rotation event processing
+ mThreadSynchronization->PostRenderWaitForCompletion();
+ }
}
}
}
- }
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers();
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ eglImpl.SwapBuffers();
- if( mRenderNotification )
- {
- mRenderNotification->Trigger();
+ if( mRenderNotification )
+ {
+ mRenderNotification->Trigger();
+ }
}
}
NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent )
: mPosition( positionSize ),
mRenderNotification( NULL ),
+ mGraphics( NULL ),
mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
mOwnSurface( false ),
void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
{
auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+ if ( eglGraphics )
+ {
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.SwapBuffers();
+ eglImpl.SwapBuffers();
+ }
if( mThreadSynchronization )
{