From: Heeyong Song Date: Wed, 20 Oct 2021 01:50:27 +0000 (+0000) Subject: Merge "Reset gPreInitializedApplication to reduce reference count" into devel/master X-Git-Tag: dali_2.0.49~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62480e7eb3bb946a5e41d118aaf58e4596bed5fc;hp=8b3b59e5db4ed8ef74cc66f8abf1ac591768a307;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Merge "Reset gPreInitializedApplication to reduce reference count" into devel/master --- diff --git a/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp b/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp index b44030d..895870d 100644 --- a/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp +++ b/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp @@ -1402,3 +1402,50 @@ int UtcDaliWindowSubtractInputRegion(void) } END_TEST; } + + +int UtcDaliWindowSetNeedsRotationCompletedAcknowledgementNegative(void) +{ + try + { + Dali::Window arg1; + DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, true); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliWindowUnsetNeedsRotationCompletedAcknowledgementNegative(void) +{ + try + { + Dali::Window arg1; + DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, false); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} + +int UtcDaliWindowSendRotationCompletedAcknowledgementNegative(void) +{ + try + { + Dali::Window arg1; + DevelWindow::SendRotationCompletedAcknowledgement(arg1); + + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 9f87ce7..09f070c 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -186,6 +186,16 @@ void ExcludeInputRegion(Window window, const Rect& inputRegion) GetImplementation(window).ExcludeInputRegion(inputRegion); } +void SetNeedsRotationCompletedAcknowledgement(Window window, bool needAcknowledgement) +{ + GetImplementation(window).SetNeedsRotationCompletedAcknowledgement(needAcknowledgement); +} + +void SendRotationCompletedAcknowledgement(Window window) +{ + GetImplementation(window).SendRotationCompletedAcknowledgement(); +} + } // namespace DevelWindow } // namespace Dali diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 8bc287e..321b294 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -353,6 +353,29 @@ DALI_ADAPTOR_API void IncludeInputRegion(Window window, const Rect& inputRe */ DALI_ADAPTOR_API void ExcludeInputRegion(Window window, const Rect& inputRegion); +/** + * @brief Sets the necessary for window rotation Acknowledgement. + * After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation. + * + * This function is supprot that application has the window rotation acknowledgement's control. + * It means display server waits when application's rotation work is finished. + * It is useful application has the other rendering engine which works asynchronous. + * For instance, GlView. + * It only works on Tizen device. + * + * @param[in] window The window instance. + * @param[in] needAcknowledgement the flag is true if window rotation acknowledge is sent. + */ +DALI_ADAPTOR_API void SetNeedsRotationCompletedAcknowledgement(Window window, bool needAcknowledgement); + +/** + * @brief send the Acknowledgement to complete window rotation. + * For this function, SetNeedsRotationCompletedAcknowledgement should be already called with true. + * + * @param[in] window The window instance. + */ +DALI_ADAPTOR_API void SendRotationCompletedAcknowledgement(Window window); + } // namespace DevelWindow } // namespace Dali diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index fe93f69..5b64638 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -262,6 +262,11 @@ void SceneHolder::SurfaceRotated(float width, float height, int orientation) mScene.SurfaceRotated(width, height, orientation); } +void SceneHolder::SetRotationCompletedAcknowledgement() +{ + mScene.SetRotationCompletedAcknowledgement(); +} + void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp) { if(timeStamp < 1) diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index ce33fb4..7f6c9ff 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -170,6 +170,12 @@ public: void SurfaceRotated(float width, float height, int orientation); /** + * @brief Send message to acknowledge window rotation with current window orientation. + * It is to send message to render thread for completing window rotation by user. + */ + void SetRotationCompletedAcknowledgement(); + + /** * @copydoc Dali::Integration::SceneHolder::FeedTouchPoint */ void FeedTouchPoint(Dali::Integration::Point& point, int timeStamp); diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index a9ba67e..ce7a6a7 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -79,6 +79,7 @@ Window::Window() mIsFocusAcceptable(true), mIconified(false), mOpaqueState(false), + mWindowRotationAcknowledgement(false), mParentWindow(NULL), mPreferredAngle(static_cast(WindowOrientation::NO_ORIENTATION_PREFERENCE)), mRotationAngle(0), @@ -1020,6 +1021,22 @@ void Window::ExcludeInputRegion(const Rect& inputRegion) mWindowBase->ExcludeInputRegion(inputRegion); } +void Window::SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement) +{ + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), needAcknowledgement(%d) Set needs Rotation Completed Acknowledgement\n", this, mNativeWindowId, needAcknowledgement); + mWindowSurface->SetNeedsRotationCompletedAcknowledgement(needAcknowledgement); + mWindowRotationAcknowledgement = needAcknowledgement; +} + +void Window::SendRotationCompletedAcknowledgement() +{ + DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SendRotationCompletedAcknowledgement(): orientation: %d, mWindowRotationAcknowledgement: %d\n", this, mNativeWindowId, mRotationAngle, mWindowRotationAcknowledgement); + if(mWindowRotationAcknowledgement) + { + SetRotationCompletedAcknowledgement(); + } +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 843870b..4287126 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -406,6 +406,16 @@ public: // Dali::Internal::Adaptor::SceneHolder */ void ExcludeInputRegion(const Rect& inputRegion); + /** + * @copydoc Dali::DevelWindow::SetNeedsRotationCompletedAcknowledgement() + */ + void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement); + + /** + * @copydoc Dali::DevelWindow::SendRotationCompletedAcknowledgement() + */ + void SendRotationCompletedAcknowledgement(); + private: /** * @brief Enumeration for orietation mode. @@ -610,6 +620,7 @@ private: bool mIsFocusAcceptable : 1; bool mIconified : 1; bool mOpaqueState : 1; + bool mWindowRotationAcknowledgement : 1; Dali::Window mParentWindow; OrientationPtr mOrientation; diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 4a44951..8e3c997 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -146,7 +146,8 @@ WindowRenderSurface::WindowRenderSurface(Dali::PositionSize positionSize, Any su mScreenRotationFinished(true), mResizeFinished(true), mDefaultScreenRotationAvailable(false), - mIsImeWindowSurface(false) + mIsImeWindowSurface(false), + mNeedWindowRotationAcknowledgement(false) { DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n"); Initialize(surface); @@ -215,7 +216,7 @@ void WindowRenderSurface::RequestRotation(int angle, int width, int height) if(!mPostRenderTrigger) { mPostRenderTrigger = std::unique_ptr(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessPostRender), - TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER)); + TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER)); } mPositionSize.width = width; @@ -581,7 +582,31 @@ void WindowRenderSurface::PostRender() GlImplementation& mGLES = eglGraphics->GetGlesInterface(); mGLES.PostRender(); - if((mIsResizing && !mWindowRotationFinished) || mIsImeWindowSurface) + bool needWindowRotationCompleted = false; + + if(!mWindowRotationFinished) + { + if(mNeedWindowRotationAcknowledgement) + { + Dali::Integration::Scene scene = mScene.GetHandle(); + if(scene) + { + if(scene.IsRotationCompletedAcknowledgementSet()) + { + needWindowRotationCompleted = true; + } + } + } + else + { + if(mIsResizing) + { + needWindowRotationCompleted = true; + } + } + } + + if(needWindowRotationCompleted || mIsImeWindowSurface) { if(mThreadSynchronization) { @@ -659,6 +684,11 @@ void WindowRenderSurface::InitializeImeSurface() } } +void WindowRenderSurface::SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement) +{ + mNeedWindowRotationAcknowledgement = needAcknowledgement; +} + void WindowRenderSurface::OutputTransformed() { int screenRotationAngle = mWindowBase->GetScreenRotationAngle(); diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index bd15471..e0ef0ec 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -119,6 +119,17 @@ public: // API void InitializeImeSurface(); /** + * @brief Sets the necessary for window rotation acknowledge. + * After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation. + * + * More detail description is written in DevelWindow::SetNeedsRotationCompletedAcknowledgement(). + * + * @param[in] window The window instance. + * @param[in] needAcknowledgement the flag is true if window rotation acknowledgement is sent. + */ + void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement); + + /** * @brief This signal is emitted when the output is transformed. */ OutputSignalType& OutputTransformedSignal(); @@ -319,6 +330,7 @@ private: // Data bool mResizeFinished; bool mDefaultScreenRotationAvailable; bool mIsImeWindowSurface; + bool mNeedWindowRotationAcknowledgement; }; // class WindowRenderSurface