[Tizen] Revert "Support screen rotation" 76/143976/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 14 Aug 2017 06:29:18 +0000 (15:29 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 14 Aug 2017 06:29:29 +0000 (15:29 +0900)
This reverts commit f6feca16511c154f683895b3315974e399e7c13a.

Change-Id: I64c6c2d8fd43e4107cdb43420e9d46e4f86a6354

31 files changed:
adaptors/base/combined-update-render/combined-update-render-controller.cpp
adaptors/base/combined-update-render/combined-update-render-controller.h
adaptors/base/render-helper.cpp
adaptors/base/render-helper.h
adaptors/base/thread-controller-interface.h
adaptors/base/thread-controller.cpp
adaptors/base/thread-controller.h
adaptors/common/adaptor-impl.cpp
adaptors/common/adaptor-impl.h
adaptors/common/adaptor.cpp
adaptors/common/application-impl.cpp
adaptors/devel-api/adaptor-framework/render-surface.h
adaptors/ecore/wayland/pixmap-render-surface-ecore-wl.cpp
adaptors/ecore/wayland/render-surface-ecore-wl.cpp
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp
adaptors/ecore/wayland/window-render-surface.h
adaptors/integration-api/adaptor.h
adaptors/integration-api/wayland/ecore-wl-render-surface.h
adaptors/integration-api/wayland/native-render-surface.h
adaptors/integration-api/wayland/pixmap-render-surface.h
adaptors/integration-api/x11/ecore-x-render-surface.h
adaptors/integration-api/x11/pixmap-render-surface.h
adaptors/tizen/native-render-surface-tizen.cpp
adaptors/wayland/render-surface/render-surface-wl.cpp
adaptors/wayland/render-surface/render-surface-wl.h
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/pixmap-render-surface-x.cpp
adaptors/x11/window-impl-x.cpp
adaptors/x11/window-render-surface-x.cpp
adaptors/x11/window-render-surface.h

index 2b3ed58cf3b108f68cda51fcccaa25ef9581b373..715053f8d0a51d0e6abeea47c064ba21b7210bc1 100644 (file)
@@ -107,8 +107,7 @@ CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalS
   mPendingRequestUpdate( FALSE ),
   mUseElapsedTimeAfterWait( FALSE ),
   mNewSurface( NULL ),
-  mPostRendering( FALSE ),
-  mSurfaceResized( FALSE )
+  mPostRendering( FALSE )
 {
   LOG_EVENT_TRACE;
 
@@ -285,26 +284,6 @@ void CombinedUpdateRenderController::ReplaceSurface( RenderSurface* newSurface )
   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
@@ -433,19 +412,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       SurfaceReplaced();
     }
 
-    //////////////////////////////
-    // 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
     //////////////////////////////
@@ -571,14 +537,12 @@ bool CombinedUpdateRenderController::UpdateRenderReady( bool& useElapsedTime, bo
   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
-         ! mSurfaceResized ) // Ensure we don't wait if we need to resize the surface
+         ! mNewSurface ) // Ensure we don't wait if we need to replace 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
@@ -597,7 +561,6 @@ bool CombinedUpdateRenderController::UpdateRenderReady( bool& useElapsedTime, bo
   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;
@@ -630,22 +593,6 @@ void CombinedUpdateRenderController::SurfaceReplaced()
   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
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -690,7 +637,6 @@ void CombinedUpdateRenderController::PostRenderWaitForCompletion()
   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 );
index 318b085dbcd4ec1089582f6507208961bae8535f..6f409cf46c161f7518258331b23d4d3c68b56ac4 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -125,11 +125,6 @@ public:
    */
   virtual void ReplaceSurface( RenderSurface* surface );
 
-  /**
-   * @copydoc ThreadControllerInterface::ResizeSurface()
-   */
-  virtual void ResizeSurface();
-
   /**
    * @copydoc ThreadControllerInterface::SetRenderRefreshRate()
    */
@@ -220,21 +215,6 @@ private:
    */
   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
@@ -332,7 +312,6 @@ private:
   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
index c77d2c9ee3781514157b7acd1700ddfcc37998c5..1d971286d89b885541764ac0ee327e1e2fbd0634 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -38,8 +38,7 @@ RenderHelper::RenderHelper( AdaptorInternalServices& adaptorInterfaces )
 : mGLES( adaptorInterfaces.GetGlesInterface() ),
   mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
   mEGL( NULL ),
-  mSurfaceReplaced( false ),
-  mSurfaceResized( false )
+  mSurfaceReplaced( false )
 {
   // set the initial values before render thread starts
   mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
@@ -126,11 +125,6 @@ void RenderHelper::ReplaceSurface( RenderSurface* newSurface )
   mSurfaceReplaced = true;
 }
 
-void RenderHelper::ResizeSurface()
-{
-  mSurfaceResized = true;
-}
-
 void RenderHelper::ShutdownEgl()
 {
   if( mSurface )
@@ -149,7 +143,7 @@ bool RenderHelper::PreRender()
 {
   if( mSurface )
   {
-    mSurface->PreRender( *mEGL, mGLES, mSurfaceResized );
+    mSurface->PreRender( *mEGL, mGLES );
   }
   mGLES.PreRender();
   return true;
@@ -163,10 +157,9 @@ void RenderHelper::PostRender()
   if( mSurface )
   {
     // Inform the surface that rendering this frame has finished.
-    mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced, mSurfaceResized );
+    mSurface->PostRender( *mEGL, mGLES, mDisplayConnection, mSurfaceReplaced );
   }
   mSurfaceReplaced = false;
-  mSurfaceResized = false;
 }
 
 } // namespace Adaptor
index 5d26d162bfa34d22355a6a9cbb5aaa33ab039b29..62266fa97874c49748fd7f51182f4b1b1d2086bc 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_RENDER_HELPER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -101,13 +101,6 @@ public:
    */
   void ReplaceSurface( RenderSurface* newSurface );
 
-  /**
-   * Resize the rendering surface.
-   *
-   * @note Called from render thread
-   */
-  void ResizeSurface();
-
   /**
    * Shuts down EGL.
    *
@@ -147,7 +140,6 @@ private: // Data
   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
index 2c8e8ebc99a6bb767efc4f6d53366ae3571b6a3a..4542fe59c9814a0bc8f8b3d15b539d05ba245f7f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -83,11 +83,6 @@ public:
    */
   virtual void ReplaceSurface( RenderSurface* surface ) = 0;
 
-  /**
-   * Resize the surface.
-   */
-  virtual void ResizeSurface() = 0;
-
   /**
    * @copydoc Dali::Adaptor::SetRenderRefreshRate()
    */
index f84bb93509de25e3ba8066bfd8ab999e93d825f0..84d4cf8c57de776fcdfcd15c3a41514a56503487 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -90,11 +90,6 @@ void ThreadController::ReplaceSurface( RenderSurface* newSurface )
   mThreadControllerInterface->ReplaceSurface( newSurface );
 }
 
-void ThreadController::ResizeSurface()
-{
-  mThreadControllerInterface->ResizeSurface();
-}
-
 void ThreadController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
 {
   mThreadControllerInterface->SetRenderRefreshRate( numberOfVSyncsPerRender );
index 6feddc19a9e199cdffc00a682fe037b503de5b9a..d9b89764253a1c6cb2a5e737776965f0a051aafa 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_THREAD_CONTROLLER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -103,11 +103,6 @@ public:
    */
   void ReplaceSurface( RenderSurface* surface );
 
-  /**
-   * Resize the surface.
-   */
-  void ResizeSurface();
-
   /**
    * @copydoc Dali::Adaptor::SetRenderRefreshRate()
    */
index 600a2a36b6464bb0012535a3ba6146a6e2680eee..748012ebc98108cf92c8bd896a8d2f870e0d6f94 100644 (file)
@@ -393,17 +393,10 @@ void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
 
 void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
 {
-  PositionSize positionSize = surface.GetPositionSize();
-
-  // let the core know the surface size has changed
-  mCore->SurfaceResized( positionSize.width, positionSize.height );
-
-  mResizedSignal.Emit( mAdaptor );
-
   mNativeWindow = nativeWindow;
   mSurface = &surface;
 
-  // flush the event queue to give the update-render thread chance
+  // flush the event queue to give update and render threads chance
   // to start processing messages for new camera setup etc as soon as possible
   ProcessCoreEvents();
 
@@ -702,7 +695,7 @@ void Adaptor::OnDamaged( const DamageArea& area )
   RequestUpdate();
 }
 
-void Adaptor::SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize )
+void Adaptor::SurfaceSizeChanged( Dali::Adaptor::SurfaceSize surfaceSize )
 {
   // let the core know the surface size has changed
   mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
@@ -710,16 +703,6 @@ void Adaptor::SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize )
   mResizedSignal.Emit( mAdaptor );
 }
 
-void Adaptor::SurfaceResizeComplete( Dali::Adaptor::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();
index f48f29e47dfb9207de8c61e81437ea6408c35cf7..425bfcf466404d5908d6853bae6c0ba07daf6bd8 100644 (file)
@@ -338,12 +338,7 @@ public:
   /**
    * Informs core the surface size has changed
    */
-  void SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize );
-
-  /**
-   * Informs ThreadController the surface size has changed
-   */
-  void SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize );
+  void SurfaceSizeChanged( Dali::Adaptor::SurfaceSize surfaceSize );
 
 public:  //AdaptorInternalServices
 
index 847f42e29760f9e35bb3859c8b8d496a1185f4a3..a6810c7382726272ea4eaa7048366a9ba6d12e95 100644 (file)
@@ -184,6 +184,11 @@ void Adaptor::SetStereoBase(  float stereoBase )
   mImpl->SetStereoBase( stereoBase );
 }
 
+void Adaptor::SurfaceSizeChanged( SurfaceSize surfaceSize )
+{
+  mImpl->SurfaceSizeChanged( surfaceSize );
+}
+
 Adaptor::Adaptor()
 : mImpl( NULL )
 {
index 5e73d5e87350785b46dd9573210bbff831d6cc9d..29e925006d12c5899deffc12a8536002c5d5896a 100644 (file)
@@ -404,6 +404,7 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st
   Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
 
   Any nativeWindow = newWindow.GetNativeHandle();
+  Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
   mWindow = newWindow;
   mWindowPositionSize = positionSize;
index 9739770a5c185bed16057f9337f411b6dab78adc..61fd74d79d712e926564c8b61e17464fc56194fc 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_RENDER_SURFACE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
@@ -134,10 +134,9 @@ public:
    * 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, bool resizingSurface ) = 0;
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
 
   /**
    * @brief Invoked by render thread after Core::Render
@@ -145,9 +144,8 @@ public:
    * @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, bool resizingSurface ) = 0;
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) = 0;
 
   /**
    * @brief Invoked by render thread when the thread should be stop
index 4acb518254fd885d445d3853d4e0825f00e029f5..cc3d05bb26f7a46e3862f00fc85b53f24fb5bd02 100644 (file)
@@ -107,13 +107,13 @@ void PixmapRenderSurface::StartRender()
   // FIXME
 }
 
-bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
+bool PixmapRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
 {
   // nothing to do for pixmaps
   return true;
 }
 
-void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
 {
   // flush gl instruction queue
   glAbstraction.Flush();
@@ -147,7 +147,7 @@ void PixmapRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterfa
 void PixmapRenderSurface::CreateWlRenderable()
 {
   // check we're creating one with a valid size
-  DALI_ASSERT_ALWAYS( mPositionSize.width > 0 && mPositionSize.height > 0 && "Pixmap size is invalid" );
+  DALI_ASSERT_ALWAYS( mPosition.width > 0 && mPosition.height > 0 && "Pixmap size is invalid" );
 
   // FIXME
 }
index 2db6f236bd1aabe00cad6c909fe6841ac388bd63..3596e345d468f8f8075e49a3f02820332c5bf5c6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2014 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.
@@ -41,11 +41,11 @@ EcoreWlRenderSurface::EcoreWlRenderSurface(Dali::PositionSize positionSize,
                                            Any surface,
                                            const std::string& name,
                                            bool isTransparent)
-: mPositionSize( positionSize ),
-  mTitle( name ),
-  mRenderNotification( NULL ),
-  mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
-  mOwnSurface( false )
+: mPosition(positionSize),
+  mTitle(name),
+  mRenderNotification(NULL),
+  mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24),
+  mOwnSurface(false)
 {
 }
 
@@ -106,7 +106,7 @@ Ecore_Wl_Window* EcoreWlRenderSurface::GetDrawable()
 
 PositionSize EcoreWlRenderSurface::GetPositionSize() const
 {
-  return mPositionSize;
+  return mPosition;
 }
 
 void EcoreWlRenderSurface::MoveResize( Dali::PositionSize positionSize )
index 6f9b2a794a9eaa4a7fb634ed1488f815779c9dba..73c0c5a5ff1e5c047dc0bd295de16f1aad761eed 100644 (file)
@@ -68,7 +68,11 @@ struct Window::EventHandler
    */
   EventHandler( Window* window )
   : mWindow( window ),
-    mEcoreEventHandler(),
+    mWindowPropertyHandler( NULL ),
+    mWindowIconifyStateHandler( NULL ),
+    mWindowVisibilityStateHandler( NULL ),
+    mWindowFocusInHandler( NULL ),
+    mWindowFocusOutHandler( NULL ),
     mEcoreWindow( 0 ),
     mDisplay( NULL ),
     mEventQueue( NULL ),
@@ -94,12 +98,10 @@ struct Window::EventHandler
 
     if( mWindow->mEcoreEventHander )
     {
-      mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ) );
-      mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, EcoreEventWindowVisibilityChanged, this ) );
-      mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this ) );
-      mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, 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) );
+      mWindowIconifyStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this );
+      mWindowVisibilityStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, EcoreEventWindowVisibilityChanged, this );
+      mWindowFocusInHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this );
+      mWindowFocusOutHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this );
     }
 
     mDisplay = ecore_wl_display_get();
@@ -128,11 +130,30 @@ struct Window::EventHandler
    */
   ~EventHandler()
   {
-    for( Dali::Vector< Ecore_Event_Handler* >::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter )
+    if ( mWindowPropertyHandler )
     {
-      ecore_event_handler_del( *iter );
+      ecore_event_handler_del( mWindowPropertyHandler );
+    }
+
+    if ( mWindowIconifyStateHandler )
+    {
+      ecore_event_handler_del( mWindowIconifyStateHandler );
+    }
+
+    if ( mWindowVisibilityStateHandler )
+    {
+      ecore_event_handler_del( mWindowVisibilityStateHandler );
+    }
+
+    if( mWindowFocusInHandler )
+    {
+      ecore_event_handler_del( mWindowFocusInHandler );
+    }
+
+    if( mWindowFocusOutHandler )
+    {
+      ecore_event_handler_del( mWindowFocusOutHandler );
     }
-    mEcoreEventHandler.Clear();
 
     if( mEventQueue )
     {
@@ -142,6 +163,12 @@ struct Window::EventHandler
 
   // Static methods
 
+  /// Called when the window properties are changed.
+  static Eina_Bool EcoreEventWindowPropertyChanged( void* data, int type, void* event )
+  {
+    return EINA_FALSE;
+  }
+
   /// Called when the window iconify state is changed.
   static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event )
   {
@@ -232,36 +259,6 @@ struct Window::EventHandler
     return ECORE_CALLBACK_PASS_ON;
   }
 
-  /// 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 ) )
-    {
-      ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
-      wlSurface->OutputTransformed();
-    }
-
-    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 )
-    {
-      ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
-      wlSurface->OutputTransformed();
-    }
-
-    return ECORE_CALLBACK_PASS_ON;
-  }
-
   static void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
   {
     Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
@@ -360,7 +357,11 @@ struct Window::EventHandler
 
   // Data
   Window* mWindow;
-  Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler;
+  Ecore_Event_Handler* mWindowPropertyHandler;
+  Ecore_Event_Handler* mWindowIconifyStateHandler;
+  Ecore_Event_Handler* mWindowVisibilityStateHandler;
+  Ecore_Event_Handler* mWindowFocusInHandler;
+  Ecore_Event_Handler* mWindowFocusOutHandler;
   Ecore_Wl_Window* mEcoreWindow;
 
   wl_display* mDisplay;
@@ -906,15 +907,43 @@ bool Window::IsVisible() const
 
 void Window::RotationDone( int orientation, int width, int height )
 {
-  ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
-  wlSurface->RequestRotation( orientation, width, height );
-
-  mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) );
+  mAdaptor->SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( width, height ) );
 
   // Emit signal
   mResizedSignal.Emit( Dali::DevelWindow::WindowSize( width, height ) );
 
-  mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( width, height ) );
+  Dali::Window::WindowOrientation windowOrientation;
+  switch( orientation )
+  {
+    case 0:
+    {
+      windowOrientation = Dali::Window::PORTRAIT;
+      break;
+    }
+    case 90:
+    {
+      windowOrientation = Dali::Window::LANDSCAPE;
+      break;
+    }
+    case 180:
+    {
+      windowOrientation = Dali::Window::PORTRAIT_INVERSE;
+      break;
+    }
+    case 270:
+    {
+      windowOrientation = Dali::Window::LANDSCAPE_INVERSE;
+      break;
+    }
+    default:
+    {
+      windowOrientation = Dali::Window::PORTRAIT;
+      break;
+    }
+  }
+
+  ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+  wlSurface->RequestRotation( windowOrientation, width, height );
 }
 
 unsigned int Window::GetSupportedAuxiliaryHintCount()
@@ -1446,12 +1475,10 @@ void Window::SetSize( Dali::DevelWindow::WindowSize size )
 
     mSurface->MoveResize( positionSize );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
-
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   }
 }
 
index db97cd5fe12a870921c2d9062d900e7d730617f9..1df0faaf4817cc69a7cb84a7e48265e6471ba735 100644 (file)
@@ -27,6 +27,7 @@
 // INTERNAL INCLUDES
 #include <wl-types.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>
 
@@ -44,6 +45,7 @@ namespace
 {
 
 const int MINIMUM_DIMENSION_CHANGE( 1 ); ///< Minimum change for window to be considered to have moved
+const char* WAYLAND_EGL_SO( "libwayland-egl.so" );
 
 } // unnamed namespace
 
@@ -52,17 +54,16 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize,
                                           const std::string& name,
                                           bool isTransparent)
 : EcoreWlRenderSurface( positionSize, surface, name, isTransparent ),
+  mEglWinGetCapabilitiesPtr( NULL ),
+  mEglWinSetRotationPtr( NULL ),
+  mLibHandle( NULL ),
   mWlWindow( NULL ),
   mWlSurface( NULL ),
   mEglWindow( NULL ),
   mThreadSynchronization( NULL ),
   mRotationTrigger( NULL ),
-  mRotationAngle( 0 ),
-  mScreenRotationAngle( 0 ),
   mRotationSupported( false ),
-  mRotationFinished( true ),
-  mScreenRotationFinished( true ),
-  mResizeFinished( true )
+  mRotated( false )
 {
   DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" );
   Init( surface );
@@ -86,6 +87,10 @@ WindowRenderSurface::~WindowRenderSurface()
     delete mRotationTrigger;
   }
 
+  if( mLibHandle != NULL )
+  {
+    dlclose( mLibHandle );
+  }
 }
 
 Ecore_Wl_Window* WindowRenderSurface::GetDrawable()
@@ -105,7 +110,7 @@ Ecore_Wl_Window* WindowRenderSurface::GetWlWindow()
   return mWlWindow;
 }
 
-void WindowRenderSurface::RequestRotation( int angle, int width, int height )
+void WindowRenderSurface::RequestRotation( Dali::Window::WindowOrientation orientation, int width, int height )
 {
   if( !mRotationSupported )
   {
@@ -113,42 +118,62 @@ void WindowRenderSurface::RequestRotation( int angle, int width, int height )
     return;
   }
 
+  DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: orientation = %d\n", orientation );
+
   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;
+  mPosition.width = width;
+  mPosition.height = height;
 
-  mRotationAngle = angle;
-  mRotationFinished = false;
+  mRotated = true;
 
-  ecore_wl_window_rotation_set( mWlWindow, mRotationAngle );
+  int angle;
+  wl_egl_window_rotation rotation;
 
-  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 ) )
+  switch( orientation )
   {
-    transform = 0;
-  }
-  else
-  {
-    transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mWlWindow ) );
+    case Dali::Window::PORTRAIT:
+    {
+      angle = 0;
+      rotation = ROTATION_0;
+      break;
+    }
+    case Dali::Window::LANDSCAPE:
+    {
+      angle = 90;
+      rotation = ROTATION_270;
+      break;
+    }
+    case Dali::Window::PORTRAIT_INVERSE:
+    {
+      angle = 180;
+      rotation = ROTATION_180;
+      break;
+    }
+    case Dali::Window::LANDSCAPE_INVERSE:
+    {
+      angle = 270;
+      rotation = ROTATION_90;
+      break;
+    }
+    default:
+    {
+      angle = 0;
+      rotation = ROTATION_0;
+      break;
+    }
   }
 
-  ecore_wl_window_buffer_transform_set( mWlWindow, transform );
+  ecore_wl_window_rotation_set( mWlWindow, angle );
 
-  mScreenRotationAngle = transform * 90;
-  mScreenRotationFinished = false;
-
-  DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
+  if( mEglWinSetRotationPtr )
+  {
+    mEglWinSetRotationPtr( mEglWindow, rotation );
+  }
 }
 
 void WindowRenderSurface::SetTransparency( bool transparent )
@@ -171,28 +196,57 @@ void WindowRenderSurface::CreateEglSurface( EglInterface& eglIf )
 
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
 
-  // create the EGL window
-  if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 )
+  // Temporary code for opaque window. We have to modify it after wayland team finish the work.
+  if( mColorDepth == COLOR_DEPTH_32 )
   {
-    mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.width, mPositionSize.height );
+    ecore_wl_window_alpha_set( mWlWindow, true );
   }
   else
   {
-    mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.height, mPositionSize.width );
+    ecore_wl_window_alpha_set( mWlWindow, false );
   }
 
+  // create the EGL window
+  mEglWindow = wl_egl_window_create( mWlSurface, mPosition.width, mPosition.height );
   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 )
+  if( !mLibHandle )
   {
-    DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: capability = %d\n", capability );
-    mRotationSupported = true;
+    mLibHandle = dlopen( WAYLAND_EGL_SO, RTLD_LAZY );
+
+    char* error = dlerror();
+    if( mLibHandle == NULL || error != NULL )
+    {
+      DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: dlopen error: %s\n", error );
+      return;
+    }
+
+    mEglWinGetCapabilitiesPtr = reinterpret_cast< EglWinGetCapabilitiesFunction >( dlsym( mLibHandle, "wl_egl_window_get_capabilities" ) );
+    if( !mEglWinGetCapabilitiesPtr )
+    {
+      DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: Can't load wl_egl_window_get_capabilities\n" );
+      return;
+    }
+
+    mEglWinSetRotationPtr = reinterpret_cast< EglWinSetRotationFunction >( dlsym( mLibHandle, "wl_egl_window_set_rotation" ) );
+    if( !mEglWinSetRotationPtr )
+    {
+      DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: Can't load wl_egl_window_set_rotation\n" );
+      return;
+    }
   }
 
-  DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
+  if( mEglWinGetCapabilitiesPtr )
+  {
+    wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( mEglWinGetCapabilitiesPtr( mEglWindow ) );
+    if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED )
+    {
+      DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateEglSurface: capability = %d\n", capability );
+      mRotationSupported = true;
+    }
+  }
 }
 
 void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf )
@@ -219,17 +273,17 @@ bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
     mEglWindow = NULL;
   }
 
-  if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 )
+  // Temporary code for opaque window. We have to modify it after wayland team finish the work.
+  if( mColorDepth == COLOR_DEPTH_32 )
   {
-    mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.width, mPositionSize.height );
+    ecore_wl_window_alpha_set( mWlWindow, true );
   }
   else
   {
-    mEglWindow = wl_egl_window_create( mWlSurface, mPositionSize.height, mPositionSize.width );
+    ecore_wl_window_alpha_set( mWlWindow, false );
   }
 
-  // Set screen rotation
-  mScreenRotationFinished = false;
+  mEglWindow = wl_egl_window_create( mWlSurface, mPosition.width, mPosition.height );
 
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
   EGLNativeWindowType windowType( mEglWindow );
@@ -242,32 +296,33 @@ void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
   bool needToResize = false;
 
   // check moving
-  if( (fabs(positionSize.x - mPositionSize.x) > MINIMUM_DIMENSION_CHANGE) ||
-      (fabs(positionSize.y - mPositionSize.y) > MINIMUM_DIMENSION_CHANGE) )
+  if( (fabs(positionSize.x - mPosition.x) > MINIMUM_DIMENSION_CHANGE) ||
+      (fabs(positionSize.y - mPosition.y) > MINIMUM_DIMENSION_CHANGE) )
   {
     needToMove = true;
   }
 
   // check resizing
-  if( (fabs(positionSize.width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
-      (fabs(positionSize.height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE) )
+  if( (fabs(positionSize.width - mPosition.width) > MINIMUM_DIMENSION_CHANGE) ||
+      (fabs(positionSize.height - mPosition.height) > MINIMUM_DIMENSION_CHANGE) )
   {
     needToResize = true;
   }
 
-  if( needToMove )
+  if(needToMove)
   {
     ecore_wl_window_position_set( mWlWindow, positionSize.x, positionSize.y );
   }
-  if( needToResize )
+  if (needToResize)
   {
     ecore_wl_window_update_size( mWlWindow, positionSize.width, positionSize.height );
-    mResizeFinished = false;
   }
 
-  mPositionSize = positionSize;
+  mPosition = positionSize;
+
+  wl_egl_window_resize( mEglWindow, mPosition.width, mPosition.height, mPosition.x, mPosition.y );
 
-  DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height );
+  DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPosition.x, mPosition.y, mPosition.width, mPosition.height );
 }
 
 void WindowRenderSurface::Map()
@@ -279,118 +334,23 @@ void WindowRenderSurface::StartRender()
 {
 }
 
-bool WindowRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface )
+bool WindowRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
 {
-  if( resizingSurface )
-  {
-#ifdef OVER_TIZEN_VERSION_4
-    // 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 );
-    }
-#endif
-
-    // Resize case
-    if( !mResizeFinished )
-    {
-      wl_egl_window_resize( mEglWindow, mPositionSize.width, mPositionSize.height, mPositionSize.x, mPositionSize.y );
-      mResizeFinished = true;
-
-      DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" );
-    }
-  }
-
+  // nothing to do for windows
   return true;
 }
 
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
 {
-  if( resizingSurface )
+  if( mRotated )
   {
-    if( !mRotationFinished )
+    // Check viewport size
+    Dali::Vector< GLint > viewportSize;
+    viewportSize.Resize( 4 );
+
+    glAbstraction.GetIntegerv( GL_VIEWPORT, &viewportSize[0] );
+
+    if( viewportSize[2] == mPosition.width && viewportSize[3] == mPosition.height )
     {
       DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PostRender: Trigger rotation event\n" );
 
@@ -425,16 +385,16 @@ void WindowRenderSurface::SetViewMode( ViewMode viewMode )
 void WindowRenderSurface::CreateWlRenderable()
 {
    // if width or height are zero, go full screen.
-  if ( (mPositionSize.width == 0) || (mPositionSize.height == 0) )
+  if ( (mPosition.width == 0) || (mPosition.height == 0) )
   {
     // Default window size == screen size
-    mPositionSize.x = 0;
-    mPositionSize.y = 0;
+    mPosition.x = 0;
+    mPosition.y = 0;
 
-    ecore_wl_screen_size_get( &mPositionSize.width, &mPositionSize.height );
+    ecore_wl_screen_size_get( &mPosition.width, &mPosition.height );
   }
 
-  mWlWindow = ecore_wl_window_new( 0, mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW );
+  mWlWindow = ecore_wl_window_new( 0, mPosition.x, mPosition.y, mPosition.width, mPosition.height, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW );
 
   if ( mWlWindow == 0 )
   {
@@ -442,27 +402,6 @@ void WindowRenderSurface::CreateWlRenderable()
   }
 
   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 );
-    ecore_wl_window_buffer_transform_set( mWlWindow, transform );
-
-    mScreenRotationAngle = transform * 90;
-    mScreenRotationFinished = false;
-  }
 }
 
 void WindowRenderSurface::UseExistingRenderable( unsigned int surfaceId )
@@ -484,7 +423,7 @@ void WindowRenderSurface::ReleaseLock()
 
 void WindowRenderSurface::ProcessRotationRequest()
 {
-  mRotationFinished = true;
+  mRotated = false;
 
   ecore_wl_window_rotation_change_done_send( mWlWindow );
 
index 969141b7b90009dcb49dbdc35b2e238dc6349d64..aa4eb9b37bf67783be97b35073e654800b7e7ea9 100644 (file)
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <ecore-wl-render-surface.h>
+#include <window.h>
 #include <integration-api/thread-synchronization-interface.h>
 
 namespace Dali
@@ -80,16 +81,11 @@ public: // API
 
   /**
    * Request surface rotation
-   * @param[in] angle A new angle of the surface
+   * @param[in] orientation A new orientation 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();
+  void RequestRotation( Dali::Window::WindowOrientation orientation, int width, int height );
 
   /**
    * @brief Sets whether the surface is transparent or not.
@@ -138,12 +134,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
@@ -181,17 +177,20 @@ private:
 
 private: // Data
 
+  typedef int (*EglWinGetCapabilitiesFunction)( wl_egl_window* eglWindow );
+  typedef int (*EglWinSetRotationFunction)( wl_egl_window* eglWindow, int rotation );
+
+  EglWinGetCapabilitiesFunction  mEglWinGetCapabilitiesPtr;
+  EglWinSetRotationFunction      mEglWinSetRotationPtr;
+
+  void*                           mLibHandle; ///< Handle for the loaded library
   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;
-  bool                            mResizeFinished;
+  bool                            mRotated;
 
 }; // class WindowRenderSurface
 
index 08d7f4b3ee9d4e40d93e52c46de8a9e938115f6d..1d023adace475d482258f2cb6b4b37fabb766adf 100644 (file)
@@ -339,6 +339,11 @@ public:
    */
   void SetStereoBase( float stereoBase );
 
+  /**
+   * @brief Informs core the surface size has changed
+   */
+  void SurfaceSizeChanged( SurfaceSize surfaceSize );
+
 public:  // Signals
 
   /**
index e207082bd754cfaf4d57082d08078c8c62e26e7e..aa747c4177667b66caddb610d7a5fdd47cb13aeb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_ECORE_WL_RENDER_SURFACE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2014 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.
@@ -134,12 +134,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) = 0;
 
   /**
    * @copydoc Dali::RenderSurface::ReleaseLock()
@@ -175,7 +175,7 @@ protected:
 
 protected: // Data
 
-  PositionSize                mPositionSize;       ///< Position
+  PositionSize                mPosition;           ///< 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)
index 11e01e1c333c7b7ca9dab17660c50035fd258118..3b0cd429d880bacef75776054092389241702cb2 100644 (file)
@@ -130,12 +130,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
index 69d1de7b0b37acc1b365cd169e89dac3b9ebfefb..190e1aec48a2a58961cee093fbcca46e33dc2ed4 100644 (file)
@@ -95,12 +95,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
index 8b1a0bf33dc39da3ed8f705c97dfcef0650fe842..3f9b97cc1a7b26422e3193659ed1a122746eb59a 100644 (file)
@@ -142,12 +142,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) = 0;
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction ) = 0;
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface ) = 0;
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface ) = 0;
 
   /**
    * @copydoc Dali::RenderSurface::ReleaseLock()
index 106c90cd9214bec396d9b17b8ed82442d9dff934..f31a0c7fc41eee010b5059bbaa7aac07f69bb4da 100644 (file)
@@ -95,12 +95,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()
index 0bd6b7aba0dd72c655f2e2388ded9c2b507848d9..7af6a74acc46b06360b953ceaa464fdd7e4f7510 100644 (file)
@@ -159,13 +159,13 @@ void NativeRenderSurface::StartRender()
 {
 }
 
-bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
+bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
 {
   // nothing to do for pixmaps
   return true;
 }
 
-void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
 {
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
   eglImpl.SwapBuffers();
index 801a3bbb037e9b6fcce71f44bec120072e0ef664..e2c83cdd12972368eb9bb55e015a6226a3fec612 100644 (file)
@@ -127,12 +127,12 @@ void RenderSurface::StartRender()
 {
 }
 
-bool RenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
+bool RenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
 {
   return true;
 }
 
-void RenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void RenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
 {
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
   eglImpl.SwapBuffers();
index 725c133ba0d09af5c3345ae649353f2dca11ae79..bbbf4d26ee54de423be7df346d26b24b5b3f37fb 100644 (file)
@@ -139,12 +139,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender();
index ab267c22bd91243b42e10d37dbbe2b25e83d5e8c..4683b4c0f8f19c32b2699f1d1ccc86e9039f2cdf 100644 (file)
@@ -418,12 +418,10 @@ void Window::SetSize( Dali::DevelWindow::WindowSize size )
 
     mSurface->MoveResize( positionSize );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
-
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   }
 }
 
index a5cf8db353384410c813635910d60d331fb1dfb4..76a8734d4507e4f1bb172dd74ec778ec2ea0778c 100644 (file)
@@ -194,13 +194,13 @@ void PixmapRenderSurface::StartRender()
 {
 }
 
-bool PixmapRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction&, bool )
+bool PixmapRenderSurface::PreRender( EglInterface& egl, Integration::GlAbstraction& )
 {
   // Nothing to do for pixmaps
   return true;
 }
 
-void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void PixmapRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
 {
   // flush gl instruction queue
   glAbstraction.Flush();
index 5d2148facfa27ae813488a785b5db58347a58140..92e6f74ffb8b59e16d7ba0da079df6a862dce86f 100644 (file)
@@ -808,13 +808,6 @@ void Window::RotationDone( int orientation, int width, int height )
     ecore_x_window_prop_property_set( ecoreWindow,
                                      ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
                                      ECORE_X_ATOM_CARDINAL, 32, &angles, 2 );
-
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) );
-
-    // Emit signal
-    mResizedSignal.Emit( Dali::DevelWindow::WindowSize( width, height ) );
-
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( width, height ) );
 #endif // DALI_PROFILE_UBUNTU
   }
 }
@@ -919,12 +912,10 @@ void Window::SetSize( Dali::DevelWindow::WindowSize size )
 
     mSurface->MoveResize( positionSize );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceSizeChanged( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
-
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   }
 }
 
index 9954f9a57b60afe418e4f381a4d7ca750042706e..af290209c8bcbcfc26dd16bdc9e6f7ba55be4805 100644 (file)
@@ -183,13 +183,13 @@ void WindowRenderSurface::StartRender()
 {
 }
 
-bool WindowRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction&, bool )
+bool WindowRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
 {
   // nothing to do for windows
   return true;
 }
 
-void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
 {
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
   eglImpl.SwapBuffers();
index c3bf33594441d16bc0866c20206eb11078e1e518..f9b5b416ceb9391bb7a5a10c240cc16fac62113e 100644 (file)
@@ -122,12 +122,12 @@ public: // from Dali::RenderSurface
   /**
    * @copydoc Dali::RenderSurface::PreRender()
    */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
 
   /**
    * @copydoc Dali::RenderSurface::PostRender()
    */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
 
   /**
    * @copydoc Dali::RenderSurface::StopRender()