[Title] Prerender first frame of new view size before angle is changed.
[Issue#] DCM-745
[Problem] When rotating, a flicker has occurred.
[Cause] Some frames of old view size is showed.
[Solution] After first frame of new view size is rendered, run displaying.
Change-Id: Ib5786401b38b269cf12da3aa036fb191204e2834
Conflicts:
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
#define ENABLE_TIZEN_UV_MAPPING 1 /* Hyowon Kim(hw1008.kim@samsung.com) : UV mapping to use the platform-surface whose width should be multiple of 8 */
#endif
#define ENABLE_TIZEN_NOT_USE_TRANSFORM_INFO_WHEN_GETTING_CARET_RECT 1 /* Youngtaeck Song(youngtaeck.song@samsung.com) : Patch to do not use transform infomation when getting caret rect */
+#define ENABLE_TIZEN_PRERENDERING_FOR_ROTATION 1 /* Youngtaeck Song(youngtaeck.song@samsung.com) : Prerender contents so that we display whole image immediately when rotating */
#endif
#define ENABLE_TIZEN_WEBKIT2_TILED_AC_DONT_ADJUST_COVER_RECT 1 /* Eunsol Park(eunsol47.park@samsung.
com) : Patch to do not adjust cover rect as fixed pixel size*/
#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
, m_isContextMenuVisible(false)
#endif
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ , m_waitFrameOfNewViewortSize(false)
+#endif
#endif // #if OS(TIZEN)
{
#if ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING)
}
#if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
-void PageClientImpl::updateViewportSize(const IntSize& viewportSize)
+void PageClientImpl::updateViewportSize(const IntSize& viewportSize, const int angle)
{
// update device width & height
int deviceWidth = WebCore::getDefaultScreenResolution().width();
int deviceHeight = WebCore::getDefaultScreenResolution().height();
- Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewImpl->view()));
- int angle = ecore_evas_rotation_get(ee);
+
if (angle == 90 || angle == 270) {
int tempWidth = deviceWidth;
deviceWidth = deviceHeight;
if (m_viewportFitsToContent)
newScale = m_viewportConstraints.minimumScale;
}
+
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ if (m_waitFrameOfNewViewortSize)
+ ewk_view_resume(m_viewImpl->view());
+#endif
+
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
setVisibleContentRect(m_visibleContentRect, newScale);
#else
m_pageDidRendered = true;
initializeVisibleContentRect();
}
+
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ if (m_waitFrameOfNewViewortSize) {
+ m_waitFrameOfNewViewortSize = false;
+ ewkViewRotatePrepared(m_viewImpl->view());
+ }
+#endif
}
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
m_viewImpl->page()->close();
}
-void PageClientEvasGL::updateViewportSize(const WebCore::IntSize& viewportSize)
+void PageClientEvasGL::updateViewportSize(const WebCore::IntSize& viewportSize, const int angle)
{
if (m_surface) {
evas_gl_surface_destroy(m_evasGL, m_surface);
}
setTargetSurface();
- PageClientImpl::updateViewportSize(viewportSize);
+ PageClientImpl::updateViewportSize(viewportSize, angle);
}
void PageClientEvasGL::setViewNeedsDisplay(const WebCore::IntRect& rect)
ViewportConstraints computeViewportConstraints(const WebCore::ViewportAttributes&);
double adjustScaleWithViewport(double);
#if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
- TIZEN_VIRTUAL void updateViewportSize(const WebCore::IntSize& viewportSize);
+ TIZEN_VIRTUAL void updateViewportSize(const WebCore::IntSize&, const int);
#endif
void initializeVisibleContentRect();
double availableMinimumScale();
void showFormDataCandidate(const WebCore::IntRect& rect);
#endif
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ void setWaitFrameOfNewViewortSize(bool waitFrameOfNewViewortSize) { m_waitFrameOfNewViewortSize = waitFrameOfNewViewortSize; }
+#endif
+
#endif // #if OS(TIZEN)
private:
Vector<RefPtr<WebKit::WebEditCommandProxy> > m_undoCommands;
Vector<RefPtr<WebKit::WebEditCommandProxy> > m_redoCommands;
+
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ bool m_waitFrameOfNewViewortSize;
+#endif
+
#endif // #if OS(TIZEN)
};
}
~PageClientEvasGL();
- virtual void updateViewportSize(const WebCore::IntSize& viewportSize);
+ virtual void updateViewportSize(const WebCore::IntSize&, const int);
virtual void setViewNeedsDisplay(const WebCore::IntRect&);
virtual void displayViewport();
virtual void drawContents();
drawingArea->setSize(IntSize(width, height), IntSize());
#endif
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) && !ENABLE(TIZEN_WEBKIT2_EFL_WTR)
- impl->pageClient->updateViewportSize(IntSize(width, height));
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(smartData->base.evas);
+ impl->pageClient->updateViewportSize(IntSize(width, height), ecore_evas_rotation_get(ee));
if (ewk_view_is_opengl_backend(ewkView))
impl->pageClient->displayViewport();
#endif
UNUSED_PARAM(result);
#endif
}
+
+void ewk_view_rotation_prepare(Evas_Object* ewkView, int angle)
+{
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
+
+ int width, height;
+ if (angle == 0 || angle == 180) {
+ width = WebCore::getDefaultScreenResolution().width();
+ height = WebCore::getDefaultScreenResolution().height() + 100;
+ }
+ if (angle == 90 || angle == 270) {
+ width = WebCore::getDefaultScreenResolution().height();
+ height = WebCore::getDefaultScreenResolution().width() + 100;
+ }
+
+ impl->pageProxy->drawingArea()->setSize(IntSize(width, height), IntSize());
+ impl->pageClient->setWaitFrameOfNewViewortSize(true);
+ ewk_view_suspend(ewkView);
+ impl->pageClient->updateViewportSize(IntSize(width, height), angle);
+#endif
+}
+
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+void ewkViewRotatePrepared(Evas_Object* ewkView)
+{
+ evas_object_smart_callback_call(ewkView, "rotate,prepared", 0);
+}
+#endif
+
*/
EAPI Eina_Bool ewk_view_page_save(Evas_Object* o, const char* path);
+/*
+ * Prepare the rotation of the device.
+ *
+ * This function trigger prerendering first frame of new view size before target's angle is changed.
+ * When prerendering is done, "rotate,prepared" event will occur.
+ *
+ * @param o view object to receive orientation event.
+ * @param angle the new angle of the device. (degree)
+ *
+ * angle will be 0 degrees when the device is oriented to natural position,
+ * 90 degrees when it's right side is at the top,
+ * 180 degrees when it is upside down.
+ * 270 degrees when it's left side is at the top,
+ */
+EAPI void ewk_view_rotation_prepare(Evas_Object* ewkView, int angle);
+
#ifdef __cplusplus
}
#endif
bool ewkViewExceededLocalFileSystemQuota(Evas_Object* ewkView, WKSecurityOriginRef origin, long long currentUsage);
#endif
+#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
+void ewkViewRotatePrepared(Evas_Object* ewkView);
+#endif
+
#endif // ewk_view_private_h