From 963e7f2dde53aad71e766f37975f17f6a5aff09c Mon Sep 17 00:00:00 2001 From: "bunam.jeon" Date: Wed, 3 Jul 2013 15:31:24 +0900 Subject: [PATCH] Fix the problem that the screen of the application does not rotation automatically. [Title] Fix the problem that the screen of the application does not rotation automatically. [Issue#] N/A [Problem] It is not rotated automatically and the screen is not updated. When you rotate to landscape mode, then the screen is updated and recovered. [Cause] App is hidden and when the device is rotated, disregard to updateViewportSize. [Solution] If app is hidden, defer to updateViewportSize. Change-Id: Ifee20dfe5dde443ae9528701c221af2994a63e51 --- Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp | 9 +++++++++ Source/WebKit2/UIProcess/API/efl/PageClientImpl.h | 4 ++++ Source/WebKit2/UIProcess/API/efl/ewk_view.cpp | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp index c797a77..0c28a54 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp @@ -104,6 +104,7 @@ PageClientImpl::PageClientImpl(EwkViewImpl* viewImpl) , m_scrollPositionBeforePageRendered(IntPoint()) #endif , m_isVisible(true) + , m_deferUpdateViewportSize(false) , m_isScrollableLayerFocused(false) , m_isScrollableNodeFocused(false) #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE) @@ -193,6 +194,14 @@ void PageClientImpl::updateViewportSize(const IntSize& viewportSize, const int a #if ENABLE(TIZEN_DLOG_SUPPORT) TIZEN_LOGI(" view size: [%d, %d], angle: [%d]", viewportSize.width(), viewportSize.height(), angle); #endif +#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY) + if (m_deferUpdateViewportSize) { + m_visibleContentRect.setSize(viewportSize); + m_viewImpl->page()->setViewportSize(viewportSize); + m_deferUpdateViewportSize = false; + return; + } +#endif // update viewport size of webkit m_viewImpl->page()->setViewportSize(viewportSize); diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h index 77443b8..d6ed801 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.h @@ -202,6 +202,9 @@ public: #if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY) + void setDeferUpdateViewportSize(bool b) { m_deferUpdateViewportSize = b; } + bool deferUpdateViewportSize() const { return m_deferUpdateViewportSize; } + bool isVisible() const { return m_isVisible; } void setIsVisible(bool isVisible); #endif @@ -446,6 +449,7 @@ protected: bool m_suspendResource; bool m_suspendRequested; bool m_isVisible; + bool m_deferUpdateViewportSize; bool m_isScrollableLayerFocused; bool m_isScrollableNodeFocused; diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index 171a0c4..5898418 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -888,8 +888,17 @@ static void _ewk_view_smart_resize(Evas_Object* ewkView, Evas_Coord width, Evas_ #if ENABLE(TIZEN_WEBKIT2_TILED_AC) evas_object_image_native_surface_set(smartData->image, 0); +#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY) + if (impl->pageClient->isVisible()) { + Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas); + impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee)); + } else + impl->pageClient->setDeferUpdateViewportSize(true); +#else Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas); impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee)); +#endif + #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION) if (!ewk_view_is_opengl_backend(ewkView)) _ewk_view_composite(smartData); @@ -959,6 +968,12 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView) #endif #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) && !ENABLE(TIZEN_WEBKIT2_EFL_WTR) Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas); + int newAngle = ecore_evas_rotation_get(ee); +#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY) + if (impl->pageClient->deferUpdateViewportSize()) { + impl->pageClient->updateViewportSize(IntSize(width, height), newAngle); + } +#endif impl->pageClient->updateVisibleContentRectSize(IntSize(width, height)); if (ewk_view_is_opengl_backend(ewkView)) impl->pageClient->displayViewport(); -- 2.7.4