[EFL][WK2] Use the port independent PageViewportController
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 15:44:21 +0000 (15:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 15:44:21 +0000 (15:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=99850

Patch by Yael Aharon <yael.aharon@intel.com> on 2012-10-23
Reviewed by Kenneth Rohde Christiansen.

Take PageViewportController into use, and rely on it to calculate
scroll position and zoom level.
With this patch, we can do intra page navigation and use the scrollwheel
to scroll, when WTF_USE_TILED_BACKING_STORE and all related flags are enabled.

* CMakeLists.txt:
* UIProcess/API/efl/PageClientImpl.cpp:
(WebKit::PageClientImpl::didChangeViewportProperties):
(WebKit::PageClientImpl::pageDidRequestScroll):
(WebKit::PageClientImpl::didChangeContentsSize):
(WebKit):
(WebKit::PageClientImpl::didRenderFrame):
(WebKit::PageClientImpl::pageTransitionViewportReady):
* UIProcess/API/efl/PageClientImpl.h:
(WebKit):
(PageClientImpl):
(WebKit::PageClientImpl::setPageViewportController):
* UIProcess/API/efl/PageViewportControllerClientEfl.cpp:
(WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
(WebKit::PageViewportControllerClientEfl::display):
(WebKit::PageViewportControllerClientEfl::updateViewportSize):
(WebKit::PageViewportControllerClientEfl::setVisibleContentsRect):
(WebKit::PageViewportControllerClientEfl::didChangeContentsSize):
(WebKit::PageViewportControllerClientEfl::setViewportPosition):
(WebKit::PageViewportControllerClientEfl::setContentsScale):
(WebKit::PageViewportControllerClientEfl::didResumeContent):
(WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
(WebKit::PageViewportControllerClientEfl::setController):
* UIProcess/API/efl/PageViewportControllerClientEfl.h:
(WebKit::PageViewportControllerClientEfl::scaleFactor):
(WebKit::PageViewportControllerClientEfl::scrollPosition):
(PageViewportControllerClientEfl):
* UIProcess/API/efl/ewk_view.cpp:
(Ewk_View_Private_Data):
(mapToWebContent):
(_ewk_view_smart_mouse_wheel):
(_ewk_view_smart_mouse_down):
(_ewk_view_smart_mouse_up):
(_ewk_view_smart_mouse_move):
(_ewk_view_initialize):
(ewk_view_load_committed):
(ewk_view_feed_touch_event):
* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
(WebKit::LayerTreeCoordinatorProxy::didRenderFrame):
* UIProcess/PageClient.h:
(PageClient):
* UIProcess/PageViewportController.cpp:
* UIProcess/PageViewportController.h:
* UIProcess/WebPageProxy.cpp:
(WebKit):
(WebKit::WebPageProxy::pageTransitionViewportReady):
(WebKit::WebPageProxy::didRenderFrame):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/efl/PageLoadClientEfl.cpp:
(WebKit):
(WebKit::PageLoadClientEfl::didCommitLoadForFrame):
(WebKit::PageLoadClientEfl::PageLoadClientEfl):
* UIProcess/efl/PageLoadClientEfl.h:
(PageLoadClientEfl):
* UIProcess/qt/WebPageProxyQt.cpp:
(WebKit):
(WebKit::WebPageProxy::setUserScripts):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132228 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp
Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/PageViewportController.cpp
Source/WebKit2/UIProcess/PageViewportController.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp
Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h
Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index b6bfc7c..6e46f48 100644 (file)
@@ -237,6 +237,7 @@ SET(WebKit2_SOURCES
     UIProcess/GeolocationPermissionRequestManagerProxy.cpp
     UIProcess/GeolocationPermissionRequestProxy.cpp
 
+    UIProcess/PageViewportController.cpp
     UIProcess/ResponsivenessTimer.cpp
     UIProcess/VisitedLinkProvider.cpp
     UIProcess/WebApplicationCacheManagerProxy.cpp
index 62dd2ca..a9dcc04 100644 (file)
@@ -1,3 +1,78 @@
+2012-10-23  Yael Aharon  <yael.aharon@intel.com>
+
+        [EFL][WK2] Use the port independent PageViewportController
+        https://bugs.webkit.org/show_bug.cgi?id=99850
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Take PageViewportController into use, and rely on it to calculate
+        scroll position and zoom level.
+        With this patch, we can do intra page navigation and use the scrollwheel
+        to scroll, when WTF_USE_TILED_BACKING_STORE and all related flags are enabled.
+
+        * CMakeLists.txt:
+        * UIProcess/API/efl/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::didChangeViewportProperties):
+        (WebKit::PageClientImpl::pageDidRequestScroll):
+        (WebKit::PageClientImpl::didChangeContentsSize):
+        (WebKit):
+        (WebKit::PageClientImpl::didRenderFrame):
+        (WebKit::PageClientImpl::pageTransitionViewportReady):
+        * UIProcess/API/efl/PageClientImpl.h:
+        (WebKit):
+        (PageClientImpl):
+        (WebKit::PageClientImpl::setPageViewportController):
+        * UIProcess/API/efl/PageViewportControllerClientEfl.cpp:
+        (WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
+        (WebKit::PageViewportControllerClientEfl::display):
+        (WebKit::PageViewportControllerClientEfl::updateViewportSize):
+        (WebKit::PageViewportControllerClientEfl::setVisibleContentsRect):
+        (WebKit::PageViewportControllerClientEfl::didChangeContentsSize):
+        (WebKit::PageViewportControllerClientEfl::setViewportPosition):
+        (WebKit::PageViewportControllerClientEfl::setContentsScale):
+        (WebKit::PageViewportControllerClientEfl::didResumeContent):
+        (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
+        (WebKit::PageViewportControllerClientEfl::setController):
+        * UIProcess/API/efl/PageViewportControllerClientEfl.h:
+        (WebKit::PageViewportControllerClientEfl::scaleFactor):
+        (WebKit::PageViewportControllerClientEfl::scrollPosition):
+        (PageViewportControllerClientEfl):
+        * UIProcess/API/efl/ewk_view.cpp:
+        (Ewk_View_Private_Data):
+        (mapToWebContent):
+        (_ewk_view_smart_mouse_wheel):
+        (_ewk_view_smart_mouse_down):
+        (_ewk_view_smart_mouse_up):
+        (_ewk_view_smart_mouse_move):
+        (_ewk_view_initialize):
+        (ewk_view_load_committed):
+        (ewk_view_feed_touch_event):
+        * UIProcess/API/efl/ewk_view_private.h:
+        * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
+        (WebKit::LayerTreeCoordinatorProxy::didRenderFrame):
+        * UIProcess/PageClient.h:
+        (PageClient):
+        * UIProcess/PageViewportController.cpp:
+        * UIProcess/PageViewportController.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit):
+        (WebKit::WebPageProxy::pageTransitionViewportReady):
+        (WebKit::WebPageProxy::didRenderFrame):
+        * UIProcess/WebPageProxy.h:
+        (WebPageProxy):
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/efl/PageLoadClientEfl.cpp:
+        (WebKit):
+        (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
+        (WebKit::PageLoadClientEfl::PageLoadClientEfl):
+        * UIProcess/efl/PageLoadClientEfl.h:
+        (PageLoadClientEfl):
+        * UIProcess/qt/WebPageProxyQt.cpp:
+        (WebKit):
+        (WebKit::WebPageProxy::setUserScripts):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didCompletePageTransition):
+
 2012-10-16  Kenneth Rohde Christiansen  <kenneth@webkit.org>
 
         Add support for resolution media query
index 32e3904..467907c 100644 (file)
 #include "ewk_view.h"
 #include "ewk_view_private.h"
 
+#if USE(TILED_BACKING_STORE)
+#include "PageViewportController.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -138,9 +142,13 @@ void PageClientImpl::setCursorHiddenUntilMouseMoves(bool)
     notImplemented();
 }
 
-void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes&)
+void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes& attr)
 {
-    notImplemented();
+#if USE(TILED_BACKING_STORE)
+    m_pageViewportController->didChangeViewportAttributes(attr);
+#else
+    UNUSED_PARAM(attr);
+#endif
 }
 
 void PageClientImpl::registerEditCommand(PassRefPtr<WebEditCommandProxy> command, WebPageProxy::UndoOrRedo undoOrRedo)
@@ -293,15 +301,31 @@ void PageClientImpl::handleDownloadRequest(DownloadProxy* download)
 }
 
 #if USE(TILED_BACKING_STORE)
-void PageClientImpl::pageDidRequestScroll(const IntPoint&)
+void PageClientImpl::pageDidRequestScroll(const IntPoint& position)
 {
-    notImplemented();
+    m_pageViewportController->pageDidRequestScroll(position);
 }
 #endif
 
 void PageClientImpl::didChangeContentsSize(const WebCore::IntSize& size)
 {
+#if USE(TILED_BACKING_STORE)
+    m_pageViewportController->didChangeContentsSize(size);
+#else
     ewk_view_contents_size_changed(m_viewWidget, size);
+#endif
 }
 
+#if USE(TILED_BACKING_STORE)
+void PageClientImpl::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
+{
+    m_pageViewportController->didRenderFrame(contentsSize, coveredRect);
+}
+
+void PageClientImpl::pageTransitionViewportReady()
+{
+    m_pageViewportController->pageTransitionViewportReady();
+}
+#endif
+
 } // namespace WebKit
index 0844c2d..c64e106 100644 (file)
@@ -32,6 +32,8 @@
 
 namespace WebKit {
 
+class PageViewportController;
+
 class PageClientImpl : public PageClient {
 public:
     static PassOwnPtr<PageClientImpl> create(Evas_Object* viewWidget)
@@ -41,7 +43,9 @@ public:
     ~PageClientImpl();
 
     Evas_Object* viewWidget() const { return m_viewWidget; }
-
+#if USE(TILED_BACKING_STORE)
+    void setPageViewportController(PageViewportController* controller) { m_pageViewportController = controller; }
+#endif
 
 private:
     explicit PageClientImpl(Evas_Object*);
@@ -115,9 +119,17 @@ private:
 
     virtual void didChangeContentsSize(const WebCore::IntSize&);
 
+#if USE(TILED_BACKING_STORE)
+    virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
+    virtual void pageTransitionViewportReady();
+#endif
+
 private:
     Evas_Object* m_viewWidget;
     DefaultUndoController m_undoController;
+#if USE(TILED_BACKING_STORE)
+    PageViewportController* m_pageViewportController;
+#endif
 };
 
 } // namespace WebKit
index 99160c4..5eb676e 100644 (file)
 #include "config.h"
 #include "PageViewportControllerClientEfl.h"
 
-#if USE(COORDINATED_GRAPHICS)
+#if USE(TILED_BACKING_STORE)
 
 #include "LayerTreeCoordinatorProxy.h"
 #include "LayerTreeRenderer.h"
+#include "PageViewportController.h"
 #include "TransformationMatrix.h"
 #include "ewk_view_private.h"
 
@@ -40,6 +41,7 @@ namespace WebKit {
 PageViewportControllerClientEfl::PageViewportControllerClientEfl(Evas_Object* viewWidget)
     : m_viewWidget(viewWidget)
     , m_scaleFactor(1)
+    , m_pageViewportController(0)
 {
     ASSERT(m_viewWidget);
 }
@@ -61,7 +63,7 @@ void PageViewportControllerClientEfl::setRendererActive(bool active)
 void PageViewportControllerClientEfl::display(const IntRect& rect, const IntPoint& viewPosition)
 {
     WebCore::TransformationMatrix matrix;
-    matrix.setMatrix(m_scaleFactor, 0, 0, m_scaleFactor, -m_visibleContentRect.x() + viewPosition.x(), -m_visibleContentRect.y() + viewPosition.y());
+    matrix.setMatrix(m_scaleFactor, 0, 0, m_scaleFactor, -m_scrollPosition.x() * m_scaleFactor + viewPosition.x() , -m_scrollPosition.y() * m_scaleFactor + viewPosition.y());
 
     LayerTreeRenderer* renderer = drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer();
     renderer->setActive(true);
@@ -75,52 +77,44 @@ void PageViewportControllerClientEfl::updateViewportSize(const IntSize& viewport
 {
     m_viewportSize = viewportSize;
     ewk_view_page_get(m_viewWidget)->setViewportSize(viewportSize);
-    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
+    m_pageViewportController->didChangeViewportSize(viewportSize);
 }
 
-void PageViewportControllerClientEfl::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& trajectory)
+void PageViewportControllerClientEfl::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& /*trajectory*/)
 {
     m_scaleFactor = newScale;
-    m_visibleContentRect = IntRect(newScrollPosition, m_viewportSize);
-
-    // Move visibleContentRect inside contentsRect when visibleContentRect goes outside contentsRect. 
-    IntSize contentsSize = m_contentsSize;
-    contentsSize.scale(m_scaleFactor);
-    if (m_visibleContentRect.x() > contentsSize.width() - m_visibleContentRect.width())
-        m_visibleContentRect.setX(contentsSize.width() - m_visibleContentRect.width());
-    if (m_visibleContentRect.x() < 0)
-        m_visibleContentRect.setX(0);
-    if (m_visibleContentRect.y() > contentsSize.height() - m_visibleContentRect.height())
-        m_visibleContentRect.setY(contentsSize.height() - m_visibleContentRect.height());
-    if (m_visibleContentRect.y() < 0)
-        m_visibleContentRect.setY(0);
-
-    FloatRect mapRectToWebContent = m_visibleContentRect;
-    mapRectToWebContent.scale(1 / m_scaleFactor);
-    drawingArea()->setVisibleContentsRect(enclosingIntRect(mapRectToWebContent), m_scaleFactor, trajectory);
+    m_scrollPosition = newScrollPosition;
+    m_pageViewportController->didChangeContentsVisibility(m_scrollPosition, m_scaleFactor, FloatPoint());
 }
 
 void PageViewportControllerClientEfl::didChangeContentsSize(const WebCore::IntSize& size)
 {
     m_contentsSize = size;
-    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
-    drawingArea()->layerTreeCoordinatorProxy()->setContentsSize(WebCore::FloatSize(size.width(), size.height()));
+    IntRect rect = IntRect(IntPoint(), m_viewportSize);
+    ewk_view_display(m_viewWidget, rect);
 }
 
-void PageViewportControllerClientEfl::setViewportPosition(const WebCore::FloatPoint& /*contentsPoint*/)
+void PageViewportControllerClientEfl::setViewportPosition(const WebCore::FloatPoint& contentsPoint)
 {
+    setVisibleContentsRect(IntPoint(contentsPoint.x(), contentsPoint.y()), m_scaleFactor, FloatPoint());
 }
 
-void PageViewportControllerClientEfl::setContentsScale(float, bool /*treatAsInitialValue*/)
+void PageViewportControllerClientEfl::setContentsScale(float newScale, bool treatAsInitialValue)
 {
+    if (treatAsInitialValue)
+        m_scrollPosition = IntPoint();
+    m_scaleFactor = newScale;
 }
 
 void PageViewportControllerClientEfl::didResumeContent()
 {
+    m_pageViewportController->didChangeContentsVisibility(m_scrollPosition, m_scaleFactor);
 }
 
 void PageViewportControllerClientEfl::didChangeVisibleContents()
 {
+    IntRect rect = IntRect(IntPoint(), m_viewportSize);
+    ewk_view_display(m_viewWidget, rect);
 }
 
 void PageViewportControllerClientEfl::didChangeViewportAttributes()
@@ -129,8 +123,9 @@ void PageViewportControllerClientEfl::didChangeViewportAttributes()
 
 void PageViewportControllerClientEfl::setController(PageViewportController* pageViewportController)
 {
+    m_pageViewportController = pageViewportController;
 }
 
 } // namespace WebKit
-#endif // USE(COORDINATED_GRAPHICS)
+#endif // USE(TILED_BACKING_STORE)
 
index 9434526..f6138f4 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef PageViewportControllerClientEfl_h
 #define PageViewportControllerClientEfl_h
 
-#if USE(COORDINATED_GRAPHICS)
+#if USE(TILED_BACKING_STORE)
 
 #include "PageClientImpl.h"
 #include "PageViewportControllerClient.h"
@@ -44,6 +44,8 @@ public:
 
     DrawingAreaProxy* drawingArea() const;
     WebCore::IntSize viewSize() { return m_viewportSize; }
+    float scaleFactor() const { return m_scaleFactor; }
+    WebCore::IntPoint scrollPosition() { return m_scrollPosition; }
 
     void display(const WebCore::IntRect& rect, const WebCore::IntPoint& viewPosition);
     void updateViewportSize(const WebCore::IntSize& viewportSize);
@@ -64,10 +66,11 @@ private:
     explicit PageViewportControllerClientEfl(Evas_Object*);
 
     Evas_Object* m_viewWidget;
-    WebCore::IntRect m_visibleContentRect;
     WebCore::IntSize m_contentsSize;
     WebCore::IntSize m_viewportSize;
+    WebCore::IntPoint m_scrollPosition;
     float m_scaleFactor;
+    PageViewportController* m_pageViewportController;
 };
 
 } // namespace WebKit
index ed1fa29..70e6915 100644 (file)
@@ -78,7 +78,8 @@
 #include <Evas_GL.h>
 #endif
 
-#if USE(COORDINATED_GRAPHICS)
+#if USE(TILED_BACKING_STORE)
+#include "PageViewportController.h"
 #include "PageViewportControllerClientEfl.h"
 #endif
 
@@ -119,8 +120,9 @@ static inline void removeFromPageViewMap(const Evas_Object* ewkView)
 
 struct Ewk_View_Private_Data {
     OwnPtr<PageClientImpl> pageClient;
-#if USE(COORDINATED_GRAPHICS)
+#if USE(TILED_BACKING_STORE)
     OwnPtr<PageViewportControllerClientEfl> pageViewportControllerClient;
+    OwnPtr<PageViewportController> pageViewportController;
 #endif
     RefPtr<WebPageProxy> pageProxy;
     OwnPtr<PageLoadClientEfl> pageLoadClient;
@@ -289,12 +291,30 @@ static Eina_Bool _ewk_view_smart_focus_out(Ewk_View_Smart_Data* smartData)
     return true;
 }
 
+#if USE(TILED_BACKING_STORE)
+static Evas_Coord_Point mapToWebContent(Ewk_View_Smart_Data* smartData, Evas_Coord_Point point)
+{
+    Evas_Coord_Point result;
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, result);
+
+    result.x = (point.x  - smartData->view.x) / priv->pageViewportControllerClient->scaleFactor() + smartData->view.x + priv->pageViewportControllerClient->scrollPosition().x();
+    result.y = (point.y - smartData->view.y) / priv->pageViewportControllerClient->scaleFactor() + smartData->view.y + priv->pageViewportControllerClient->scrollPosition().y();
+    return result;
+}
+#endif
+
 static Eina_Bool _ewk_view_smart_mouse_wheel(Ewk_View_Smart_Data* smartData, const Evas_Event_Mouse_Wheel* wheelEvent)
 {
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
     Evas_Point position = {smartData->view.x, smartData->view.y};
+#if USE(TILED_BACKING_STORE)
+    Evas_Event_Mouse_Wheel event(*wheelEvent);
+    event.canvas = mapToWebContent(smartData, event.canvas);
+    priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(&event, &position));
+#else
     priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(wheelEvent, &position));
+#endif
     return true;
 }
 
@@ -303,7 +323,13 @@ static Eina_Bool _ewk_view_smart_mouse_down(Ewk_View_Smart_Data* smartData, cons
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
     Evas_Point position = {smartData->view.x, smartData->view.y};
+#if USE(TILED_BACKING_STORE)
+    Evas_Event_Mouse_Down event(*downEvent);
+    event.canvas = mapToWebContent(smartData, event.canvas);
+    priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(&event, &position));
+#else
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(downEvent, &position));
+#endif
     return true;
 }
 
@@ -312,7 +338,13 @@ static Eina_Bool _ewk_view_smart_mouse_up(Ewk_View_Smart_Data* smartData, const
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
     Evas_Point position = {smartData->view.x, smartData->view.y};
+#if USE(TILED_BACKING_STORE)
+    Evas_Event_Mouse_Up event(*upEvent);
+    event.canvas = mapToWebContent(smartData, event.canvas);
+    priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(&event, &position));
+#else
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(upEvent, &position));
+#endif
 
     if (priv->imfContext)
         ecore_imf_context_reset(priv->imfContext);
@@ -325,7 +357,13 @@ static Eina_Bool _ewk_view_smart_mouse_move(Ewk_View_Smart_Data* smartData, cons
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
     Evas_Point position = {smartData->view.x, smartData->view.y};
+#if USE(TILED_BACKING_STORE)
+    Evas_Event_Mouse_Move event(*moveEvent);
+    event.cur.canvas = mapToWebContent(smartData, event.cur.canvas);
+    priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(&event, &position));
+#else
     priv->pageProxy->handleMouseEvent(NativeWebMouseEvent(moveEvent, &position));
+#endif
     return true;
 }
 
@@ -879,8 +917,10 @@ static void _ewk_view_initialize(Evas_Object* ewkView, PassRefPtr<Ewk_Context> c
     priv->settings = adoptPtr(new Ewk_Settings(WKPageGroupGetPreferences(WKPageGetPageGroup(toAPI(priv->pageProxy.get())))));
     priv->context = context;
 
-#if USE(COORDINATED_GRAPHICS)
+#if USE(TILED_BACKING_STORE)
     priv->pageViewportControllerClient = PageViewportControllerClientEfl::create(ewkView);
+    priv->pageViewportController = adoptPtr(new PageViewportController(priv->pageProxy.get(), priv->pageViewportControllerClient.get()));
+    priv->pageClient->setPageViewportController(priv->pageViewportController.get());
 #endif
 
     // Initialize page clients.
@@ -1616,6 +1656,16 @@ void ewk_view_load_provisional_failed(Evas_Object* ewkView, const Ewk_Error* err
     evas_object_smart_callback_call(ewkView, "load,provisional,failed", const_cast<Ewk_Error*>(error));
 }
 
+#if USE(TILED_BACKING_STORE)
+void ewk_view_load_committed(Evas_Object* ewkView)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
+
+    priv->pageViewportController->didCommitLoad();
+}
+#endif
+
 /**
  * @internal
  * Reports view received redirect for provisional load.
@@ -2051,6 +2101,8 @@ Eina_Bool ewk_view_feed_touch_event(Evas_Object* ewkView, Ewk_Touch_Event_Type t
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
 
     Evas_Point position = { smartData->view.x, smartData->view.y };
+    // FIXME: Touch points do not take scroll position and scale into account when 
+    // TILED_BACKING_STORE is enabled.
     priv->pageProxy->handleTouchEvent(NativeWebTouchEvent(type, points, modifiers, &position, ecore_time_get()));
 
     return true;
index 1360f60..baed5f9 100644 (file)
@@ -69,6 +69,9 @@ void ewk_view_load_error(Evas_Object* ewkView, const Ewk_Error* error);
 void ewk_view_load_finished(Evas_Object* ewkView);
 void ewk_view_load_progress_changed(Evas_Object* ewkView, double progress);
 void ewk_view_load_provisional_failed(Evas_Object* ewkView, const Ewk_Error* error);
+#if USE(TILED_BACKING_STORE)
+void ewk_view_load_committed(Evas_Object* ewkView);
+#endif
 void ewk_view_load_provisional_redirect(Evas_Object* ewkView);
 void ewk_view_load_provisional_started(Evas_Object* ewkView);
 void ewk_view_navigation_policy_decision(Evas_Object* ewkView, Ewk_Navigation_Policy_Decision* decision);
index 1953afb..4db2feb 100644 (file)
@@ -120,7 +120,7 @@ void LayerTreeCoordinatorProxy::didRenderFrame(const WebCore::IntSize& contentsS
 {
     dispatchUpdate(bind(&LayerTreeRenderer::flushLayerChanges, m_renderer.get()));
     updateViewport();
-#if PLATFORM(QT)
+#if USE(TILED_BACKING_STORE)
     m_drawingAreaProxy->page()->didRenderFrame(contentsSize, coveredRect);
 #else
     UNUSED_PARAM(contentsSize);
index 9e8e094..9450e5e 100644 (file)
@@ -116,10 +116,10 @@ public:
 
 #if USE(TILED_BACKING_STORE)
     virtual void pageDidRequestScroll(const WebCore::IntPoint&) = 0;
-#endif
-#if PLATFORM(QT)
     virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) = 0;
     virtual void pageTransitionViewportReady() = 0;
+#endif
+#if PLATFORM(QT)
     virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0;
     virtual void didReceiveMessageFromNavigatorQtObject(const String&) = 0;
     virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) = 0;
index 88d52ba..dbb7454 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #include "PageViewportController.h"
 
+#if USE(TILED_BACKING_STORE)
+
 #include "PageViewportControllerClient.h"
 #include "WebPageProxy.h"
 #include <WebCore/FloatRect.h>
@@ -289,3 +291,5 @@ void PageViewportController::updateMinimumScaleToFit()
 }
 
 } // namespace WebKit
+
+#endif
index d38ddb9..38088db 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef PageViewportController_h
 #define PageViewportController_h
 
+#if USE(TILED_BACKING_STORE)
+
 #include <WebCore/FloatPoint.h>
 #include <WebCore/FloatRect.h>
 #include <WebCore/FloatSize.h>
@@ -140,4 +142,6 @@ bool fuzzyCompare(float, float, float epsilon);
 
 } // namespace WebKit
 
+#endif
+
 #endif // PageViewportController_h
index 4cfacb4..cc39bd6 100644 (file)
@@ -2675,6 +2675,17 @@ void WebPageProxy::pageDidRequestScroll(const IntPoint& point)
 {
     m_pageClient->pageDidRequestScroll(point);
 }
+
+void WebPageProxy::pageTransitionViewportReady()
+{
+    m_pageClient->pageTransitionViewportReady();
+}
+
+void WebPageProxy::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
+{
+    m_pageClient->didRenderFrame(contentsSize, coveredRect);
+}
+
 #endif
 
 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
index 0715751..6da3f24 100644 (file)
@@ -355,8 +355,10 @@ public:
     
     bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; }
     void setMaintainsInactiveSelection(bool);
-#if PLATFORM(QT)
+#if USE(TILED_BACKING_STORE) 
     void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
+#endif
+#if PLATFORM(QT)
     void registerApplicationScheme(const String& scheme);
     void resolveApplicationSchemeRequest(QtNetworkRequestData);
     void sendApplicationSchemeReply(const QQuickNetworkReply*);
@@ -858,10 +860,9 @@ private:
     
 #if USE(TILED_BACKING_STORE)
     void pageDidRequestScroll(const WebCore::IntPoint&);
+    void pageTransitionViewportReady();
 #endif
-
 #if PLATFORM(QT)
-    void pageTransitionViewportReady();
     void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
 #endif
 
index e1d72fc..197f20d 100644 (file)
@@ -75,9 +75,9 @@ messages -> WebPageProxy {
 
 #if USE(TILED_BACKING_STORE)
     PageDidRequestScroll(WebCore::IntPoint point)
+    PageTransitionViewportReady()
 #endif
 #if PLATFORM(QT)
-    PageTransitionViewportReady()
     DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area)
     AuthenticationRequiredRequest(WTF::String hostname, WTF::String realm, WTF::String prefilledUsername) -> (WTF::String username, WTF::String password)
     CertificateVerificationRequest(WTF::String hostname) -> (bool ignoreErrors)
index 2425b15..7c042c1 100644 (file)
@@ -122,6 +122,17 @@ void PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFra
     ewk_view_load_provisional_failed(ewkView, ewkError.get());
 }
 
+#if USE(TILED_BACKING_STORE)
+void PageLoadClientEfl::didCommitLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef, const void* clientInfo)
+{
+    if (!WKFrameIsMainFrame(frame))
+        return;
+
+    Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
+    ewk_view_load_committed(ewkView);
+}
+#endif
+
 void PageLoadClientEfl::didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
 {
     Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
@@ -168,6 +179,9 @@ PageLoadClientEfl::PageLoadClientEfl(Evas_Object* view)
     loadClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
     loadClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
     loadClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
+#if USE(TILED_BACKING_STORE)
+    loadClient.didCommitLoadForFrame = didCommitLoadForFrame;
+#endif
     loadClient.didChangeBackForwardList = didChangeBackForwardList;
     loadClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
     WKPageSetPageLoaderClient(pageRef, &loadClient);
index 68cc17d..6b78f56 100644 (file)
@@ -56,6 +56,9 @@ private:
     static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
     static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
     static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
+#if USE(TILED_BACKING_STORE)
+    static void didCommitLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
+#endif
     static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo);
     static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo);
 
index e5a7829..4642946 100644 (file)
@@ -85,11 +85,6 @@ void WebPageProxy::cancelComposition()
     process()->send(Messages::WebPage::CancelComposition(), m_pageID);
 }
 
-void WebPageProxy::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
-{
-    m_pageClient->didRenderFrame(contentsSize, coveredRect);
-}
-
 void WebPageProxy::registerApplicationScheme(const String& scheme)
 {
     process()->send(Messages::WebPage::RegisterApplicationScheme(scheme), m_pageID);
@@ -121,11 +116,6 @@ void WebPageProxy::setUserScripts(const Vector<String>& scripts)
     process()->send(Messages::WebPage::SetUserScripts(scripts), m_pageID);
 }
 
-void WebPageProxy::pageTransitionViewportReady()
-{
-    m_pageClient->pageTransitionViewportReady();
-}
-
 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)
 {
     m_pageClient->didFindZoomableArea(target, area);
index 3d8583d..9de81bd 100644 (file)
@@ -1854,7 +1854,7 @@ void WebPage::didStartPageTransition()
 
 void WebPage::didCompletePageTransition()
 {
-#if PLATFORM(QT)
+#if USE(TILED_BACKING_STORE)
     if (m_mainFrame->coreFrame()->view()->delegatesScrolling())
         // Wait until the UI process sent us the visible rect it wants rendered.
         send(Messages::WebPageProxy::PageTransitionViewportReady());