From: Wonsik Jung Date: Thu, 22 Sep 2022 21:49:01 +0000 (+0900) Subject: Fix race-condition when window is resized or rotated. X-Git-Tag: dali_2.2.0~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=858e8fc245edd695501f3e9d460669e592bda9d3;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Fix race-condition when window is resized or rotated. Internal dali window module has some variables and flags. They are set by both main thread and render thread. It has the effect of race condition when window is resized or rotated serval times. This patch is to fix them. Change-Id: I785fca0ba1cfaa90f418f1fe79ac000dd67e48ec --- diff --git a/dali/integration-api/adaptor-framework/render-surface-interface.h b/dali/integration-api/adaptor-framework/render-surface-interface.h index a3303a4..6f0e471 100644 --- a/dali/integration-api/adaptor-framework/render-surface-interface.h +++ b/dali/integration-api/adaptor-framework/render-surface-interface.h @@ -81,7 +81,6 @@ public: mDisplayConnection(nullptr), mScene(), mFullSwapNextFrame(true), - mIsResizing(false), mDepthBufferRequired(Integration::DepthBufferAvailable::FALSE), mStencilBufferRequired(Integration::StencilBufferAvailable::FALSE) { @@ -112,7 +111,13 @@ public: * @brief Return the orientation of the surface. * @return The orientation */ - virtual int GetOrientation() const = 0; + virtual int GetSurfaceOrientation() const = 0; + + /** + * @brief Return the orientation of the screen. + * @return The screen orientation + */ + virtual int GetScreenOrientation() const = 0; /** * @brief InitializeGraphics the platform specific graphics surface interfaces @@ -233,14 +238,6 @@ public: mFullSwapNextFrame = true; } - /** - * @brief Sets whether this surface is being resized. - */ - void SetIsResizing(bool isResizing) - { - mIsResizing = isResizing; - } - private: /** * @brief Undefined copy constructor. RenderSurface cannot be copied @@ -258,7 +255,6 @@ protected: Dali::DisplayConnection* mDisplayConnection; WeakHandle mScene; bool mFullSwapNextFrame; ///< Whether the full surface swap is required - bool mIsResizing; ///< Whether the surface is being resized private: Integration::DepthBufferAvailable mDepthBufferRequired; ///< Whether the depth buffer is required diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index 13b93d7..aa033eb 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -153,7 +153,9 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) mScene.SurfaceReplaced(); - SurfaceResized(); + PositionSize surfacePositionSize = surface->GetPositionSize(); + + SurfaceResized(static_cast(surfacePositionSize.width), static_cast(surfacePositionSize.height)); InitializeDpi(); @@ -166,10 +168,9 @@ void SceneHolder::SetSurface(Dali::RenderSurfaceInterface* surface) OnSurfaceSet(surface); } -void SceneHolder::SurfaceResized() +void SceneHolder::SurfaceResized(float width, float height) { - PositionSize surfacePositionSize = mSurface->GetPositionSize(); - mScene.SurfaceResized(static_cast(surfacePositionSize.width), static_cast(surfacePositionSize.height)); + mScene.SurfaceResized(width, height); mSurface->SetFullSwapNextFrame(); @@ -211,8 +212,10 @@ void SceneHolder::SetAdaptor(Dali::Adaptor& adaptor) // Create the scene PositionSize surfacePositionSize = mSurface->GetPositionSize(); - int orientation = mSurface->GetOrientation(); - mScene = Dali::Integration::Scene::New(Size(static_cast(surfacePositionSize.width), static_cast(surfacePositionSize.height)), orientation); + int windowOrientation = mSurface->GetSurfaceOrientation(); + int screenOrientation = mSurface->GetScreenOrientation(); + + mScene = Dali::Integration::Scene::New(Size(static_cast(surfacePositionSize.width), static_cast(surfacePositionSize.height)), windowOrientation, screenOrientation); Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor); mAdaptor = &adaptorImpl; @@ -256,9 +259,9 @@ void SceneHolder::Resume() OnResume(); } -void SceneHolder::SurfaceRotated(float width, float height, int orientation) +void SceneHolder::SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation) { - mScene.SurfaceRotated(width, height, orientation); + mScene.SurfaceRotated(width, height, windowOrientation, screenOrientation); } void SceneHolder::SetRotationCompletedAcknowledgement() diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 196e0d9..8868d52 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -115,8 +115,10 @@ public: /** * @brief Called when the surface set is resized. + * @param[in] width the resized window's width + * @param[in] height the resized window's height */ - void SurfaceResized(); + void SurfaceResized(float width, float height); /** * @brief Get the render surface @@ -165,9 +167,10 @@ public: * * @param[in] width The width of rotated surface * @param[in] height The height of rotated surface - * @param[in] orientation The orientation of rotated surface + * @param[in] windowOrientation the current window orientation + * @param[in] screenOrientation the current screen orientation */ - void SurfaceRotated(float width, float height, int orientation); + void SurfaceRotated(float width, float height, int32_t windowOrientation, int32_t screenOrientation); /** * @brief Send message to acknowledge window rotation with current window orientation. diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 350ab2a..ed56e9f 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -683,8 +683,6 @@ void CombinedUpdateRenderController::UpdateRenderThread() WindowContainer windows; mAdaptorInterfaces.GetWindowContainerInterface(windows); - bool sceneSurfaceResized; - for(auto&& window : windows) { Dali::Integration::Scene scene = window->GetScene(); @@ -694,9 +692,7 @@ void CombinedUpdateRenderController::UpdateRenderThread() { Integration::RenderStatus windowRenderStatus; - // Get Surface Resized flag - sceneSurfaceResized = scene.IsSurfaceRectChanged(); - windowSurface->SetIsResizing(sceneSurfaceResized); + const bool sceneSurfaceResized = scene.IsSurfaceRectChanged(); // clear previous frame damaged render items rects, buffer history is tracked on surface level mDamagedRects.clear(); diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index 004af89..abab78f 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -386,7 +386,7 @@ int WindowBaseAndroid::CreateFramePresentedSyncFence() return -1; } -int WindowBaseAndroid::GetOrientation() const +int WindowBaseAndroid::GetWindowRotationAngle() const { return 0; } diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index 9f1b797..6be667e 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -399,9 +399,9 @@ public: int CreateFramePresentedSyncFence() override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle() diff --git a/dali/internal/window-system/common/gl-window-impl.cpp b/dali/internal/window-system/common/gl-window-impl.cpp index 536cd56..db58107 100644 --- a/dali/internal/window-system/common/gl-window-impl.cpp +++ b/dali/internal/window-system/common/gl-window-impl.cpp @@ -680,7 +680,6 @@ WindowOrientation GlWindow::ConvertToOrientation(int angle) const WindowOrientation GlWindow::GetCurrentOrientation() const { - DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), GetCurrentOrientation(): %d\n", this, mNativeWindowId, mTotalRotationAngle); return ConvertToOrientation(mTotalRotationAngle); } diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 0e0091a..d0115ed 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -353,18 +353,19 @@ public: virtual void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) = 0; /** - * @brief Return the orientation of the surface. - * @return The orientation + * @brief Return the angle of the window's rotation. + * @return The window orientation */ - virtual int GetOrientation() const = 0; + virtual int GetWindowRotationAngle() const = 0; /** - * @brief Get the screen rotation angle of the window + * @brief Get the angle of screen rotation for the window + * @return The screen orientation */ virtual int GetScreenRotationAngle() = 0; /** - * @brief Set the rotation angle of the window + * @brief Set the screen rotation angle of the window */ virtual void SetWindowRotationAngle(int degree) = 0; diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 3317792..e4c2cd5 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -100,7 +100,8 @@ Window::Window() mIconified(false), mOpaqueState(false), mWindowRotationAcknowledgement(false), - mFocused(false) + mFocused(false), + mIsWindowRotating(false) { } @@ -158,6 +159,7 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage); mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed); + mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished); AddAuxiliaryHint("wm.policy.win.user.geometry", "1"); @@ -176,6 +178,18 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std { mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT; } + + if(positionSize.width <= 0 || positionSize.height <= 0) + { + mWindowWidth = screenWidth; + mWindowHeight = screenHeight; + } + else + { + mWindowWidth = positionSize.width; + mWindowHeight = positionSize.height; + } + // For Debugging mNativeWindowId = mWindowBase->GetNativeWindowId(); } @@ -657,25 +671,27 @@ int Window::GetBrightness() const void Window::SetSize(Dali::Window::WindowSize size) { - PositionSize oldRect = mSurface->GetPositionSize(); - - mWindowSurface->MoveResize(PositionSize(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight())); + PositionSize oldRect = GetPositionSize(); - PositionSize newRect = mSurface->GetPositionSize(); + PositionSize newRect; + newRect.width = size.GetWidth(); + newRect.height = size.GetHeight(); // When surface size is updated, inform adaptor of resizing and emit ResizeSignal if((oldRect.width != newRect.width) || (oldRect.height != newRect.height)) { + mWindowSurface->MoveResize(PositionSize(oldRect.x, oldRect.y, newRect.width, newRect.height)); + Uint16Pair newSize(newRect.width, newRect.height); mWindowWidth = newRect.width; mWindowHeight = newRect.height; - SurfaceResized(); + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetSize(): (%d, %d), [%d x %d]\n", this, mNativeWindowId, mRotationAngle, oldRect.x, oldRect.y, newRect.width, newRect.height); - mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize); + SurfaceResized(static_cast(mWindowWidth), static_cast(mWindowHeight)); - DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetSize(): resize signal [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.width, newRect.height); + mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize); Dali::Window handle(this); mResizeSignal.Emit(handle, newSize); @@ -690,9 +706,7 @@ void Window::SetSize(Dali::Window::WindowSize size) Dali::Window::WindowSize Window::GetSize() const { - PositionSize positionSize = mSurface->GetPositionSize(); - - return Dali::Window::WindowSize(positionSize.width, positionSize.height); + return Dali::Window::WindowSize(mWindowWidth, mWindowHeight); } void Window::SetPosition(Dali::Window::WindowPosition position) @@ -719,44 +733,63 @@ void Window::SetPosition(Dali::Window::WindowPosition position) Dali::Window::WindowPosition Window::GetPosition() const { - PositionSize positionSize = mSurface->GetPositionSize(); - + PositionSize positionSize = GetPositionSize(); return Dali::Window::WindowPosition(positionSize.x, positionSize.y); } PositionSize Window::GetPositionSize() const { - return mSurface->GetPositionSize(); + PositionSize positionSize = mSurface->GetPositionSize(); + positionSize.width = mWindowWidth; + positionSize.height = mWindowHeight; + return positionSize; } void Window::SetPositionSize(PositionSize positionSize) { - PositionSize oldRect = mSurface->GetPositionSize(); + bool moved = false; + bool resize = false; + + PositionSize oldRect = GetPositionSize(); Dali::Window handle(this); - mWindowSurface->MoveResize(positionSize); + if((oldRect.x != positionSize.x) || (oldRect.y != positionSize.y)) + { + moved = true; + } - PositionSize newRect = mSurface->GetPositionSize(); + if((oldRect.width != positionSize.width) || (oldRect.height != positionSize.height)) + { + resize = true; + } - if((oldRect.x != newRect.x) || (oldRect.y != newRect.y)) + if(moved || resize) { - Dali::Window::WindowPosition position(newRect.x, newRect.y); + mWindowSurface->MoveResize(positionSize); + } + + // When window is moved, emit Moved Signal + if(moved) + { + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, positionSize.x, positionSize.y); + Dali::Window::WindowPosition position(positionSize.x, positionSize.y); mMovedSignal.Emit(handle, position); } // When surface size is updated, inform adaptor of resizing and emit ResizeSignal - if((oldRect.width != newRect.width) || (oldRect.height != newRect.height)) + if(resize) { - Uint16Pair newSize(newRect.width, newRect.height); + Uint16Pair newSize(positionSize.width, positionSize.height); - mWindowWidth = newRect.width; - mWindowHeight = newRect.height; + mWindowWidth = positionSize.width; + mWindowHeight = positionSize.height; - SurfaceResized(); + SurfaceResized(static_cast(mWindowWidth), static_cast(mWindowHeight)); mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize); - DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetPositionSize():resize signal [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.width, newRect.height); + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resize signal emit [%d x %d]\n", this, mNativeWindowId, positionSize.width, positionSize.height); + mResizeSignal.Emit(handle, newSize); mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize); } @@ -857,10 +890,9 @@ void Window::OnFocusChanged(bool focusIn) void Window::OnOutputTransformed() { - PositionSize positionSize = mSurface->GetPositionSize(); + PositionSize positionSize = GetPositionSize(); - int orientation = (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360; - SurfaceRotated(static_cast(positionSize.width), static_cast(positionSize.height), orientation); + SurfaceRotated(static_cast(positionSize.width), static_cast(positionSize.height), mRotationAngle, mWindowBase->GetScreenRotationAngle()); mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height)); mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height)); @@ -890,13 +922,12 @@ void Window::OnWindowRedrawRequest() void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize) { - bool resized = false; - bool moved = false; - Dali::Window handle(this); - PositionSize oldRect = mSurface->GetPositionSize(); + bool moved = false; + bool resize = false; - mWindowSurface->UpdatePositionSize(positionSize); + Dali::Window handle(this); + PositionSize oldRect = GetPositionSize(); PositionSize newRect = positionSize; if((oldRect.x != newRect.x) || (oldRect.y != newRect.y)) @@ -906,28 +937,35 @@ void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize) if((oldRect.width != newRect.width) || (oldRect.height != newRect.height)) { - resized = true; + resize = true; } - if(moved) + if(moved || resize) + { + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), position or size is updated by server , (%d, %d) [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.x, newRect.y, newRect.width, newRect.height); + mWindowSurface->UpdatePositionSize(positionSize); + } + + if((oldRect.x != newRect.x) || (oldRect.y != newRect.y)) { + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, newRect.x, newRect.y); Dali::Window::WindowPosition position(newRect.x, newRect.y); mMovedSignal.Emit(handle, position); } // When surface size is updated, inform adaptor of resizing and emit ResizeSignal - if(resized) + if((oldRect.width != newRect.width) || (oldRect.height != newRect.height)) { Uint16Pair newSize(newRect.width, newRect.height); mWindowWidth = newRect.width; mWindowHeight = newRect.height; - SurfaceResized(); + SurfaceResized(static_cast(mWindowWidth), static_cast(mWindowHeight)); mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize); - DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Updated PositionSize by server :resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height); + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resized signal emit [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height); mResizeSignal.Emit(handle, newSize); mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize); } @@ -962,24 +1000,30 @@ void Window::OnRotation(const RotationEvent& rotation) mWindowWidth = rotation.width; mWindowHeight = rotation.height; + mIsWindowRotating = true; + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), angle(%d), Window Rotation (%d , %d) [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newPositionSize.x, newPositionSize.y, mWindowWidth, mWindowHeight); + // Notify that the orientation is changed mOrientation->OnOrientationChange(rotation); mWindowSurface->RequestRotation(mRotationAngle, newPositionSize); - int orientation = (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360; - SurfaceRotated(mWindowWidth, mWindowHeight, orientation); + SurfaceRotated(static_cast(mWindowWidth), static_cast(mWindowHeight), mRotationAngle, mWindowBase->GetScreenRotationAngle()); mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight)); - DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), OnRotation(): x[%d], y[%d], resize signal emit [%d x %d]\n", this, mNativeWindowId, newPositionSize.x, newPositionSize.y, mWindowWidth, mWindowHeight); - // Emit signal Dali::Window handle(this); mResizeSignal.Emit(handle, Dali::Window::WindowSize(mWindowWidth, mWindowHeight)); mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight)); } +void Window::OnRotationFinished() +{ + mIsWindowRotating = false; + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), window rotation is finised\n", this, mNativeWindowId); +} + void Window::OnPause() { if(mEventHandler) @@ -1259,7 +1303,7 @@ void Window::SendRotationCompletedAcknowledgement() bool Window::IsWindowRotating() const { - return mWindowSurface->IsWindowRotating(); + return mIsWindowRotating; } const Dali::KeyEvent& Window::GetLastKeyEvent() const diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index a639431..eb3aac6 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -576,6 +576,13 @@ private: void OnAccessibilityDisabled(); /** + * Called when the window rotation is finished. + * + * This signal is emmit when window rotation is finisehd and WindowRotationCompleted() is called. + */ + void OnRotationFinished(); + + /** * @brief Set available orientation to window base. */ void SetAvailableAnlges(const std::vector& angles); @@ -776,6 +783,7 @@ private: bool mOpaqueState : 1; bool mWindowRotationAcknowledgement : 1; bool mFocused : 1; + bool mIsWindowRotating : 1; ///< The window rotating flag. }; } // namespace Adaptor diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 4f00430..2e23548 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -164,6 +164,7 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su mEGLContext(nullptr), mColorDepth(isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24), mOutputTransformedSignal(), + mWindowRotationFinishedSignal(), mFrameCallbackInfoContainer(), mBufferDamagedRects(), mMutex(), @@ -172,12 +173,9 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su mDpiHorizontal(0), mDpiVertical(0), mOwnSurface(false), - mWindowRotationFinished(true), - mScreenRotationFinished(true), - mResizeFinished(true), - mDefaultScreenRotationAvailable(false), mIsImeWindowSurface(false), - mNeedWindowRotationAcknowledgement(false) + mNeedWindowRotationAcknowledgement(false), + mIsWindowOrientationChanging(false) { DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n"); Initialize(surface); @@ -206,13 +204,11 @@ void WindowRenderSurface::Initialize(Any surface) mWindowBase->OutputTransformedSignal().Connect(this, &WindowRenderSurface::OutputTransformed); // Check screen rotation - mScreenRotationAngle = mWindowBase->GetScreenRotationAngle(); - if(mScreenRotationAngle != 0) + int screenRotationAngle = mWindowBase->GetScreenRotationAngle(); + if(screenRotationAngle != 0) { - mScreenRotationFinished = false; - mResizeFinished = false; - mDefaultScreenRotationAvailable = true; - DALI_LOG_RELEASE_INFO("WindowRenderSurface::Initialize, screen rotation is enabled, screen rotation angle:[%d]\n", mScreenRotationAngle); + OutputTransformed(); + DALI_LOG_RELEASE_INFO("WindowRenderSurface::Initialize, screen rotation is enabled, screen rotation angle:[%d]\n", screenRotationAngle); } } @@ -249,15 +245,12 @@ void WindowRenderSurface::RequestRotation(int angle, PositionSize positionSize) TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER)); } - mPositionSize = positionSize; - - mWindowRotationAngle = angle; - mWindowRotationFinished = false; - mResizeFinished = false; + mPositionSize.x = positionSize.x; + mPositionSize.y = positionSize.y; - mWindowBase->SetWindowRotationAngle(mWindowRotationAngle); + mWindowBase->SetWindowRotationAngle(angle); - DALI_LOG_RELEASE_INFO("angle = %d screen rotation = %d, flag = %d\n", mWindowRotationAngle, mScreenRotationAngle, mWindowRotationFinished); + DALI_LOG_RELEASE_INFO("start window rotation angle = %d screen rotation = %d\n", angle, mScreenRotationAngle); } WindowBase* WindowRenderSurface::GetWindowBase() @@ -270,6 +263,11 @@ WindowBase::OutputSignalType& WindowRenderSurface::OutputTransformedSignal() return mOutputTransformedSignal; } +WindowRenderSurface::RotationFinishedSignalType& WindowRenderSurface::RotationFinishedSignal() +{ + return mWindowRotationFinishedSignal; +} + PositionSize WindowRenderSurface::GetPositionSize() const { return mPositionSize; @@ -295,9 +293,14 @@ void WindowRenderSurface::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiV dpiVertical = mDpiVertical; } -int WindowRenderSurface::GetOrientation() const +int WindowRenderSurface::GetSurfaceOrientation() const { - return mWindowBase->GetOrientation(); + return mWindowBase->GetWindowRotationAngle(); +} + +int WindowRenderSurface::GetScreenOrientation() const +{ + return mWindowBase->GetScreenRotationAngle(); } void WindowRenderSurface::InitializeGraphics() @@ -398,9 +401,6 @@ bool WindowRenderSurface::ReplaceGraphicsSurface() // Create the EGL window EGLNativeWindowType window = mWindowBase->CreateEglWindow(width, height); - // Set screen rotation - mScreenRotationFinished = false; - auto eglGraphics = static_cast(mGraphics); Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); @@ -409,83 +409,25 @@ bool WindowRenderSurface::ReplaceGraphicsSurface() void WindowRenderSurface::UpdatePositionSize(Dali::PositionSize positionSize) { - bool needToMove = false; - bool needToResize = false; - // Check moving if((fabs(positionSize.x - mPositionSize.x) >= MINIMUM_DIMENSION_CHANGE) || (fabs(positionSize.y - mPositionSize.y) >= MINIMUM_DIMENSION_CHANGE)) { - needToMove = true; - } + mPositionSize.x = positionSize.x; + mPositionSize.y = positionSize.y; - // Check resizing - if((fabs(positionSize.width - mPositionSize.width) >= MINIMUM_DIMENSION_CHANGE) || - (fabs(positionSize.height - mPositionSize.height) >= MINIMUM_DIMENSION_CHANGE)) - { - needToResize = true; - } - - if(needToResize) - { - mResizeFinished = false; - mPositionSize = positionSize; + DALI_LOG_RELEASE_INFO("Update Position by server (%d, %d)\n", mPositionSize.x, mPositionSize.y); } - else - { - if(needToMove) - { - mPositionSize = positionSize; - } - } - - DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height); } void WindowRenderSurface::MoveResize(Dali::PositionSize positionSize) { - bool needToMove = false; - bool needToResize = false; - - // Check moving - 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 - mPositionSize.width) >= MINIMUM_DIMENSION_CHANGE) || - (fabs(positionSize.height - mPositionSize.height) >= MINIMUM_DIMENSION_CHANGE)) - { - needToResize = true; - } - - if(needToResize) - { - if(needToMove) - { - mWindowBase->MoveResize(positionSize); - } - else - { - mWindowBase->Resize(positionSize); - } + mPositionSize.x = positionSize.x; + mPositionSize.y = positionSize.y; - mResizeFinished = false; - mPositionSize = positionSize; - } - else - { - if(needToMove) - { - mWindowBase->Move(positionSize); - - mPositionSize = positionSize; - } - } + DALI_LOG_RELEASE_INFO("Update Position by client (%d, %d)\n", positionSize.x, positionSize.y); - DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height); + mWindowBase->MoveResize(positionSize); } void WindowRenderSurface::StartRender() @@ -499,6 +441,7 @@ bool WindowRenderSurface::PreRender(bool resizingSurface, const std::vectorSetEglWindowBufferTransform(totalAngle); + mWindowRotationAngle = scene.GetCurrentSurfaceOrientation(); + mIsWindowOrientationChanging = true; + } + + if(mScreenRotationAngle != scene.GetCurrentScreenOrientation()) + { + mScreenRotationAngle = scene.GetCurrentScreenOrientation(); + isScreenOrientationChanging = true; + } + totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360; - // Reset only screen rotation flag - mScreenRotationFinished = true; + DALI_LOG_RELEASE_INFO("Window/Screen orientation ard changed, WinOrientation[%d],flag[%d], ScreenOrientation[%d],flag[%d], total[%d]\n", mWindowRotationAngle, mIsWindowOrientationChanging, mScreenRotationAngle, isScreenOrientationChanging, totalAngle); - DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mWindowRotationAngle, mScreenRotationAngle); + Rect surfaceSize = scene.GetCurrentSurfaceRect(); + //update surface size + mPositionSize.width = surfaceSize.width; + mPositionSize.height = surfaceSize.height; + + DALI_LOG_RELEASE_INFO("Window is resizing, (%d, %d), [%d x %d]\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height); + + // Window rotate or screen rotate + if(mIsWindowOrientationChanging || isScreenOrientationChanging) + { + mWindowBase->SetEglWindowBufferTransform(totalAngle); } // Only window rotate - if(!mWindowRotationFinished) + if(mIsWindowOrientationChanging) { mWindowBase->SetEglWindowTransform(mWindowRotationAngle); } // Resize case - if(!mResizeFinished) - { - Dali::PositionSize positionSize; - positionSize.x = mPositionSize.x; - positionSize.y = mPositionSize.y; - if(totalAngle == 0 || totalAngle == 180) - { - positionSize.width = mPositionSize.width; - positionSize.height = mPositionSize.height; - } - else - { - positionSize.width = mPositionSize.height; - positionSize.height = mPositionSize.width; - } - mWindowBase->ResizeEglWindow(positionSize); - mResizeFinished = true; + Dali::PositionSize positionSize; - DALI_LOG_RELEASE_INFO("WindowRenderSurface::PreRender: Set resize, totalAngle: %d, x: %d, y: %d, w: %d, h:%d\n", totalAngle, positionSize.x, positionSize.y, positionSize.width, positionSize.height); + // Some native resize API(wl_egl_window_resize) has the input parameters of x, y, width and height. + // So, position data should be set. + positionSize.x = mPositionSize.x; + positionSize.y = mPositionSize.y; + if(totalAngle == 0 || totalAngle == 180) + { + positionSize.width = mPositionSize.width; + positionSize.height = mPositionSize.height; + } + else + { + positionSize.width = mPositionSize.height; + positionSize.height = mPositionSize.width; } + mWindowBase->ResizeEglWindow(positionSize); + SetFullSwapNextFrame(); - mDefaultScreenRotationAvailable = false; } SetBufferDamagedRects(damagedRects, clippingRect); @@ -644,7 +601,7 @@ void WindowRenderSurface::PostRender() bool needWindowRotationCompleted = false; - if(!mWindowRotationFinished) + if(mIsWindowOrientationChanging) { if(mNeedWindowRotationAcknowledgement) { @@ -659,10 +616,7 @@ void WindowRenderSurface::PostRender() } else { - if(mIsResizing) - { - needWindowRotationCompleted = true; - } + needWindowRotationCompleted = true; } } @@ -674,7 +628,7 @@ void WindowRenderSurface::PostRender() mThreadSynchronization->PostRenderStarted(); } - if(!mWindowRotationFinished || mIsImeWindowSurface) + if(mIsWindowOrientationChanging || mIsImeWindowSurface) { mPostRenderTrigger->Trigger(); } @@ -755,13 +709,9 @@ void WindowRenderSurface::OutputTransformed() if(mScreenRotationAngle != screenRotationAngle) { - mScreenRotationAngle = screenRotationAngle; - mScreenRotationFinished = false; - mResizeFinished = false; - mOutputTransformedSignal.Emit(); - DALI_LOG_RELEASE_INFO("WindowRenderSurface::OutputTransformed: window = %d screen = %d\n", mWindowRotationAngle, mScreenRotationAngle); + DALI_LOG_RELEASE_INFO("WindowRenderSurface::OutputTransformed: window = %d new screen angle = %d\n", mWindowRotationAngle, screenRotationAngle); } else { @@ -769,18 +719,14 @@ void WindowRenderSurface::OutputTransformed() } } -bool WindowRenderSurface::IsWindowRotating() const -{ - return !(mWindowRotationFinished); -} - void WindowRenderSurface::ProcessPostRender() { - if(!mWindowRotationFinished) + if(mIsWindowOrientationChanging) { + mWindowRotationFinishedSignal.Emit(); mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height); - mWindowRotationFinished = true; - DALI_LOG_RELEASE_INFO("WindowRenderSurface::ProcessPostRender: Rotation Done, flag = %d\n", mWindowRotationFinished); + mIsWindowOrientationChanging = false; + DALI_LOG_RELEASE_INFO("WindowRenderSurface::ProcessPostRender: Rotation Done, flag = %d\n", mIsWindowOrientationChanging); } if(mIsImeWindowSurface) diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index 660dfdb..a6643e6 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -48,8 +48,10 @@ class AdaptorInternalServices; class WindowRenderSurface : public Dali::RenderSurfaceInterface, public ConnectionTracker { public: - using OutputSignalType = Signal; - using DamagedRectsContainer = std::vector>; + + using RotationFinishedSignalType = Signal ; ///; + using DamagedRectsContainer = std::vector>; /** * Uses an window surface to render to. @@ -138,16 +140,14 @@ public: // API void UpdatePositionSize(Dali::PositionSize positionSize); /** - * @brief Query whether window is rotating or not. - * - * @return true if window is rotating, false otherwise. + * @brief This signal is emitted when the output is transformed. */ - bool IsWindowRotating() const; + OutputSignalType& OutputTransformedSignal(); /** - * @brief This signal is emitted when the output is transformed. + * @brief This signal is emitted when a rotation job is finished. */ - OutputSignalType& OutputTransformedSignal(); + RotationFinishedSignalType& RotationFinishedSignal(); public: // from Dali::RenderSurfaceInterface /** @@ -160,9 +160,14 @@ public: // from Dali::RenderSurfaceInterface void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::RenderSurfaceInterface::GetOrientation() + * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation() + */ + int GetSurfaceOrientation() const override; + + /** + * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation() */ - int GetOrientation() const override; + int GetScreenOrientation() const override; /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() @@ -330,7 +335,8 @@ private: // Data EGLSurface mEGLSurface; EGLContext mEGLContext; ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit) - OutputSignalType mOutputTransformedSignal; + OutputSignalType mOutputTransformedSignal; ///< The signal of screen rotation occurs + RotationFinishedSignalType mWindowRotationFinishedSignal; ///< The signal of window rotation's finished FrameCallbackInfoContainer mFrameCallbackInfoContainer; DamagedRectsContainer mBufferDamagedRects; Dali::Mutex mMutex; @@ -340,12 +346,9 @@ private: // Data uint32_t mDpiVertical; std::vector> mDamagedRects{}; ///< Keeps collected damaged render items rects for one render pass. These rects are rotated by scene orientation. bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it) - bool mWindowRotationFinished; - bool mScreenRotationFinished; - bool mResizeFinished; - bool mDefaultScreenRotationAvailable; bool mIsImeWindowSurface; bool mNeedWindowRotationAcknowledgement; + bool mIsWindowOrientationChanging; }; // class WindowRenderSurface diff --git a/dali/internal/window-system/macos/window-base-mac.h b/dali/internal/window-system/macos/window-base-mac.h index a1d6e2d..174c6bc 100644 --- a/dali/internal/window-system/macos/window-base-mac.h +++ b/dali/internal/window-system/macos/window-base-mac.h @@ -298,9 +298,9 @@ public: void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index 7c1de56..988ea87 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -643,7 +643,7 @@ void WindowBaseCocoa::GetDpi( dpiVertical = res.height; } -int WindowBaseCocoa::GetOrientation() const +int WindowBaseCocoa::GetWindowRotationAngle() const { return 0; } diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 9645a04..ddf4ad5 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -2071,9 +2071,9 @@ void WindowBaseEcoreWl::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVer dpiVertical = int(yres + 0.5f); } -int WindowBaseEcoreWl::GetOrientation() const +int WindowBaseEcoreWl::GetWindowRotationAngle() const { - int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + int orientation = mWindowRotationAngle; if(mSupportedPreProtation) { orientation = 0; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 741224d..463359c 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -420,9 +420,9 @@ public: void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 3594c91..d99721c 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -1048,7 +1048,6 @@ void WindowBaseEcoreWl2::OnConfiguration(void* data, int type, void* event) ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height); Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(mWindowPositionSize); - DALI_LOG_RELEASE_INFO("emit signal to update window's position and size, x[%d] y[%d] w[%d] h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height); mUpdatePositionSizeSignal.Emit(newPositionSize); } @@ -1621,6 +1620,7 @@ void WindowBaseEcoreWl2::SetEglWindowBufferTransform(int angle) } } + DALI_LOG_RELEASE_INFO("wl_egl_window_tizen_set_buffer_transform() with buffer Transform [%d]\n", bufferTransform); wl_egl_window_tizen_set_buffer_transform(mEglWindow, bufferTransform); } @@ -1657,11 +1657,13 @@ void WindowBaseEcoreWl2::SetEglWindowTransform(int angle) } } + DALI_LOG_RELEASE_INFO("wl_egl_window_tizen_set_window_transform() with window Transform [%d]\n", windowTransform); wl_egl_window_tizen_set_window_transform(mEglWindow, windowTransform); } void WindowBaseEcoreWl2::ResizeEglWindow(PositionSize positionSize) { + DALI_LOG_RELEASE_INFO("wl_egl_window_resize(), (%d, %d) [%d x %d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height); wl_egl_window_resize(mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y); // Note: Both "Resize" and "MoveResize" cases can reach here, but only "MoveResize" needs to submit serial number @@ -1718,9 +1720,6 @@ PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToSystem(PositionSize po newPositionSize.height = positionSize.height; } - DALI_LOG_RELEASE_INFO("input coord x[%d], y[%d], w{%d], h[%d], screen w[%d], h[%d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height, mScreenWidth, mScreenHeight); - DALI_LOG_RELEASE_INFO("recalc coord x[%d], y[%d], w{%d], h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height); - return newPositionSize; } @@ -1757,9 +1756,6 @@ PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToCurrentOrientation(Pos newPositionSize.height = positionSize.height; } - DALI_LOG_RELEASE_INFO("input coord x[%d], y[%d], w{%d], h[%d], screen w[%d], h[%d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height, mScreenWidth, mScreenHeight); - DALI_LOG_RELEASE_INFO("recalc by current orientation coord x[%d], y[%d], w{%d], h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height); - return newPositionSize; } @@ -2568,9 +2564,9 @@ void WindowBaseEcoreWl2::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVe dpiVertical = int(yres + 0.5f); } -int WindowBaseEcoreWl2::GetOrientation() const +int WindowBaseEcoreWl2::GetWindowRotationAngle() const { - int orientation = (mScreenRotationAngle + mWindowRotationAngle) % 360; + int orientation = mWindowRotationAngle; if(mSupportedPreProtation) { orientation = 0; @@ -2580,8 +2576,12 @@ int WindowBaseEcoreWl2::GetOrientation() const int WindowBaseEcoreWl2::GetScreenRotationAngle() { - int transform = 0; - + if(mSupportedPreProtation) + { + DALI_LOG_RELEASE_INFO("Support PreRotation and return 0\n"); + return 0; + } + int transform; if(ecore_wl2_window_ignore_output_transform_get(mEcoreWindow)) { transform = 0; diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 78e2e8b..6b66478 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -459,9 +459,9 @@ public: void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index b752013..09fd990 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -139,7 +139,12 @@ void NativeRenderSurfaceEcoreWl::GetDpi(unsigned int& dpiHorizontal, unsigned in dpiVertical = int(yres + 0.5f); } -int NativeRenderSurfaceEcoreWl::GetOrientation() const +int NativeRenderSurfaceEcoreWl::GetSurfaceOrientation() const +{ + return 0; +} + +int NativeRenderSurfaceEcoreWl::GetScreenOrientation() const { return 0; } diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h index f33588e..404a916 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h @@ -76,9 +76,14 @@ public: // from Dali::RenderSurfaceInterface void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::RenderSurfaceInterface::GetOrientation() + * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation() */ - int GetOrientation() const override; + int GetSurfaceOrientation() const override; + + /** + * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation() + */ + int GetScreenOrientation() const override; /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp index c79fd3b..1249fb0 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp @@ -146,7 +146,12 @@ void PixmapRenderSurfaceEcoreX::GetDpi(unsigned int& dpiHorizontal, unsigned int dpiVertical = int(yres + 0.5f); } -int PixmapRenderSurfaceEcoreX::GetOrientation() const +int PixmapRenderSurfaceEcoreX::GetSurfaceOrientation() const +{ + return 0; +} + +int PixmapRenderSurfaceEcoreX::GetScreenOrientation() const { return 0; } diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h index 4970520..9e549bb 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h @@ -78,9 +78,14 @@ public: // from Dali::RenderSurfaceInterface void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation() */ - int GetOrientation() const override; + int GetSurfaceOrientation() const override; + + /** + * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation() + */ + int GetScreenOrientation() const override; /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index 3afc70e..0104a36 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -867,7 +867,7 @@ void WindowBaseEcoreX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVert dpiVertical = ecore_x_dpi_get(); } -int WindowBaseEcoreX::GetOrientation() const +int WindowBaseEcoreX::GetWindowRotationAngle() const { return 0; } diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 5739c19..d0b069d 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -365,9 +365,9 @@ public: void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle() diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index 0a66241..22aa274 100644 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -494,7 +494,7 @@ void WindowBaseWin::SetTransparency(bool transparent) { } -int WindowBaseWin::GetOrientation() const +int WindowBaseWin::GetWindowRotationAngle() const { return 0; } diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index 169fb18..748157a 100644 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -372,9 +372,9 @@ public: void SetTransparency(bool transparent) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent() diff --git a/dali/internal/window-system/x11/pixmap-render-surface-x.cpp b/dali/internal/window-system/x11/pixmap-render-surface-x.cpp index 74e7258..2cf61e9 100644 --- a/dali/internal/window-system/x11/pixmap-render-surface-x.cpp +++ b/dali/internal/window-system/x11/pixmap-render-surface-x.cpp @@ -139,7 +139,12 @@ void PixmapRenderSurfaceX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpi WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical); } -int PixmapRenderSurfaceX::GetOrientation() const +int PixmapRenderSurfaceX::GetSurfaceOrientation() const +{ + return 0; +} + +int PixmapRenderSurfaceX::GetScreenOrientation() const { return 0; } diff --git a/dali/internal/window-system/x11/pixmap-render-surface-x.h b/dali/internal/window-system/x11/pixmap-render-surface-x.h index c003401..bd1f357 100644 --- a/dali/internal/window-system/x11/pixmap-render-surface-x.h +++ b/dali/internal/window-system/x11/pixmap-render-surface-x.h @@ -76,9 +76,14 @@ public: // from Dali::RenderSurfaceInterface void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::RenderSurfaceInterface::GetSurfaceOrientation() */ - int GetOrientation() const override; + int GetSurfaceOrientation() const override; + + /** + * @copydoc Dali::RenderSurfaceInterface::GetScreenOrientation() + */ + int GetScreenOrientation() const override; /** * @copydoc Dali::RenderSurfaceInterface::InitializeGraphics() diff --git a/dali/internal/window-system/x11/window-base-x.cpp b/dali/internal/window-system/x11/window-base-x.cpp index 89232ab..c07f0e8 100644 --- a/dali/internal/window-system/x11/window-base-x.cpp +++ b/dali/internal/window-system/x11/window-base-x.cpp @@ -812,7 +812,7 @@ void WindowBaseX::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) WindowSystem::GetImplementation().GetDPI(dpiHorizontal, dpiVertical); } -int WindowBaseX::GetOrientation() const +int WindowBaseX::GetWindowRotationAngle() const { return 0; } diff --git a/dali/internal/window-system/x11/window-base-x.h b/dali/internal/window-system/x11/window-base-x.h index ac305f8..bcd46be 100644 --- a/dali/internal/window-system/x11/window-base-x.h +++ b/dali/internal/window-system/x11/window-base-x.h @@ -369,9 +369,9 @@ public: void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override; /** - * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation() + * @copydoc Dali::Internal::Adaptor::WindowBase::GetWindowRotationAngle() */ - int GetOrientation() const override; + int GetWindowRotationAngle() const override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()