/*
- * 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.
{
delete mRotationTrigger;
}
-
- if ( mEGLSurface )
- {
- DestroySurface();
- }
}
void WindowRenderSurface::Initialize( Any surface )
void WindowRenderSurface::InitializeGraphics()
{
-
mGraphics = &mAdaptor->GetGraphicsInterface();
+ DALI_ASSERT_ALWAYS( mGraphics && "Graphics interface is not created" );
+
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
mEGL = &eglGraphics->GetEglInterface();
DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ if( eglGraphics )
+ {
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() );
- DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() );
+ Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
- eglImpl.DestroySurface( mEGLSurface );
+ eglImpl.DestroySurface( mEGLSurface );
+ mEGLSurface = nullptr;
- mWindowBase->DestroyEglWindow();
+ // Destroy context also
+ eglImpl.DestroyContext( mEGLContext );
+ mEGLContext = nullptr;
+
+ mWindowBase->DestroyEglWindow();
+ }
}
bool WindowRenderSurface::ReplaceGraphicsSurface()
// Nothing to do.
}
-Integration::RenderSurface::Type WindowRenderSurface::GetSurfaceType()
+Dali::RenderSurfaceInterface::Type WindowRenderSurface::GetSurfaceType()
{
- return RenderSurface::WINDOW_RENDER_SURFACE;
+ return Dali::RenderSurfaceInterface::WINDOW_RENDER_SURFACE;
}
void WindowRenderSurface::MakeContextCurrent()