/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize,
Any surface,
const std::string& name,
+ const std::string& className,
bool isTransparent)
: EcoreXRenderSurface( positionSize, surface, name, isTransparent ),
- mNeedToApproveDeiconify(false)
+ mX11Window( 0 ),
+ mNeedToApproveDeiconify(false),
+ mClassName(className)
{
DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
Init( surface );
Ecore_X_Drawable WindowRenderSurface::GetDrawable()
{
// already an e-core type
- return (Ecore_X_Drawable)mX11Window;
+ return static_cast< Ecore_X_Drawable >( mX11Window );
}
Any WindowRenderSurface::GetSurface()
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
// create the EGL surface
- // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
- XWindow window = static_cast< XWindow>( mX11Window );
- eglImpl.CreateSurfaceWindow( (EGLNativeWindowType)window, mColorDepth ); // reinterpret_cast does not compile
+ // need to create X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
+ XWindow window( mX11Window );
+ eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( window ), mColorDepth );
}
void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
- // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
- XWindow window = static_cast< XWindow >( mX11Window );
+ // need to create X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
+ XWindow window( mX11Window );
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
- return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)window ); // reinterpret_cast does not compile
+ return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( window ) );
}
void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
{
}
-bool WindowRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+bool WindowRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
{
// nothing to do for windows
return true;
}
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, unsigned int deltaTime, bool replacingSurface )
+void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
{
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.SwapBuffers();
// set up window title which will be helpful for debug utitilty
ecore_x_icccm_title_set( mX11Window, mTitle.c_str() );
ecore_x_netwm_name_set( mX11Window, mTitle.c_str() );
+ ecore_x_icccm_name_class_set( mX11Window, mTitle.c_str(), mClassName.c_str() );
// set up etc properties to match with ecore-evas
char *id = NULL;
mX11Window = static_cast< Ecore_X_Window >( surfaceId );
}
+void WindowRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& /* threadSynchronization */ )
+{
+ // Nothing to do.
+}
+
void WindowRenderSurface::ReleaseLock()
{
// Nothing to do.