[Qt][WK2] Make TiledDrawingArea request tiles only in the direction the viewport...
authorjocelyn.turcotte@nokia.com <jocelyn.turcotte@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Sep 2011 17:35:21 +0000 (17:35 +0000)
committerjocelyn.turcotte@nokia.com <jocelyn.turcotte@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Sep 2011 17:35:21 +0000 (17:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67606

Source/WebCore:

Reviewed by Noam Rosenthal.

TiledBackingStore previously used different values for horizontal and vertial multiplication
to calculate the cover area.
This patch replaces this mechanism, used to give a bigger panning range to vertical panning,
with the possibility to use the motion vector of the viewport to request tiles ahead instead.
This allows economies on rendering resources as tiles won't be rendered beside the trajectory
of the viewport.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setKeepAndCoverAreaMultipliers):
(WebCore::TiledBackingStore::setCoverAreaFocusVector):
(WebCore::TiledBackingStore::createTiles):
(WebCore::TiledBackingStore::calculateKeepRect):
(WebCore::TiledBackingStore::calculateCoverRect):
* platform/graphics/TiledBackingStore.h:
(WebCore::TiledBackingStore::getKeepAndCoverAreaMultipliers):

Source/WebKit/qt:

TiledBackingStore previously used different values for horizontal and vertial multiplication
to calculate the cover area.
This patch replaces this mechanism, used to give a bigger panning range to vertical panning,
with the possibility to use the motion vector of the viewport to request tiles ahead instead.
This allows economies on rendering resources as tiles won't be rendered beside the trajectory
of the viewport.

* Api/qwebpage.cpp:
(QWebPagePrivate::dynamicPropertyChangeEvent):

Source/WebKit2:

TiledBackingStore previously used different values for horizontal and vertial multiplication
to calculate the cover area.
This patch replaces this mechanism, used to give a bigger panning range to vertical panning,
with the possibility to use the motion vector of the viewport to request tiles ahead instead.
This allows economies on rendering resources as tiles won't be rendered beside the trajectory
of the viewport.

* UIProcess/API/qt/qtouchwebview.cpp:
(QTouchWebViewPrivate::QTouchWebViewPrivate):
(QTouchWebViewPrivate::_q_viewportMotionVectorChanged):
* UIProcess/API/qt/qtouchwebview.h:
* UIProcess/API/qt/qtouchwebview_p.h:
* UIProcess/TiledDrawingAreaProxy.cpp:
(WebKit::TiledDrawingAreaProxy::setVisibleContentRectMotionVector):
* UIProcess/TiledDrawingAreaProxy.h:
* UIProcess/qt/ViewportInteractionEngine.cpp:
(WebKit::ViewportInteractionEngine::panGestureRequestUpdate):
(WebKit::ViewportInteractionEngine::panGestureEnded):
(WebKit::ViewportInteractionEngine::pinchGestureStarted):
* UIProcess/qt/ViewportInteractionEngine.h:
* UIProcess/qt/qtouchwebpageproxy.cpp:
(QTouchWebPageProxy::setVisibleContentRectMotionVector):
* UIProcess/qt/qtouchwebpageproxy.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::setVisibleContentRectMotionVector):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/TiledDrawingArea.cpp:
(WebKit::TiledDrawingArea::setVisibleContentRectMotionVector):
* WebProcess/WebPage/TiledDrawingArea.h:

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

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/TiledBackingStore.cpp
Source/WebCore/platform/graphics/TiledBackingStore.h
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp
Source/WebKit2/UIProcess/API/qt/qtouchwebview.h
Source/WebKit2/UIProcess/API/qt/qtouchwebview_p.h
Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp
Source/WebKit2/UIProcess/TiledDrawingAreaProxy.h
Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.cpp
Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.h
Source/WebKit2/UIProcess/qt/qtouchwebpageproxy.cpp
Source/WebKit2/UIProcess/qt/qtouchwebpageproxy.h
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/TiledDrawingArea.h

index fa33761..92ab025 100644 (file)
@@ -1,3 +1,27 @@
+2011-09-05  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        [Qt][WK2] Make TiledDrawingArea request tiles only in the direction the viewport is panned to.
+        https://bugs.webkit.org/show_bug.cgi?id=67606
+
+        Reviewed by Noam Rosenthal.
+
+        TiledBackingStore previously used different values for horizontal and vertial multiplication
+        to calculate the cover area.
+        This patch replaces this mechanism, used to give a bigger panning range to vertical panning,
+        with the possibility to use the motion vector of the viewport to request tiles ahead instead.
+        This allows economies on rendering resources as tiles won't be rendered beside the trajectory
+        of the viewport.
+
+        * platform/graphics/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::TiledBackingStore):
+        (WebCore::TiledBackingStore::setKeepAndCoverAreaMultipliers):
+        (WebCore::TiledBackingStore::setCoverAreaFocusVector):
+        (WebCore::TiledBackingStore::createTiles):
+        (WebCore::TiledBackingStore::calculateKeepRect):
+        (WebCore::TiledBackingStore::calculateCoverRect):
+        * platform/graphics/TiledBackingStore.h:
+        (WebCore::TiledBackingStore::getKeepAndCoverAreaMultipliers):
+
 2011-09-01  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         [Qt] TiledBackingStore: Import the resizeEdgeTiles logic from TiledDrawindAreaProxy.
index 39ff270..45c20bc 100644 (file)
@@ -43,12 +43,13 @@ TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client, PassOwnPtr
     , m_tileCreationTimer(new TileTimer(this, &TiledBackingStore::tileCreationTimerFired))
     , m_tileSize(defaultTileWidth, defaultTileHeight)
     , m_tileCreationDelay(0.01)
-    , m_keepAreaMultiplier(2.f, 3.5f)
-    , m_coverAreaMultiplier(1.5f, 2.5f)
+    , m_keepAreaMultiplier(3.5f)
+    , m_coverAreaMultiplier(2.5f)
     , m_contentsScale(1.f)
     , m_pendingScale(0)
     , m_contentsFrozen(false)
 {
+    ASSERT(m_coverAreaMultiplier <= m_keepAreaMultiplier);
 }
 
 TiledBackingStore::~TiledBackingStore()
@@ -69,13 +70,23 @@ void TiledBackingStore::setTileCreationDelay(double delay)
     m_tileCreationDelay = delay;
 }
 
-void TiledBackingStore::setKeepAndCoverAreaMultipliers(const FloatSize& keepMultiplier, const FloatSize& coverMultiplier)
+void TiledBackingStore::setKeepAndCoverAreaMultipliers(float keepMultiplier, float coverMultiplier)
 {
+    ASSERT(coverMultiplier <= keepMultiplier);
     m_keepAreaMultiplier = keepMultiplier;
     m_coverAreaMultiplier = coverMultiplier;
     startTileCreationTimer();
 }
 
+void TiledBackingStore::setVisibleRectTrajectoryVector(const FloatPoint& vector)
+{
+    if (m_visibleRectTrajectoryVector == vector)
+        return;
+
+    m_visibleRectTrajectoryVector = vector;
+    startTileCreationTimer();
+}
+
 void TiledBackingStore::invalidate(const IntRect& contentsDirtyRect)
 {
     IntRect dirtyRect(mapFromContents(contentsDirtyRect));
@@ -240,19 +251,12 @@ void TiledBackingStore::createTiles()
     // Resize tiles on edges in case the contents size has changed.
     bool didResizeTiles = resizeEdgeTiles();
 
-    IntRect keepRect = visibleRect;
-    // Inflates to both sides, so divide inflate delta by 2
-    keepRect.inflateX(visibleRect.width() * (m_keepAreaMultiplier.width() - 1.f) / 2);
-    keepRect.inflateY(visibleRect.height() * (m_keepAreaMultiplier.height() - 1.f) / 2);
-    keepRect.intersect(contentsRect());
+    IntRect keepRect = computeKeepRect(visibleRect);
     
     dropTilesOutsideRect(keepRect);
     
-    IntRect coverRect = visibleRect;
-    // Inflates to both sides, so divide inflate delta by 2
-    coverRect.inflateX(visibleRect.width() * (m_coverAreaMultiplier.width() - 1.f) / 2);
-    coverRect.inflateY(visibleRect.height() * (m_coverAreaMultiplier.height() - 1.f) / 2);
-    coverRect.intersect(contentsRect());
+    IntRect coverRect = computeCoverRect(visibleRect);
+    ASSERT(keepRect.contains(coverRect));
     
     // Search for the tile position closest to the viewport center that does not yet contain a tile. 
     // Which position is considered the closest depends on the tileDistance function.
@@ -296,6 +300,44 @@ void TiledBackingStore::createTiles()
         m_tileCreationTimer->startOneShot(m_tileCreationDelay);
 }
 
+IntRect TiledBackingStore::computeKeepRect(const IntRect& visibleRect) const
+{
+    IntRect result = visibleRect;
+    // Inflates to both sides, so divide the inflate delta by 2.
+    result.inflateX(visibleRect.width() * (m_keepAreaMultiplier - 1) / 2);
+    result.inflateY(visibleRect.height() * (m_keepAreaMultiplier - 1) / 2);
+    result.intersect(contentsRect());
+
+    return result;
+}
+
+// A null trajectory vector means that tiles intersecting all the coverArea (i.e. visibleRect * coverMultiplier) will be created.
+// A non-null trajectory vector will shrink the intersection rect to visibleRect plus its expansion from its
+// center toward the cover area edges in the direction of the given vector.
+// E.g. if visibleRect == (10,10)5x5 and coverMultiplier == 3.0:
+// a (0,0) trajectory vector will create tiles intersecting (5,5)15x15,
+// a (1,0) trajectory vector will create tiles intersecting (10,10)10x5,
+// and a (1,1) trajectory vector will create tiles intersecting (10,10)10x10.
+IntRect TiledBackingStore::computeCoverRect(const IntRect& visibleRect) const
+{
+    IntRect result = visibleRect;
+    float trajectoryVectorNorm = sqrt(pow(m_visibleRectTrajectoryVector.x(), 2) + pow(m_visibleRectTrajectoryVector.y(), 2));
+    if (trajectoryVectorNorm > 0) {
+        // Multiply the vector by the distance to the edge of the cover area.
+        float trajectoryVectorMultiplier = (m_coverAreaMultiplier - 1) / 2;
+        // Unite the visible rect with a "ghost" of the visible rect moved in the direction of the trajectory vector.
+        result.move(result.width() * m_visibleRectTrajectoryVector.x() / trajectoryVectorNorm * trajectoryVectorMultiplier,
+                    result.height() * m_visibleRectTrajectoryVector.y() / trajectoryVectorNorm * trajectoryVectorMultiplier);
+        result.unite(visibleRect);
+    } else {
+        result.inflateX(visibleRect.width() * (m_coverAreaMultiplier - 1) / 2);
+        result.inflateY(visibleRect.height() * (m_coverAreaMultiplier - 1) / 2);
+    }
+    result.intersect(contentsRect());
+
+    return result;
+}
+
 bool TiledBackingStore::resizeEdgeTiles()
 {
     IntRect contentsRect = this->contentsRect();
index 9d1a97a..1e9656b 100644 (file)
@@ -22,7 +22,7 @@
 
 #if ENABLE(TILED_BACKING_STORE)
 
-#include "FloatSize.h"
+#include "FloatPoint.h"
 #include "IntPoint.h"
 #include "IntRect.h"
 #include "Tile.h"
@@ -64,12 +64,13 @@ public:
     void setTileCreationDelay(double delay);
     
     // Tiled are dropped outside the keep area, and created for cover area. The values a relative to the viewport size.
-    void getKeepAndCoverAreaMultipliers(FloatSize& keepMultiplier, FloatSize& coverMultiplier)
+    void getKeepAndCoverAreaMultipliers(float& keepMultiplier, float& coverMultiplier)
     {
         keepMultiplier = m_keepAreaMultiplier;
         coverMultiplier = m_coverAreaMultiplier;
     }
-    void setKeepAndCoverAreaMultipliers(const FloatSize& keepMultiplier, const FloatSize& coverMultiplier);    
+    void setKeepAndCoverAreaMultipliers(float keepMultiplier, float coverMultiplier);
+    void setVisibleRectTrajectoryVector(const FloatPoint&);
 
     IntRect mapToContents(const IntRect&) const;
     IntRect mapFromContents(const IntRect&) const;
@@ -89,6 +90,8 @@ private:
     void tileCreationTimerFired(TileTimer*);
     
     void createTiles();
+    IntRect computeKeepRect(const IntRect& visibleRect) const;
+    IntRect computeCoverRect(const IntRect& visibleRect) const;
     
     void commitScaleChange();
 
@@ -115,8 +118,9 @@ private:
 
     IntSize m_tileSize;
     double m_tileCreationDelay;
-    FloatSize m_keepAreaMultiplier;
-    FloatSize m_coverAreaMultiplier;
+    float m_keepAreaMultiplier;
+    float m_coverAreaMultiplier;
+    FloatPoint m_visibleRectTrajectoryVector;
     
     IntRect m_previousVisibleRect;
     float m_contentsScale;
index b2374b6..376ee70 100644 (file)
@@ -1218,21 +1218,23 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev
         WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
         if (!frame->tiledBackingStore())
             return;
-        FloatSize keepMultiplier;
-        FloatSize coverMultiplier;
+        float keepMultiplier;
+        float coverMultiplier;
         frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
         QSizeF qSize = q->property("_q_TiledBackingStoreKeepAreaMultiplier").toSizeF();
-        keepMultiplier = FloatSize(qSize.width(), qSize.height());
+        // setKeepAndCoverAreaMultipliers do not use FloatSize anymore, keep only the height part.
+        keepMultiplier = qSize.height();
         frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
     } else if (event->propertyName() == "_q_TiledBackingStoreCoverAreaMultiplier") {
         WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
         if (!frame->tiledBackingStore())
             return;
-        FloatSize keepMultiplier;
-        FloatSize coverMultiplier;
+        float keepMultiplier;
+        float coverMultiplier;
         frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
         QSizeF qSize = q->property("_q_TiledBackingStoreCoverAreaMultiplier").toSizeF();
-        coverMultiplier = FloatSize(qSize.width(), qSize.height());
+        // setKeepAndCoverAreaMultipliers do not use FloatSize anymore, keep only the height part.
+        coverMultiplier = qSize.height();
         frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
     }
 #endif
index b7845ea..3500bd0 100644 (file)
@@ -1,3 +1,18 @@
+2011-09-05  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        [Qt][WK2] Make TiledDrawingArea request tiles only in the direction the viewport is panned to.
+        https://bugs.webkit.org/show_bug.cgi?id=67606
+
+        TiledBackingStore previously used different values for horizontal and vertial multiplication
+        to calculate the cover area. 
+        This patch replaces this mechanism, used to give a bigger panning range to vertical panning,
+        with the possibility to use the motion vector of the viewport to request tiles ahead instead.
+        This allows economies on rendering resources as tiles won't be rendered beside the trajectory
+        of the viewport.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::dynamicPropertyChangeEvent):
+
 2011-09-06  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Unreviewed buildfix after r94620.
index 70d245a..102f0ce 100644 (file)
@@ -1,3 +1,38 @@
+2011-09-05  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
+
+        [Qt][WK2] Make TiledDrawingArea request tiles only in the direction the viewport is panned to.
+        https://bugs.webkit.org/show_bug.cgi?id=67606
+
+        TiledBackingStore previously used different values for horizontal and vertial multiplication
+        to calculate the cover area. 
+        This patch replaces this mechanism, used to give a bigger panning range to vertical panning,
+        with the possibility to use the motion vector of the viewport to request tiles ahead instead.
+        This allows economies on rendering resources as tiles won't be rendered beside the trajectory
+        of the viewport.
+
+        * UIProcess/API/qt/qtouchwebview.cpp:
+        (QTouchWebViewPrivate::QTouchWebViewPrivate):
+        (QTouchWebViewPrivate::_q_viewportMotionVectorChanged):
+        * UIProcess/API/qt/qtouchwebview.h:
+        * UIProcess/API/qt/qtouchwebview_p.h:
+        * UIProcess/TiledDrawingAreaProxy.cpp:
+        (WebKit::TiledDrawingAreaProxy::setVisibleContentRectMotionVector):
+        * UIProcess/TiledDrawingAreaProxy.h:
+        * UIProcess/qt/ViewportInteractionEngine.cpp:
+        (WebKit::ViewportInteractionEngine::panGestureRequestUpdate):
+        (WebKit::ViewportInteractionEngine::panGestureEnded):
+        (WebKit::ViewportInteractionEngine::pinchGestureStarted):
+        * UIProcess/qt/ViewportInteractionEngine.h:
+        * UIProcess/qt/qtouchwebpageproxy.cpp:
+        (QTouchWebPageProxy::setVisibleContentRectMotionVector):
+        * UIProcess/qt/qtouchwebpageproxy.h:
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::setVisibleContentRectMotionVector):
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        * WebProcess/WebPage/TiledDrawingArea.cpp:
+        (WebKit::TiledDrawingArea::setVisibleContentRectMotionVector):
+        * WebProcess/WebPage/TiledDrawingArea.h:
+
 2011-09-01  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         [Qt] TiledBackingStore: Import the resizeEdgeTiles logic from TiledDrawindAreaProxy.
index 029e8ce..68905e9 100644 (file)
@@ -40,6 +40,7 @@ QTouchWebViewPrivate::QTouchWebViewPrivate(QTouchWebView* q)
     pageViewPrivate->setPage(&page);
 
     QObject::connect(&interactionEngine, SIGNAL(viewportUpdateRequested()), q, SLOT(_q_viewportUpdated()));
+    QObject::connect(&interactionEngine, SIGNAL(viewportTrajectoryVectorChanged(const QPointF&)), q, SLOT(_q_viewportTrajectoryVectorChanged(const QPointF&)));
 }
 
 void QTouchWebViewPrivate::loadDidCommit()
@@ -54,6 +55,11 @@ void QTouchWebViewPrivate::_q_viewportUpdated()
     page.setVisibleContentRectAndScale(visibleRectInPageViewCoordinate, scale);
 }
 
+void QTouchWebViewPrivate::_q_viewportTrajectoryVectorChanged(const QPointF& trajectoryVector)
+{
+    page.setVisibleContentRectTrajectoryVector(trajectoryVector);
+}
+
 void QTouchWebViewPrivate::updateViewportConstraints()
 {
     QSize availableSize = q->boundingRect().size().toSize();
index be6d6f5..ce23f4f 100644 (file)
@@ -48,6 +48,7 @@ protected:
 
 private:
     Q_PRIVATE_SLOT(d, void _q_viewportUpdated());
+    Q_PRIVATE_SLOT(d, void _q_viewportTrajectoryVectorChanged(const QPointF&));
 
     friend class WebKit::TouchViewInterface;
     QTouchWebViewPrivate *d;
index 6f2152c..0659e5e 100644 (file)
@@ -36,6 +36,7 @@ public:
 
     void loadDidCommit();
     void _q_viewportUpdated();
+    void _q_viewportTrajectoryVectorChanged(const QPointF&);
     void updateViewportConstraints();
 
     void setViewportArguments(const WebCore::ViewportArguments& args);
index 45e3dfc..2b4a6b6 100644 (file)
@@ -61,6 +61,11 @@ void TiledDrawingAreaProxy::setVisibleContentRectAndScale(const WebCore::IntRect
     page()->process()->send(Messages::DrawingArea::SetVisibleContentRectAndScale(visibleContentRect, scale), page()->pageID());
 }
 
+void TiledDrawingAreaProxy::setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint& trajectoryVector)
+{
+    page()->process()->send(Messages::DrawingArea::SetVisibleContentRectTrajectoryVector(trajectoryVector), page()->pageID());
+}
+
 void TiledDrawingAreaProxy::renderNextFrame()
 {
     page()->process()->send(Messages::DrawingArea::RenderNextFrame(), page()->pageID());
index a425745..d894ddb 100644 (file)
@@ -72,6 +72,7 @@ public:
     virtual ~TiledDrawingAreaProxy();
 
     void setVisibleContentRectAndScale(const WebCore::IntRect&, float);
+    void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&);
     void renderNextFrame();
 
 #if USE(ACCELERATED_COMPOSITING)
index 15de2ab..accb148 100644 (file)
@@ -139,6 +139,8 @@ void ViewportInteractionEngine::panGestureRequestUpdate(qreal deltaX, qreal delt
     QPointF destInViewportCoords = m_viewport->mapFromItem(m_content, itemPositionInItemCoords + QPointF(deltaX, deltaY));
 
     m_content->setPos(destInViewportCoords);
+    // This must be emitted before viewportUpdateRequested so that the web process knows where to look for tiles.
+    emit viewportTrajectoryVectorChanged(QPointF(-deltaX, -deltaY));
 }
 
 void ViewportInteractionEngine::panGestureCancelled()
@@ -152,6 +154,7 @@ void ViewportInteractionEngine::panGestureEnded()
 {
     ViewportUpdateGuard guard(this);
     animateContentIntoBoundariesIfNeeded();
+    // FIXME: emit viewportTrajectoryVectorChanged(QPointF()) when the pan throw animation ends and the page stops moving.
 }
 
 void ViewportInteractionEngine::pinchGestureStarted()
@@ -164,6 +167,9 @@ void ViewportInteractionEngine::pinchGestureStarted()
     m_userInteractionFlags |= UserHasScaledContent;
     m_userInteractionFlags |= UserHasMovedContent;
     m_pinchStartScale = m_content->scale();
+
+    // Reset the tiling look-ahead vector so that tiles all around the viewport will be requested on pinch-end.
+    emit viewportTrajectoryVectorChanged(QPointF());
 }
 
 void ViewportInteractionEngine::pinchGestureRequestUpdate(const QPointF& pinchCenterInContentCoordinate, qreal totalScaleFactor)
index ae277de..544087e 100644 (file)
@@ -69,6 +69,7 @@ public:
 
 Q_SIGNALS:
     void viewportUpdateRequested();
+    void viewportTrajectoryVectorChanged(const QPointF&);
 
 private Q_SLOTS:
     // Respond to changes of content that are not driven by us, like the page resizing itself.
index da84db0..a8eb4b6 100644 (file)
@@ -86,6 +86,11 @@ void QTouchWebPageProxy::setVisibleContentRectAndScale(const QRectF& visibleCont
     m_webPageProxy->setFixedVisibleContentRect(alignedVisibleContentRect);
 }
 
+void QTouchWebPageProxy::setVisibleContentRectTrajectoryVector(const QPointF& trajectoryVector)
+{
+    drawingArea()->setVisibleContentRectTrajectoryVector(trajectoryVector);
+}
+
 void QTouchWebPageProxy::setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize)
 {
     m_webPageProxy->setResizesToContentsUsingLayoutSize(targetLayoutSize);
index 7831dbf..6b96ddf 100644 (file)
@@ -44,6 +44,7 @@ public:
     virtual bool handleEvent(QEvent*);
 
     void setVisibleContentRectAndScale(const QRectF&, float);
+    void setVisibleContentRectTrajectoryVector(const QPointF&);
     void setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize);
     void findZoomableAreaForPoint(const QPoint&);
     void renderNextFrame();
index 4a85211..52fdddd 100644 (file)
@@ -27,6 +27,7 @@
 #define DrawingArea_h
 
 #include "DrawingAreaInfo.h"
+#include <WebCore/FloatPoint.h>
 #include <WebCore/IntRect.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/PassOwnPtr.h>
@@ -100,6 +101,7 @@ private:
 #if ENABLE(TILED_BACKING_STORE)
     virtual void setSize(const WebCore::IntSize& viewSize) { }
     virtual void setVisibleContentRectAndScale(const WebCore::IntRect&, float) { }
+    virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&) { }
     virtual void setContentsScale(float scale) { }
     virtual void renderNextFrame() { }
     virtual void takeSnapshot(const WebCore::IntSize& targetSize, const WebCore::IntRect& contentsRect) { }
index 36356ad..3b602db 100644 (file)
@@ -29,6 +29,7 @@ messages -> DrawingArea {
 #if ENABLE(TILED_BACKING_STORE)
     SetSize(WebCore::IntSize viewSize)
     SetVisibleContentRectAndScale(WebCore::IntRect visibleContentRect, float scale)
+    SetVisibleContentRectTrajectoryVector(WebCore::FloatPoint trajectoryVector)
     RenderNextFrame()
     TakeSnapshot(WebCore::IntSize size, WebCore::IntRect contentsRect)
 #endif
index 696fe02..faa6cdd 100644 (file)
@@ -89,6 +89,11 @@ void TiledDrawingArea::setVisibleContentRectAndScale(const WebCore::IntRect& vis
         m_mainBackingStore->adjustVisibleRect();
 }
 
+void TiledDrawingArea::setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint& trajectoryVector)
+{
+    m_mainBackingStore->setVisibleRectTrajectoryVector(trajectoryVector);
+}
+
 void TiledDrawingArea::renderNextFrame()
 {
     m_isWaitingForUIProcess = false;
index 5d7c5f3..ed13d2a 100644 (file)
@@ -55,6 +55,7 @@ private:
     // CoreIPC message handlers.
     virtual void setSize(const WebCore::IntSize& viewSize);
     virtual void setVisibleContentRectAndScale(const WebCore::IntRect&, float);
+    virtual void setVisibleContentRectTrajectoryVector(const WebCore::FloatPoint&);
     virtual void renderNextFrame();
     virtual void suspendPainting();
     virtual void resumePainting();