/*
- * 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.
// INTERNAL INCLUDES
#include <dali/integration-api/adaptor-framework/thread-synchronization-interface.h>
-#include <dali/integration-api/adaptor-framework/trigger-event-factory-interface.h>
+#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/adaptor/common/adaptor-internal-services.h>
#include <dali/internal/graphics/gles/egl-graphics.h>
{
delete mRotationTrigger;
}
-
- if ( mEGLSurface )
- {
- DestroySurface();
- }
}
void WindowRenderSurface::Initialize( Any surface )
if( !mRotationTrigger )
{
- TriggerEventFactoryInterface& triggerFactory = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTriggerEventFactoryInterface();
- mRotationTrigger = triggerFactory.CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
+ mRotationTrigger = TriggerEventFactory::CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
}
mPositionSize.width = width;
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()