mPendingRequestUpdate( FALSE ),
mUseElapsedTimeAfterWait( FALSE ),
mNewSurface( NULL ),
- mPostRendering( FALSE )
+ mPostRendering( FALSE ),
+ mSurfaceResized( FALSE )
{
LOG_EVENT_TRACE;
LOG_EVENT( "Surface replaced, event-thread continuing" );
}
+void CombinedUpdateRenderController::ResizeSurface()
+{
+ LOG_EVENT_TRACE;
+
+ LOG_EVENT( "Starting to resize the surface, event-thread blocked" );
+
+ // Start resizing the surface.
+ {
+ ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
+ mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will resize the surface now
+ mSurfaceResized = TRUE;
+ mUpdateRenderThreadWaitCondition.Notify( lock );
+ }
+
+ // Wait until the surface has been resized
+ sem_wait( &mEventThreadSemaphore );
+
+ LOG_EVENT( "Surface resized, event-thread continuing" );
+}
+
void CombinedUpdateRenderController::SetRenderRefreshRate( unsigned int numberOfFramesPerRender )
{
// Not protected by lock, but written to rarely so not worth adding a lock when reading
}
//////////////////////////////
+ // RESIZE SURFACE
+ //////////////////////////////
+
+ // The resizing will be applied in the next loop
+ bool surfaceResized = ShouldSurfaceBeResized();
+ if( DALI_UNLIKELY( surfaceResized ) )
+ {
+ LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
+ mRenderHelper.ResizeSurface();
+ SurfaceResized();
+ }
+
+ //////////////////////////////
// UPDATE
//////////////////////////////
while( ( ! mUpdateRenderRunCount || // Should try to wait if event-thread has paused the Update/Render thread
( mUpdateRenderThreadCanSleep && ! updateRequired && ! mPendingRequestUpdate ) ) && // Ensure we wait if we're supposed to be sleeping AND do not require another update
! mDestroyUpdateRenderThread && // Ensure we don't wait if the update-render-thread is supposed to be destroyed
- ! mNewSurface ) // Ensure we don't wait if we need to replace the surface
+ ! mNewSurface && // Ensure we don't wait if we need to replace the surface
+ ! mSurfaceResized ) // Ensure we don't wait if we need to resize the surface
{
LOG_UPDATE_RENDER( "WAIT: mUpdateRenderRunCount: %d", mUpdateRenderRunCount );
LOG_UPDATE_RENDER( " mUpdateRenderThreadCanSleep: %d, updateRequired: %d, mPendingRequestUpdate: %d", mUpdateRenderThreadCanSleep, updateRequired, mPendingRequestUpdate );
LOG_UPDATE_RENDER( " mDestroyUpdateRenderThread: %d", mDestroyUpdateRenderThread );
LOG_UPDATE_RENDER( " mNewSurface: %d", mNewSurface );
+ LOG_UPDATE_RENDER( " mSurfaceResized: %d", mSurfaceResized );
// Reset the time when the thread is waiting, so the sleep-until time for
// the first frame after resuming should be based on the actual start time
LOG_COUNTER_UPDATE_RENDER( "mUpdateRenderThreadCanSleep: %d, updateRequired: %d, mPendingRequestUpdate: %d", mUpdateRenderThreadCanSleep, updateRequired, mPendingRequestUpdate );
LOG_COUNTER_UPDATE_RENDER( "mDestroyUpdateRenderThread: %d", mDestroyUpdateRenderThread );
LOG_COUNTER_UPDATE_RENDER( "mNewSurface: %d", mNewSurface );
+ LOG_COUNTER_UPDATE_RENDER( "mSurfaceResized: %d", mSurfaceResized );
mUseElapsedTimeAfterWait = FALSE;
mUpdateRenderThreadCanSleep = FALSE;
sem_post( &mEventThreadSemaphore );
}
+bool CombinedUpdateRenderController::ShouldSurfaceBeResized()
+{
+ ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
+
+ bool surfaceSized = mSurfaceResized;
+ mSurfaceResized = FALSE;
+
+ return surfaceSized;
+}
+
+void CombinedUpdateRenderController::SurfaceResized()
+{
+ // Just increment the semaphore
+ sem_post( &mEventThreadSemaphore );
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// ALL THREADS
///////////////////////////////////////////////////////////////////////////////////////////////////
ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
while( mPostRendering &&
! mNewSurface && // We should NOT wait if we're replacing the surface
+ ! mSurfaceResized && // We should NOT wait if we're resizing the surface
! mDestroyUpdateRenderThread )
{
mUpdateRenderThreadWaitCondition.Wait( lock );
#define __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
/*
- * Copyright (c) 2015 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.
virtual void ReplaceSurface( RenderSurface* surface );
/**
+ * @copydoc ThreadControllerInterface::ResizeSurface()
+ */
+ virtual void ResizeSurface();
+
+ /**
* @copydoc ThreadControllerInterface::SetRenderRefreshRate()
*/
virtual void SetRenderRefreshRate( unsigned int numberOfFramesPerRender );
void SurfaceReplaced();
/**
+ * Checks to see if the surface needs to be resized.
+ * This will lock the mutex in mUpdateRenderThreadWaitCondition.
+ *
+ * @return true if the surface should be resized, false otherwise
+ */
+ bool ShouldSurfaceBeResized();
+
+ /**
+ * Called by the Update/Render thread after a surface has been resized.
+ *
+ * This will lock the mutex in mEventThreadWaitCondition
+ */
+ void SurfaceResized();
+
+ /**
* Helper for the thread calling the entry function
* @param[in] This A pointer to the current object
*/
RenderSurface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
volatile unsigned int mPostRendering; ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
+ volatile unsigned int mSurfaceResized; ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
};
} // namespace Adaptor
/*
- * Copyright (c) 2015 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.
: mGLES( adaptorInterfaces.GetGlesInterface() ),
mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
mEGL( NULL ),
- mSurfaceReplaced( false )
+ mSurfaceReplaced( false ),
+ mSurfaceResized( false )
{
// set the initial values before render thread starts
mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
mSurfaceReplaced = true;
}
+void RenderHelper::ResizeSurface()
+{
+ mSurfaceResized = true;
+}
+
void RenderHelper::ShutdownEgl()
{
if( mSurface )
{
if( mSurface )
{
- mSurface->PreRender( *mEGL, mGLES );
+ mSurface->PreRender( *mEGL, mGLES, mSurfaceResized );
}
mGLES.PreRender();
return true;
if( mSurface )
{
// Inform the surface that rendering this frame has finished.
- mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced );
+ mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
}
mSurfaceReplaced = false;
+ mSurfaceResized = false;
}
} // namespace Adaptor
#define __DALI_INTERNAL_RENDER_HELPER_H__
/*
- * Copyright (c) 2015 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.
void ReplaceSurface( RenderSurface* newSurface );
/**
+ * Resize the rendering surface.
+ *
+ * @note Called from render thread
+ */
+ void ResizeSurface();
+
+ /**
* Shuts down EGL.
*
* @note Called from render thread
RenderSurface* mSurface; ///< Current surface
Dali::DisplayConnection* mDisplayConnection; ///< Display connection
bool mSurfaceReplaced; ///< True when new surface has been initialized.
+ bool mSurfaceResized; ///< True when the surface is resized.
};
} // namespace Adaptor
mThreadSync->ReplaceSurface( newSurface );
}
+void SeparateUpdateRenderController::ResizeSurface()
+{
+ DALI_LOG_ERROR( "SeparateUpdateRenderController::ResizeSurface: Not supported\n" );
+}
+
void SeparateUpdateRenderController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
{
mNumberOfVSyncsPerRender = numberOfVSyncsPerRender;
#define __DALI_INTERNAL_MULTI_THREAD_CONTROLLER_H__
/*
- * Copyright (c) 2015 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.
void ReplaceSurface( RenderSurface* surface );
/**
+ * @copydoc ThreadControllerInterface::ResizeSurface()
+ */
+ virtual void ResizeSurface();
+
+ /**
* @copydoc ThreadControllerInterface::SetRenderRefreshRate()
*/
void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
mRenderHelper.ReplaceSurface( newSurface );
}
+void SingleThreadController::ResizeSurface()
+{
+ DALI_LOG_ERROR( "SingleThreadController::ResizeSurface: Not supported\n" );
+}
+
void SingleThreadController::SetRenderRefreshRate( unsigned int refreshRate )
{
if ( refreshRate != mRefreshRate )
void ReplaceSurface( RenderSurface* surface );
/**
+ * @copydoc ThreadControllerInterface::ResizeSurface()
+ */
+ virtual void ResizeSurface();
+
+ /**
* @copydoc ThreadControllerInterface::SetRenderRefreshRate()
*/
void SetRenderRefreshRate( unsigned int refreshRate );
#define __DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H__
/*
- * Copyright (c) 2015 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.
virtual void ReplaceSurface( RenderSurface* surface ) = 0;
/**
+ * Resize the surface.
+ */
+ virtual void ResizeSurface() = 0;
+
+ /**
* @copydoc Dali::Adaptor::SetRenderRefreshRate()
*/
virtual void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) = 0;
/*
- * Copyright (c) 2015 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.
mThreadControllerInterface->ReplaceSurface( newSurface );
}
+void ThreadController::ResizeSurface()
+{
+ mThreadControllerInterface->ResizeSurface();
+}
+
void ThreadController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
{
mThreadControllerInterface->SetRenderRefreshRate( numberOfVSyncsPerRender );
#define __DALI_INTERNAL_THREAD_CONTROLLER_H__
/*
- * Copyright (c) 2015 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.
void ReplaceSurface( RenderSurface* surface );
/**
+ * Resize the surface.
+ */
+ void ResizeSurface();
+
+ /**
* @copydoc Dali::Adaptor::SetRenderRefreshRate()
*/
void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
/*
- * Copyright (c) 2016 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.
// INTERNAL INCLUDES
#include <base/thread-controller.h>
-# include <base/performance-logging/performance-interface-factory.h>
+#include <base/performance-logging/performance-interface-factory.h>
#include <base/lifecycle-observer.h>
#include <dali/devel-api/text-abstraction/font-client.h>
mEventHandler->FeedKeyEvent( keyEvent );
}
-bool Adaptor::MoveResize( const PositionSize& positionSize )
-{
- PositionSize old = mSurface->GetPositionSize();
-
- // just resize the surface. The driver should automatically resize the egl Surface (untested)
- // EGL Spec says : EGL window surfaces need to be resized when their corresponding native window
- // is resized. Implementations typically use hooks into the OS and native window
- // system to perform this resizing on demand, transparently to the client.
- mSurface->MoveResize( positionSize );
-
- if(old.width != positionSize.width || old.height != positionSize.height)
- {
- SurfaceSizeChanged(positionSize);
- }
-
- return true;
-}
-
-void Adaptor::SurfaceResized( const PositionSize& positionSize )
+void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
{
- PositionSize old = mSurface->GetPositionSize();
+ PositionSize positionSize = surface.GetPositionSize();
- // Called by an application, when it has resized a window outside of Dali.
- // The EGL driver automatically detects X Window resize calls, and resizes
- // the EGL surface for us.
- mSurface->MoveResize( positionSize );
+ // let the core know the surface size has changed
+ mCore->SurfaceResized( positionSize.width, positionSize.height );
- if(old.width != positionSize.width || old.height != positionSize.height)
- {
- SurfaceSizeChanged(positionSize);
- }
-}
+ mResizedSignal.Emit( mAdaptor );
-void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
-{
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();
void Adaptor::SurfaceSizeChanged( const PositionSize& positionSize )
{
+ // Should keep this api in this version
+
// let the core know the surface size has changed
mCore->SurfaceResized(positionSize.width, positionSize.height);
mResizedSignal.Emit( mAdaptor );
}
+void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
+{
+ // let the core know the surface size has changed
+ mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
+
+ mResizedSignal.Emit( mAdaptor );
+}
+
+void Adaptor::SurfaceResizeComplete( 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();
#define __DALI_INTERNAL_ADAPTOR_IMPL_H__
/*
- * Copyright (c) 2016 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.
#include <dali/public-api/common/view-mode.h>
#include <dali/public-api/math/rect.h>
#include <dali/public-api/signals/callback.h>
+#include <dali/public-api/math/uint-16-pair.h>
#include <dali/integration-api/render-controller.h>
// INTERNAL INCLUDES
typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
+ typedef Uint16Pair SurfaceSize; ///< Surface size type
+
/**
* Creates a New Adaptor
* @param[in] nativeWindow Native window handle
virtual void FeedKeyEvent( KeyEvent& keyEvent );
/**
- * @copydoc AdaptorInterface::MoveResize()
- */
- virtual bool MoveResize( const PositionSize& positionSize );
-
- /**
- * @copydoc AdaptorInterface::SurfaceResized()
- */
- virtual void SurfaceResized( const PositionSize& positionSize );
-
- /**
* @copydoc AdaptorInterface::ReplaceSurface()
*/
virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
*/
void SurfaceSizeChanged( const PositionSize& positionSize );
+ /**
+ * Informs core the surface size has changed
+ */
+ void SurfaceResizePrepare( SurfaceSize surfaceSize );
+
+ /**
+ * Informs ThreadController the surface size has changed
+ */
+ void SurfaceResizeComplete( SurfaceSize surfaceSize );
+
public: //AdaptorInternalServices
/**
Any mNativeWindow; ///< window identifier
RenderSurface* mSurface; ///< Current surface
- TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
+ TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
EventHandler* mEventHandler; ///< event handler
CallbackManager* mCallbackManager; ///< Used to install callbacks
/*
- * Copyright (c) 2016 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.
{
mSingletonService.UnregisterAll();
- delete mFramework;
- delete mCommandLineOptions;
- delete mAdaptor;
-
mWindow.Reset();
+ delete mAdaptor;
+ delete mCommandLineOptions;
+ delete mFramework;
}
void Application::CreateWindow()
Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
Any nativeWindow = newWindow.GetNativeHandle();
- Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SurfaceSizeChanged( windowPosition );
Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
mWindow = newWindow;
}
#define __DALI_INTERNAL_WINDOW_H__
/*
- * 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.
/**
* Create a new Window. This should only be called once by the Application class
- * @param[in] windowPosition The position and size of the window
+ * @param[in] positionSize The position and size of the window
* @param[in] name The window title
* @param[in] className The window class name
* @param[in] isTransparent Whether window is transparent
* @return A newly allocated Window
*/
- static Window* New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent = false);
+ static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
/**
* Pass the adaptor back to the overlay. This allows the window to access Core's overlay.
*/
Dali::Any GetNativeHandle() const;
+ unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value );
+
/**
* Called from Orientation after the Change signal has been sent
*/
/**
* Second stage initialization
*/
- void Initialize(const PositionSize& posSize, const std::string& name, const std::string& className);
+ void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
/**
* Shows / hides the indicator bar.
private:
- typedef std::vector< IndicatorInterface * > DiscardedIndicators;
+ typedef std::vector< std::pair< std::string, std::string > > AuxiliaryHints;
RenderSurface* mSurface;
Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
bool mIsTransparent:1;
bool mWMRotationAppSet:1;
bool mEcoreEventHander:1;
+ bool mResizeEnabled:1;
IndicatorInterface* mIndicator;
Dali::Window::WindowOrientation mIndicatorOrientation;
Dali::Window::WindowOrientation mNextIndicatorOrientation;
std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
Dali::Window::WindowOrientation mPreferredOrientation;
+ std::vector< std::string > mSupportedAuxiliaryHints;
+ AuxiliaryHints mAuxiliaryHints;
+
// Signals
IndicatorSignalType mIndicatorVisibilityChangedSignal;
SignalType mDeleteRequestSignal;
#define __DALI_RENDER_SURFACE_H__
/*
- * Copyright (c) 2015 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.
* a surface to render onto.
* @param[in] egl The Egl interface
* @param[in] glAbstraction OpenGLES abstraction interface
+ * @param[in] resizingSurface True if the surface is being resized
* @return True if the operation is successful, False if the operation failed
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
/**
* @brief Invoked by render thread after Core::Render
* @param[in] glAbstraction OpenGLES abstraction interface
* @param[in] displayConnection display connection
* @param[in] replacingSurface True if the surface is being replaced.
+ * @param[in] resizingSurface True if the surface is being resized.
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) = 0;
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
/**
* @brief Invoked by render thread when the thread should be stop
/*
- * Copyright (c) 2015 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.
Impl( EventHandler* handler, Ecore_Wl_Window* window )
: mHandler( handler ),
mEcoreEventHandler(),
- mWindow( window )
+ mWindow( window ),
+ mRotationAngle( 0 ),
+ mWindowWidth( 0 ),
+ mWindowHeight( 0 )
#ifdef DALI_ELDBUS_AVAILABLE
, mSystemConnection( NULL )
#endif // DALI_ELDBUS_AVAILABLE
RotationEvent rotationEvent;
rotationEvent.angle = ev->angle;
rotationEvent.winResize = 0;
- rotationEvent.width = ev->w;
- rotationEvent.height = ev->h;
+
+ if( ev->angle == 0 || ev->angle == 180 )
+ {
+ rotationEvent.width = ev->w;
+ rotationEvent.height = ev->h;
+ }
+ else
+ {
+ rotationEvent.width = ev->h;
+ rotationEvent.height = ev->w;
+ }
+
handler->SendRotationPrepareEvent( rotationEvent );
return ECORE_CALLBACK_PASS_ON;
handler->SendEvent( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
}
+ void ConvertTouchPosition( Integration::Point& point )
+ {
+ Vector2 position = point.GetScreenPosition();
+ Vector2 convertedPosition;
+
+ switch( mRotationAngle )
+ {
+ case 90:
+ {
+ convertedPosition.x = mWindowWidth - position.y;
+ convertedPosition.y = position.x;
+ break;
+ }
+ case 180:
+ {
+ convertedPosition.x = mWindowWidth - position.x;
+ convertedPosition.y = mWindowHeight - position.y;
+ break;
+ }
+ case 270:
+ {
+ convertedPosition.x = position.y;
+ convertedPosition.y = mWindowHeight - position.x;
+ break;
+ }
+ default:
+ {
+ convertedPosition = position;
+ break;
+ }
+ }
+
+ point.SetScreenPosition( convertedPosition );
+ }
+
// Data
EventHandler* mHandler;
std::vector<Ecore_Event_Handler*> mEcoreEventHandler;
Ecore_Wl_Window* mWindow;
+ int mRotationAngle;
+ int mWindowWidth;
+ int mWindowHeight;
#ifdef DALI_ELDBUS_AVAILABLE
Eldbus_Connection* mSystemConnection;
#endif // DALI_ELDBUS_AVAILABLE
timeStamp = GetCurrentMilliSeconds();
}
+ mImpl->ConvertTouchPosition( point );
+
Integration::TouchEvent touchEvent;
Integration::HoverEvent hoverEvent;
Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
if(type != Integration::TouchEventCombiner::DispatchNone )
{
- DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetLocalPosition().x, point.GetLocalPosition().y);
+ DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y);
// First the touch and/or hover event & related gesture events are queued
if(type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth)
{
if( mRotationObserver != NULL )
{
+ mImpl->mRotationAngle = event.angle;
+ mImpl->mWindowWidth = event.width;
+ mImpl->mWindowHeight = event.height;
+
mRotationObserver->OnRotationPrepare( event );
mRotationObserver->OnRotationRequest();
}
// FIXME
}
-bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
{
// nothing to do for pixmaps
return true;
}
-void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
{
// flush gl instruction queue
glAbstraction.Flush();
void PixmapRenderSurface::CreateWlRenderable()
{
// check we're creating one with a valid size
- DALI_ASSERT_ALWAYS( mPosition.width > 0 && mPosition.height > 0 && "Pixmap size is invalid" );
+ DALI_ASSERT_ALWAYS( mPositionSize.width > 0 && mPositionSize.height > 0 && "Pixmap size is invalid" );
// FIXME
}
/*
- * 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.
{
#if defined(DEBUG_ENABLED)
-Debug::Filter* gRenderSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, false, "LOG_ECORE_X_RENDER_SURFACE");
+Debug::Filter* gRenderSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, false, "LOG_ECORE_WL_RENDER_SURFACE");
#endif
namespace ECore
Any surface,
const std::string& name,
bool isTransparent)
-: mPosition(positionSize),
- mTitle(name),
- mRenderNotification(NULL),
- mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24),
- mOwnSurface(false)
+: mPositionSize( positionSize ),
+ mTitle( name ),
+ mRenderNotification( NULL ),
+ mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
+ mOwnSurface( false )
{
}
PositionSize EcoreWlRenderSurface::GetPositionSize() const
{
- return mPosition;
+ return mPositionSize;
}
void EcoreWlRenderSurface::MoveResize( Dali::PositionSize positionSize )
/*
- * 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.
*/
// CLASS HEADER
-#include "window-impl.h"
+#include <window-impl.h>
// EXTERNAL HEADERS
#include <Ecore.h>
#include <ecore-indicator-impl.h>
#include <window-visibility-observer.h>
#include <orientation-impl.h>
+
namespace
{
const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds
*/
EventHandler( Window* window )
: mWindow( window ),
- mWindowPropertyHandler( NULL ),
- mWindowIconifyStateHandler( NULL ),
+ mEcoreEventHandler(),
mEcoreWindow( 0 )
{
// store ecore window handle
#ifndef DALI_PROFILE_UBUNTU
if( mWindow->mEcoreEventHander )
{
- mWindowIconifyStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this );
+ mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ) );
+ mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this) );
+ mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this) );
}
#endif
*/
~EventHandler()
{
- if ( mWindowPropertyHandler )
- {
- ecore_event_handler_del( mWindowPropertyHandler );
- }
- if ( mWindowIconifyStateHandler )
+ for( Dali::Vector< Ecore_Event_Handler* >::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter )
{
- ecore_event_handler_del( mWindowIconifyStateHandler );
+ ecore_event_handler_del( *iter );
}
+ mEcoreEventHandler.Clear();
}
// Static methods
- /// Called when the window properties are changed.
- static Eina_Bool EcoreEventWindowPropertyChanged( void* data, int type, void* event )
- {
- return EINA_FALSE;
- }
-
#ifndef DALI_PROFILE_UBUNTU
/// Called when the window iconify state is changed.
static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event )
{
- Ecore_Wl_Event_Window_Iconify_State_Change* iconifyChangedEvent( (Ecore_Wl_Event_Window_Iconify_State_Change*)event );
- EventHandler* handler( (EventHandler*)data );
+ Ecore_Wl_Event_Window_Iconify_State_Change* iconifyChangedEvent( static_cast< Ecore_Wl_Event_Window_Iconify_State_Change* >( event ) );
+ EventHandler* handler( static_cast< EventHandler* >( data ) );
Eina_Bool handled( ECORE_CALLBACK_PASS_ON );
if ( handler && handler->mWindow )
{
WindowVisibilityObserver* observer( handler->mWindow->mAdaptor );
- if ( observer && ( iconifyChangedEvent->win == (unsigned int) ecore_wl_window_id_get( handler->mEcoreWindow ) ) )
+ if ( observer && ( iconifyChangedEvent->win == static_cast< unsigned int> ( ecore_wl_window_id_get( handler->mEcoreWindow ) ) ) )
{
if( iconifyChangedEvent->iconified == EINA_TRUE )
{
return handled;
}
+
+ /// Called when the output is transformed
+ static Eina_Bool EcoreEventOutputTransform( void* data, int type, void* event )
+ {
+ Ecore_Wl_Event_Output_Transform* transformEvent( static_cast< Ecore_Wl_Event_Output_Transform* >( event ) );
+ EventHandler* handler( static_cast< EventHandler* >( data ) );
+
+ if ( handler && handler->mWindow && transformEvent->output == ecore_wl_window_output_find( handler->mEcoreWindow ) )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventOutputTransform\n", handler->mEcoreWindow );
+
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
+ if( wlSurface )
+ {
+ wlSurface->OutputTransformed();
+
+ PositionSize positionSize = wlSurface->GetPositionSize();
+ handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ }
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ /// Called when the output transform should be ignored
+ static Eina_Bool EcoreEventIgnoreOutputTransform( void* data, int type, void* event )
+ {
+ Ecore_Wl_Event_Ignore_Output_Transform* ignoreTransformEvent( static_cast< Ecore_Wl_Event_Ignore_Output_Transform* >( event ) );
+ EventHandler* handler( static_cast< EventHandler* >( data ) );
+
+ if ( handler && handler->mWindow && ignoreTransformEvent->win == handler->mEcoreWindow )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow );
+
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
+ if( wlSurface )
+ {
+ wlSurface->OutputTransformed();
+
+ PositionSize positionSize = wlSurface->GetPositionSize();
+ handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ }
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+ }
#endif
// Data
Window* mWindow;
- Ecore_Event_Handler* mWindowPropertyHandler;
- Ecore_Event_Handler* mWindowIconifyStateHandler;
+ Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler;
Ecore_Wl_Window* mEcoreWindow;
};
-Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name, className);
+ window->Initialize( positionSize, name, className );
return window;
}
}
Window::Window()
-: mSurface(NULL),
- mIndicatorVisible(Dali::Window::VISIBLE),
- mIndicatorIsShown(false),
- mShowRotatedIndicatorOnClose(false),
- mStarted(false),
- mIsTransparent(false),
- mWMRotationAppSet(false),
- mEcoreEventHander(true),
- mIndicator(NULL),
- mIndicatorOrientation(Dali::Window::PORTRAIT),
- mNextIndicatorOrientation(Dali::Window::PORTRAIT),
- mIndicatorOpacityMode(Dali::Window::OPAQUE),
- mOverlay(NULL),
- mAdaptor(NULL),
- mEventHandler(NULL),
- mPreferredOrientation(Dali::Window::PORTRAIT)
+: mSurface( NULL ),
+ mIndicatorVisible( Dali::Window::VISIBLE ),
+ mIndicatorIsShown( false ),
+ mShowRotatedIndicatorOnClose( false ),
+ mStarted( false ),
+ mIsTransparent( false ),
+ mWMRotationAppSet( false ),
+ mEcoreEventHander( true ),
+ mResizeEnabled( false ),
+ mIndicator( NULL ),
+ mIndicatorOrientation( Dali::Window::PORTRAIT ),
+ mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
+ mIndicatorOpacityMode( Dali::Window::OPAQUE ),
+ mOverlay( NULL ),
+ mAdaptor( NULL ),
+ mEventHandler( NULL ),
+ mPreferredOrientation( Dali::Window::PORTRAIT ),
+ mSupportedAuxiliaryHints(),
+ mAuxiliaryHints()
{
}
}
delete mSurface;
+
+ mSupportedAuxiliaryHints.clear();
+ mAuxiliaryHints.clear();
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
+void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
{
// create an Wayland window by default
Any surface;
- ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+ ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( positionSize, surface, name, mIsTransparent );
mSurface = windowSurface;
+
+ // create event handler for Wayland window
+ mEventHandler = new EventHandler( this );
+
+ // get auxiliary hint
+ Eina_List* hints = ecore_wl_window_aux_hints_supported_get( mEventHandler->mEcoreWindow );
+ if( hints )
+ {
+ Eina_List* l = NULL;
+ char* hint = NULL;
+
+ for( l = hints, ( hint = static_cast< char* >( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( hint = static_cast< char* >( eina_list_data_get(l) ) ) )
+ {
+ mSupportedAuxiliaryHints.push_back( hint );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::Initialize: %s\n", hint );
+ }
+ }
+
+ if( !positionSize.IsEmpty() )
+ {
+ AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
+ mResizeEnabled = true;
+ }
+
SetClass( name, className );
windowSurface->Map();
mOrientation = Orientation::New(this);
-
- // create event handler for Wayland window
- mEventHandler = new EventHandler( this );
}
void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
void Window::RotationDone( int orientation, int width, int height )
{
- ecore_wl_window_rotation_change_done_send( mEventHandler->mEcoreWindow );
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+ if( wlSurface )
+ {
+ wlSurface->RequestRotation( orientation, width, height );
+ }
+
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
}
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ bool supported = false;
+
+ // Check if the hint is suppported
+ for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
+ {
+ if( *iter == hint )
+ {
+ supported = true;
+ break;
+ }
+ }
+
+ if( !supported )
+ {
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
+ return 0;
+ }
+
+ // Check if the hint is already added
+ for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+ {
+ if( mAuxiliaryHints[i].first == hint )
+ {
+ // Just change the value
+ mAuxiliaryHints[i].second = value;
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
+
+ return i + 1; // id is index + 1
+ }
+ }
+
+ // Add the hint
+ mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
+
+ unsigned int id = mAuxiliaryHints.size();
+
+ ecore_wl_window_aux_hint_add( mEventHandler->mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
+
+ return id;
+}
} // Adaptor
+
} // Internal
+
} // Dali
/*
- * 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.
*/
// CLASS HEADER
-#include "window-render-surface.h"
+#include <window-render-surface.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/gl-abstraction.h>
// INTERNAL INCLUDES
#include <wl-types.h>
-#include <trigger-event.h>
#include <gl/egl-implementation.h>
-#include <base/display-connection.h>
+#include <adaptors/common/adaptor-impl.h>
+#include <integration-api/trigger-event-factory-interface.h>
namespace Dali
{
bool isTransparent)
: EcoreWlRenderSurface( positionSize, surface, name, isTransparent ),
mWlWindow( NULL ),
- mEglWindow( NULL )
+ mWlSurface( NULL ),
+ mEglWindow( NULL ),
+ mThreadSynchronization( NULL ),
+ mRotationTrigger( NULL ),
+ mRotationAngle( 0 ),
+ mScreenRotationAngle( 0 ),
+ mRotationSupported( false ),
+ mRotationFinished( true ),
+ mScreenRotationFinished( true )
{
DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
Init( surface );
{
ecore_wl_window_free( mWlWindow );
}
+
+ if( mRotationTrigger )
+ {
+ delete mRotationTrigger;
+ }
+
}
Ecore_Wl_Window* WindowRenderSurface::GetDrawable()
return mWlWindow;
}
+void WindowRenderSurface::RequestRotation( int angle, int width, int height )
+{
+ if( !mRotationSupported )
+ {
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" );
+ return;
+ }
+
+ if( !mRotationTrigger )
+ {
+ TriggerEventFactoryInterface& triggerFactory = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTriggerEventFactoryInterface();
+ mRotationTrigger = triggerFactory.CreateTriggerEvent( MakeCallback( this, &WindowRenderSurface::ProcessRotationRequest ), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER );
+ }
+
+ mPositionSize.width = width;
+ mPositionSize.height = height;
+
+ mRotationAngle = angle;
+ mRotationFinished = false;
+
+ ecore_wl_window_rotation_set( mWlWindow, mRotationAngle );
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
+}
+
+void WindowRenderSurface::OutputTransformed()
+{
+ int transform;
+
+ if( ecore_wl_window_ignore_output_transform_get( mWlWindow ) )
+ {
+ transform = 0;
+ }
+ else
+ {
+ transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mWlWindow ) );
+ }
+
+ mScreenRotationAngle = transform * 90;
+ mScreenRotationFinished = false;
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
+}
+
void WindowRenderSurface::InitializeEgl( EglInterface& eglIf )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
- // Temporary code for opaque window. We have to modify it after wayland team finish the work.
- if( mColorDepth == COLOR_DEPTH_32 )
+ // create the EGL window
+ if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 )
{
- ecore_wl_window_alpha_set( mWlWindow, true );
+ mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.width, mPositionSize.height );
}
else
{
- ecore_wl_window_alpha_set( mWlWindow, false );
+ mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.height, mPositionSize.width );
+ }
+
+ EGLNativeWindowType windowType( mEglWindow );
+ eglImpl.CreateSurfaceWindow( windowType, mColorDepth );
+
+ // Check capability
+ wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) );
+ if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED )
+ {
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: capability = %d\n", capability );
+ mRotationSupported = true;
}
- // create the EGL surface
- ecore_wl_window_surface_create(mWlWindow);
- mEglWindow = wl_egl_window_create(ecore_wl_window_surface_get(mWlWindow), mPosition.width, mPosition.height);
- eglImpl.CreateSurfaceWindow( (EGLNativeWindowType)mEglWindow, mColorDepth ); // reinterpret_cast does not compile
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
}
void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf )
mEglWindow = NULL;
}
- // Temporary code for opaque window. We have to modify it after wayland team finish the work.
- if( mColorDepth == COLOR_DEPTH_32 )
+ if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 )
{
- ecore_wl_window_alpha_set( mWlWindow, true );
+ mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.width, mPositionSize.height );
}
else
{
- ecore_wl_window_alpha_set( mWlWindow, false );
+ mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.height, mPositionSize.width );
}
- mEglWindow = wl_egl_window_create(ecore_wl_window_surface_get(mWlWindow), mPosition.width, mPosition.height);
+ // Set screen rotation
+ mScreenRotationFinished = false;
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
- return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)mEglWindow ); // reinterpret_cast does not compile
+ EGLNativeWindowType windowType( mEglWindow );
+ return eglImpl.ReplaceSurfaceWindow( windowType );
}
void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
bool needToResize = false;
// check moving
- if( (fabs(positionSize.x - mPosition.x) > MINIMUM_DIMENSION_CHANGE) ||
- (fabs(positionSize.y - mPosition.y) > MINIMUM_DIMENSION_CHANGE) )
+ if( (fabs(positionSize.x - mPositionSize.x) > MINIMUM_DIMENSION_CHANGE) ||
+ (fabs(positionSize.y - mPositionSize.y) > MINIMUM_DIMENSION_CHANGE) )
{
needToMove = true;
}
// check resizing
- if( (fabs(positionSize.width - mPosition.width) > MINIMUM_DIMENSION_CHANGE) ||
- (fabs(positionSize.height - mPosition.height) > MINIMUM_DIMENSION_CHANGE) )
+ if( (fabs(positionSize.width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
+ (fabs(positionSize.height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE) )
{
needToResize = true;
}
if(needToMove)
{
ecore_wl_window_move(mWlWindow, positionSize.x, positionSize.y);
- mPosition = positionSize;
+ mPositionSize = positionSize;
}
if (needToResize)
{
ecore_wl_window_resize(mWlWindow, positionSize.width, positionSize.height, 0);
- mPosition = positionSize;
+ mPositionSize = positionSize;
}
}
{
}
-bool WindowRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+bool WindowRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface )
{
- // nothing to do for windows
+ if( resizingSurface )
+ {
+ // Window rotate or screen rotate
+ if( !mRotationFinished || !mScreenRotationFinished )
+ {
+ wl_egl_window_rotation rotation;
+ wl_output_transform bufferTransform;
+ int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360;
+
+ switch( totalAngle )
+ {
+ case 0:
+ {
+ rotation = ROTATION_0;
+ bufferTransform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ }
+ case 90:
+ {
+ rotation = ROTATION_270;
+ bufferTransform = WL_OUTPUT_TRANSFORM_90;
+ break;
+ }
+ case 180:
+ {
+ rotation = ROTATION_180;
+ bufferTransform = WL_OUTPUT_TRANSFORM_180;
+ break;
+ }
+ case 270:
+ {
+ rotation = ROTATION_90;
+ bufferTransform = WL_OUTPUT_TRANSFORM_270;
+ break;
+ }
+ default:
+ {
+ rotation = ROTATION_0;
+ bufferTransform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ }
+ }
+
+ wl_egl_window_set_rotation( mEglWindow, rotation );
+
+ wl_egl_window_set_buffer_transform( mEglWindow, bufferTransform );
+
+ // Reset only screen rotation flag
+ mScreenRotationFinished = true;
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mRotationAngle, mScreenRotationAngle );
+ }
+
+ // Only window rotate
+ if( !mRotationFinished )
+ {
+ wl_output_transform windowTransform;
+
+ switch( mRotationAngle )
+ {
+ case 0:
+ {
+ windowTransform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ }
+ case 90:
+ {
+ windowTransform = WL_OUTPUT_TRANSFORM_90;
+ break;
+ }
+ case 180:
+ {
+ windowTransform = WL_OUTPUT_TRANSFORM_180;
+ break;
+ }
+ case 270:
+ {
+ windowTransform = WL_OUTPUT_TRANSFORM_270;
+ break;
+ }
+ default:
+ {
+ windowTransform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ }
+ }
+
+ wl_egl_window_set_window_transform( mEglWindow, windowTransform );
+ }
+ }
+
return true;
}
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
{
+ if( resizingSurface )
+ {
+ if( !mRotationFinished )
+ {
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
+
+ mRotationTrigger->Trigger();
+
+ if( mThreadSynchronization )
+ {
+ // Wait until the event-thread complete the rotation event processing
+ mThreadSynchronization->PostRenderWaitForCompletion();
+ }
+ }
+ }
+
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.SwapBuffers();
void WindowRenderSurface::CreateWlRenderable()
{
// if width or height are zero, go full screen.
- if ( (mPosition.width == 0) || (mPosition.height == 0) )
+ if ( (mPositionSize.width == 0) || (mPositionSize.height == 0) )
{
// Default window size == screen size
- mPosition.x = 0;
- mPosition.y = 0;
+ mPositionSize.x = 0;
+ mPositionSize.y = 0;
- ecore_wl_screen_size_get( &mPosition.width, &mPosition.height );
+ ecore_wl_screen_size_get( &mPositionSize.width, &mPositionSize.height );
}
- mWlWindow = ecore_wl_window_new( 0, mPosition.x, mPosition.y, mPosition.width, mPosition.height, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW );
+ mWlWindow = ecore_wl_window_new( 0, mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW );
if ( mWlWindow == 0 )
{
- DALI_ASSERT_ALWAYS(0 && "Failed to create X window");
+ DALI_ASSERT_ALWAYS(0 && "Failed to create Wayland window");
+ }
+
+ mWlSurface = ecore_wl_window_surface_create( mWlWindow );
+
+ if( mColorDepth == COLOR_DEPTH_32 )
+ {
+ ecore_wl_window_alpha_set( mWlWindow, true );
+ }
+ else
+ {
+ ecore_wl_window_alpha_set( mWlWindow, false );
+ }
+
+ // Get output transform
+ if( !ecore_wl_window_ignore_output_transform_get( mWlWindow ) )
+ {
+ Ecore_Wl_Output* output = ecore_wl_window_output_find( mWlWindow );
+
+ int transform = ecore_wl_output_transform_get( output );
+
+ mScreenRotationAngle = transform * 90;
+ mScreenRotationFinished = false;
}
}
mWlWindow = AnyCast< Ecore_Wl_Window* >( surfaceId );
}
-void WindowRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& /* threadSynchronization */ )
+void WindowRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )
{
- // Nothing to do.
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::SetThreadSynchronization: called\n" );
+
+ mThreadSynchronization = &threadSynchronization;
}
void WindowRenderSurface::ReleaseLock()
// Nothing to do.
}
+void WindowRenderSurface::ProcessRotationRequest()
+{
+ mRotationFinished = true;
+
+ ecore_wl_window_rotation_change_done_send( mWlWindow );
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::ProcessRotationRequest: Rotation Done\n" );
+
+ if( mThreadSynchronization )
+ {
+ mThreadSynchronization->PostRenderComplete();
+ }
+}
+
} // namespace ECore
} // namespace Dali
#define __DALI_INTERNAL_ECORE_WL_WINDOW_RENDER_SURFACE_H__
/*
- * 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.
*
*/
+// EXTERNAL INCLUDES
+#include <wayland-egl.h>
+
// INTERNAL INCLUDES
#include <ecore-wl-render-surface.h>
-#include <wayland-egl.h>
+#include <integration-api/thread-synchronization-interface.h>
namespace Dali
{
*/
virtual Ecore_Wl_Window* GetWlWindow();
+ /**
+ * Request surface rotation
+ * @param[in] angle A new angle of the surface
+ * @param[in] width A new width of the surface
+ * @param[in] height A new height of the surface
+ */
+ void RequestRotation( int angle, int width, int height );
+
+ /**
+ * Notify output is transformed.
+ */
+ void OutputTransformed();
+
public: // from Dali::RenderSurface
/**
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()
*/
virtual void UseExistingRenderable( unsigned int surfaceId );
+private:
+
+ /**
+ * Used as the callback for the rotation-trigger.
+ */
+ void ProcessRotationRequest();
+
private: // Data
- Ecore_Wl_Window* mWlWindow; ///< Wayland-Window
- wl_egl_window* mEglWindow;
+ Ecore_Wl_Window* mWlWindow; ///< Wayland-Window
+ wl_surface* mWlSurface;
+ wl_egl_window* mEglWindow;
+ ThreadSynchronizationInterface* mThreadSynchronization;
+ TriggerEventInterface* mRotationTrigger;
+ int mRotationAngle;
+ int mScreenRotationAngle;
+ bool mRotationSupported;
+ bool mRotationFinished;
+ bool mScreenRotationFinished;
}; // class WindowRenderSurface
#define __DALI_ECORE_WL_RENDER_SURFACE_H__
/*
- * 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.
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) = 0;
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
/**
* @copydoc Dali::RenderSurface::ReleaseLock()
protected: // Data
- PositionSize mPosition; ///< Position
+ PositionSize mPositionSize; ///< Position
std::string mTitle; ///< Title of window which shows from "xinfo -topvwins" command
TriggerEventInterface* mRenderNotification; ///< Render notification trigger
ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit)
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) = 0;
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
/**
* @copydoc Dali::RenderSurface::ReleaseLock()
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()
/*
- * Copyright (c) 2016 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.
{
}
-bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
{
// nothing to do for pixmaps
return true;
}
-void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
{
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.SwapBuffers();
{
}
-bool RenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
+bool RenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
{
return true;
}
-void RenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+void RenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
{
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
eglImpl.SwapBuffers();
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender();
/*
- * Copyright (c) 2015 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.
// place holder
};
-Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name, className);
+ window->Initialize( positionSize, name, className );
return window;
}
}
Window::Window()
-: mSurface(NULL),
- mIndicatorVisible(Dali::Window::VISIBLE),
- mIndicatorIsShown(false),
- mShowRotatedIndicatorOnClose(false),
- mStarted(false),
- mIsTransparent(false),
- mWMRotationAppSet(false),
- mIndicator(NULL),
- mIndicatorOrientation(Dali::Window::PORTRAIT),
- mNextIndicatorOrientation(Dali::Window::PORTRAIT),
- mIndicatorOpacityMode(Dali::Window::OPAQUE),
- mOverlay(NULL),
- mAdaptor(NULL),
- mPreferredOrientation(Dali::Window::PORTRAIT)
+: mSurface( NULL ),
+ mIndicatorVisible( Dali::Window::VISIBLE ),
+ mIndicatorIsShown( false ),
+ mShowRotatedIndicatorOnClose( false ),
+ mStarted( false ),
+ mIsTransparent( false ),
+ mWMRotationAppSet( false ),
+ mResizeEnabled( true ),
+ mIndicator( NULL ),
+ mIndicatorOrientation( Dali::Window::PORTRAIT ),
+ mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
+ mIndicatorOpacityMode( Dali::Window::OPAQUE ),
+ mOverlay( NULL ),
+ mAdaptor( NULL ),
+ mPreferredOrientation( Dali::Window::PORTRAIT ),
+ mSupportedAuxiliaryHints(),
+ mAuxiliaryHints()
{
mEventHandler = NULL;
}
delete mSurface;
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
+void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
{
// create an Wayland window by default
Any surface;
- Wayland::RenderSurface* windowSurface = new Wayland::RenderSurface( windowPosition, surface, name, mIsTransparent );
+ Wayland::RenderSurface* windowSurface = new Wayland::RenderSurface( positionSize, surface, name, mIsTransparent );
mSurface = windowSurface;
mOrientation = Orientation::New(this);
-
}
void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
{
}
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ return -1;
+}
} // Adaptor
} // Internal
/*
- * 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.
{
}
-bool PixmapRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction& )
+bool PixmapRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction&, bool )
{
// Nothing to do for pixmaps
return true;
}
-void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
+void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
{
// flush gl instruction queue
glAbstraction.Flush();
/*
- * 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.
};
-Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name, className);
+ window->Initialize( positionSize, name, className );
return window;
}
}
Window::Window()
-: mSurface(NULL),
- mIndicatorVisible(Dali::Window::INVISIBLE),
- mIndicatorIsShown(false),
- mShowRotatedIndicatorOnClose(false),
- mStarted(false),
- mIsTransparent(false),
- mWMRotationAppSet(false),
- mEcoreEventHander(true),
- mIndicator(NULL),
- mIndicatorOrientation(Dali::Window::PORTRAIT),
- mNextIndicatorOrientation(Dali::Window::PORTRAIT),
- mIndicatorOpacityMode(Dali::Window::OPAQUE),
- mOverlay(NULL),
- mAdaptor(NULL),
- mEventHandler(NULL),
- mPreferredOrientation(Dali::Window::PORTRAIT)
+: mSurface( NULL ),
+ mIndicatorVisible( Dali::Window::INVISIBLE ),
+ mIndicatorIsShown( false ),
+ mShowRotatedIndicatorOnClose( false ),
+ mStarted( false ),
+ mIsTransparent( false ),
+ mWMRotationAppSet( false ),
+ mEcoreEventHander( true ),
+ mResizeEnabled( true ),
+ mIndicator( NULL ),
+ mIndicatorOrientation( Dali::Window::PORTRAIT ),
+ mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
+ mIndicatorOpacityMode( Dali::Window::OPAQUE ),
+ mOverlay( NULL ),
+ mAdaptor( NULL ),
+ mEventHandler( NULL ),
+ mPreferredOrientation( Dali::Window::PORTRAIT ),
+ mSupportedAuxiliaryHints(),
+ mAuxiliaryHints()
{
// Detect if we're not running in a ecore main loop (e.g. libuv).
delete mSurface;
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
+void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
{
// create an X11 window by default
Any surface;
- ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, className, mIsTransparent );
+ ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( positionSize, surface, name, className, mIsTransparent );
windowSurface->Map();
mSurface = windowSurface;
ecore_x_window_prop_property_set( ecoreWindow,
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
ECORE_X_ATOM_CARDINAL, 32, &angles, 2 );
+
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+
+ mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
#endif // DALI_PROFILE_UBUNTU
}
}
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+ return -1;
+}
} // Adaptor
} // Internal
/*
- * 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.
{
}
-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, 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();
/**
* @copydoc Dali::RenderSurface::PreRender()
*/
- virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
+ virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::PostRender()
*/
- virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
+ virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
/**
* @copydoc Dali::RenderSurface::StopRender()