It is waited the window rotation completing until a view finishes to draw.
The view is drawn on the other thread.
It means asychronous rendering occurs between dali render thread and the other thread when window is rotated.
Change-Id: I6bc0fc45337f7972cf2d2bdc7f1a53c3a3710cf3
}
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;
+}
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
*/
DALI_ADAPTOR_API void ExcludeInputRegion(Window window, const Rect<int>& 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
mScene.SurfaceRotated(width, height, orientation);
}
+void SceneHolder::SetRotationCompletedAcknowledgement()
+{
+ mScene.SetRotationCompletedAcknowledgement();
+}
+
void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp)
{
if(timeStamp < 1)
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);
mIsFocusAcceptable(true),
mIconified(false),
mOpaqueState(false),
+ mWindowRotationAcknowledgement(false),
mParentWindow(NULL),
mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
mRotationAngle(0),
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
*/
void ExcludeInputRegion(const Rect<int>& inputRegion);
+ /**
+ * @copydoc Dali::DevelWindow::SetNeedsRotationCompletedAcknowledgement()
+ */
+ void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement);
+
+ /**
+ * @copydoc Dali::DevelWindow::SendRotationCompletedAcknowledgement()
+ */
+ void SendRotationCompletedAcknowledgement();
+
private:
/**
* @brief Enumeration for orietation mode.
bool mIsFocusAcceptable : 1;
bool mIconified : 1;
bool mOpaqueState : 1;
+ bool mWindowRotationAcknowledgement : 1;
Dali::Window mParentWindow;
OrientationPtr mOrientation;
mScreenRotationFinished(true),
mResizeFinished(true),
mDefaultScreenRotationAvailable(false),
- mIsImeWindowSurface(false)
+ mIsImeWindowSurface(false),
+ mNeedWindowRotationAcknowledgement(false)
{
DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n");
Initialize(surface);
if(!mPostRenderTrigger)
{
mPostRenderTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &WindowRenderSurface::ProcessPostRender),
- TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
+ TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
}
mPositionSize.width = width;
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)
{
}
}
+void WindowRenderSurface::SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement)
+{
+ mNeedWindowRotationAcknowledgement = needAcknowledgement;
+}
+
void WindowRenderSurface::OutputTransformed()
{
int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
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();
bool mResizeFinished;
bool mDefaultScreenRotationAvailable;
bool mIsImeWindowSurface;
+ bool mNeedWindowRotationAcknowledgement;
}; // class WindowRenderSurface